The project requires a connection to MongoDB.
In prod environment it uses free instance of MongoDB Atlas cluster.
- Provide your MongoDB credentials
- issue
npm i
- issue
npm start
- visit http://localhost:3000/mock-ad/ad
- Provide your MongoDB credentials
- issue
npm i
- issue
npm test
- https://ads-tracker-cldnry.herokuapp.com/mock-ad/google - mock ad for Google.com
- https://ads-tracker-cldnry.herokuapp.com/report/2020-11-14 - generate report for 2020-11-14
- https://ads-tracker-cldnry.herokuapp.com/event with payload
{"ad":"google.com", "type": "click"}
andContent-Type: text/plain
- to report an interaction with Google.com ad.
Application is deployed through Github Actions Pipeline to Heroku PaaS.
Please find the app under following link: https://ads-tracker-cldnry.herokuapp.com/
/event
- allows tracking of ad events.
Accepts POST requests with following body:
{
"ad": "string",
"type": "string"
}
where type
is either load
or clicked
/reports/:date
- allows generating daily events report Accepts GET requests with:date
parameter inyyyy-MM-dd
format
- c4 model chosen as an appropriate tool for architecture visualization
- ad mocker integrated into the tracking api through a separate mocking router
- date-fns for handling dates
- assumed enGB locale
- dateProvider as an injectable plain JS object to make testing and possible future operations on dates isolated