Skip to content

wsromek/cloudinary-ads-backend

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Ad tracker

How to

The project requires a connection to MongoDB.

In prod environment it uses free instance of MongoDB Atlas cluster.

Run project

  1. Provide your MongoDB credentials
  2. issue npm i
  3. issue npm start
  4. visit http://localhost:3000/mock-ad/ad

Run tests

  1. Provide your MongoDB credentials
  2. issue npm i
  3. issue npm test

Example usage

Deployment

Application is deployed through Github Actions Pipeline to Heroku PaaS.

Please find the app under following link: https://ads-tracker-cldnry.herokuapp.com/

API

  • /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 in yyyy-MM-dd format

High Level Architecture

Level 0 diagram

Considerations:

  • 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

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published