This service uses express-generator
to scaffold the application structure which was later modified.
The API Postman documentation can be download API Documentation and the environment configuration from API Environment
All that is needed to be done is:
$ npm install
$ npm run start
Visit http://localhost:4000/api/v1/ as the base of the service URL.
All library usage can be found in package.json
and engine setup is on
node 15.X and above
npm 7.X and above
bin/
src/
configs/
controllers/
dtos/
models/
routes/
services/
utils/
server.js
.env
There is a schedule that clean up expired cache data from database and the in-memory db to avoid overloading the database.
Cache duration are in seconds and scheduler run every 10 seconds to take out expired data configured with durations.
Made use of environment system called .env
to handle some global configuration for the server side through the dotenv
library.
This is added as part of the repo only for the sake of easy access.
Bare Javascript is used to avoid transpile ATM but this is design on OOP concept.
1. Favoured application decoupling.
2. Easy to manage, maintainability and ease for new developer to join with less work through.
3. Applied MVC pattern
4. Stay true to SOLID, KISS and DRY principles.
5. Service based approach is used to make sure segragation of concerns are met.
The use of mongodb and in-memory to handle quick reliable data access is to aid performance and in situation of service restart or the in-memory in damaged, it will rely solely on the mongo db data stored to retrieve information not found in the in-memory DB