https://github.com/adebsalert/gronda-event-tracking-api
https://github.com/adebsalert/gronda-event-tracking-api
Last synced: about 2 months ago
JSON representation
- Host: GitHub
- URL: https://github.com/adebsalert/gronda-event-tracking-api
- Owner: AdebsAlert
- Created: 2021-02-15T15:03:27.000Z (over 5 years ago)
- Default Branch: main
- Last Pushed: 2021-02-15T15:06:58.000Z (over 5 years ago)
- Last Synced: 2025-09-22T19:42:48.668Z (9 months ago)
- Language: HTML
- Size: 9.91 MB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Gronda Event Tracker API
## Installation
- Install NodeJS, MongoDB
- Install `npm` or `yarn`
- Rename `.env.example` to `.env`
- Edit variables in `.env`
- Run `npm install`
- Start MongoDB
- Run `yarn run dev` or `npm run dev`
- Check `http://localhost:3000/api/status` to see it works and for health check
## Database - MongoDB. Why?
- Flexibility: with mongodb its easy to store and incorporate data of any structure and allow vital adjustments of the schema without impacting performance.
- Scalability and performance: With a NoSQL database; it has been built to scale, they all include sharding - which is a method for distributing data across multiple datasets, and partitioning - breaking down data into chunks. This allows the database to scale.
- Speed - As MongoDB is a document-oriented database, it is easy to access your documents by indexing. This provides a faster query response. Some research has shown that the speed of MongoDB could be 100x faster than a relational database.
# Architecture
## Architecture Overview:
- Design pattern - Monolithic
- Programming language - JavaScript/Nodejs
- Database - MongoDB
## Architecture Details:
- Design pattern - Monolithic: a single backend codebase that will contain all the functions of the system, separated as modules but connected. E.g, event module will feed functionalities on the analytics management.
- Programming language - JavaScript/Nodejs: backend codebase will be written in Nodejs.
- Database - MongoDB: Datastore is MongoDB and indexing will be enabled to support efficient execution of DB queries.
## Architecture Diagram:

# Routes
- POST `baseUrl/api/v1/event` - create a new event
{
client: 'macbook pro 2020',
receiver: 'web',
event_name: 'loginButtonClick',
event_identifier: Math.random().toString(36).substring(2, 15)
}
- GET `baseUrl/api/v1/analytics?` - get analytics
- params - skip = 20, limit = 10, data = count|data, client = '', event_name = ''