Scope
● Build an analytics API that will collect and analyze analytics events from a website
● Analytics event is a key-value object that contains data on a specific event like page-view.
● Our web app contains different pages that are identified by page-id each
● Our web-app send unique anonymous identifier for each user
API Requirements
● Expose rest endpoint to collect page-view events (HTTP calls from clients).
● Events can contain the following parameters (all not mandatory): timestamp, user-id, page-id
● Expose rest endpoint to get page-views by page-id
● Expose rest endpoint to get page-views by a browser name (can be extracted from the useragent)
● Expose rest endpoint to get page-views by country (should be extracted from the user IP)
● Expose rest endpoint to get the rate of returning users (users who visited more than once ) out of all the unique users who visited.
All GET endpoints should be accessed only with “6i2nSgWu0DfYIE8I0ZBJOtxTmHJATRzu” token string in the Authorization header.
Technology Stack
● Node.js
● Data store of your choice
docker-compose -f docker-compose.yml up -d
Then navigate to http://localhost:3000/api-docs/ to see Swagger GUI page with api description. Service require authorization token, see config/config.json
npm run migration npm start
npm run test npm run eslint