Explaining directory structure.
-
configs/
: This directory contains all the configuration for the current setup.- Make sure to create a
.env
file and with following lines and save it inconfigs
directory.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.js
contains all the models relating to authentication router or authentication block.
-
logs/
: This directory contains all the logs generated bycontrollers/controller.logger.js
in 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.*.js
involves multiple logic or gets cumbersome, it can be moved into blogic for sake or clarity or additional layer of business seperation. Forrouter.*.js
file corrosponding blogic file will beblogic/blogic.*.js
. For example, blogic file forrouter.B2B.Authentication.js
androuter.B2B.Authentication.js
isblogic/blogic.authentication.js
, ideally there should be two blogic file seperately forB2B.Authentication
andB2C.Authentication
, this can be incorporated later on.middleware/
: Similarly middleware logic are contained inmiddleware/middleware.*.js
for corrospondingrouter.*.js
file, currentlyrouter.B2B.Authentication.js
androuter.B2C.Authentication.js
both have samemiddleware/middleware.authentication.js
as both use this module commonly.uploads/
: Contains all the uploaded session files.