Explaining directory structure.
-
configs/: This directory contains all the configuration for the current setup.- Make sure to create a
.envfile and with following lines and save it inconfigsdirectory.MONGO_CONNECTION_STRING = "" BCRYPT_SALT = 10
- Make sure to create a
-
controllers/: This directory contains all the vanilla implementation and modifications over the external modules. For examples:controller.db.js: This package is implementation over vanilla mongo package.controller.db.js: This package is implementation over vanilla winston package, adding customization that suits our current implementation.
-
data/: This directory contains everything relating to the data work.data/models/: This directory contains all the database models. File name gives away the related block:model.authentication.jscontains all the models relating to authentication router or authentication block.
-
logs/: This directory contains all the logs generated bycontrollers/controller.logger.jsin rotation. -
routers/: This directory contains three main components:router.*.js: Router entry file for a particular feature.blogic: Blogic for each router implementation, in case implementation ofrouter.*.jsinvolves multiple logic or gets cumbersome, it can be moved into blogic for sake or clarity or additional layer of business seperation. Forrouter.*.jsfile corrosponding blogic file will beblogic/blogic.*.js. For example, blogic file forrouter.B2B.Authentication.jsandrouter.B2B.Authentication.jsisblogic/blogic.authentication.js, ideally there should be two blogic file seperately forB2B.AuthenticationandB2C.Authentication, this can be incorporated later on.middleware/: Similarly middleware logic are contained inmiddleware/middleware.*.jsfor corrospondingrouter.*.jsfile, currentlyrouter.B2B.Authentication.jsandrouter.B2C.Authentication.jsboth have samemiddleware/middleware.authentication.jsas both use this module commonly.uploads/: Contains all the uploaded session files.

