This is a REST API to support email management. Industry standard technologies have been adopted to each aspect of this project. They are
- Language - Node Js
- Framework - Express Js
- Dependency Manager - Yarn
- Transpiler - Babel
- Linter - EsLint
- Formatter - Prettier
- Task Runner - Gulp
- API Documentation - Swagger
- Source Documentation - EsDoc
- Unit Test Framework - Jest
- DB - Mongo
- Logger - Bunyan
├── src - (source folder)
│ ├── app - (all application specific files resides here)
│ │ ├── routers - (all sub level routers reside here)
│ │ | └── email (email related routes hadling router)
│ │ ├── controllers (all business logic controllers resides here)
│ │ | └── email (email related business logic hadling controller)
│ │ ├── services (all fine granular business logic handling required by controllers are done here)
│ │ | └── email (email related fine granular business logic handler)
│ │ ├── daos (all database related files resides here)
│ │ | └── mongo (all mongo related files resides here)
│ │ | | └── email (all data access files/models related to email collection)
│ │ ├── errorHandlers (all error scenarios related to business logic are handled here)
│ │ | └── email (all error scenarios related to email business logic are handled here)
│ │ ├── clients (all external api consumers)
│ │ | └── email (sendgrid api consumer)
│ │ ├── crons (all cron related files resides here)
│ │ | ├── email (all cron jobs relates to emails)
│ │ | └── index.js (single place to init & control all cron jobs)
│ │ ├── helpers (all helper modules resides here)
│ │ | ├── constants.js (all app related constants are defined here)
│ │ | └── decorator.js (all cross project helper methods are defined here)
│ │ ├── middleware (all middleware related to app resides here)
│ │ | ├── 404Handler.js (404 error handler)
│ │ | ├── errorHandler.js (ultimate error handler)
│ │ | └── reqResLogger.js (express req,res logger)
│ │ └── router.js (base router of the application)
│ ├── configs (all app related configs resides here)
│ │ ├── index.json (load env specific configs required to run the application)
│ │ └── schema.json (joi schema for app config object)
│ ├── utils (all non-app specific utilities resides here)
│ │ └── logger.js (confgiure & inti app logger)
│ ├── .eslintrc (source level linting rules)
│ ├── app.js (apply all middleware & router in order)
│ ├── daemon.js (bootstrap everything required to start the app server)
│ └── server.js (spin up the express/http server and listen on given port)
├── dist (distribution folder)
├── node_modules (all dependencies)
├── es-doc (es-doc report)
├── .babelrc (transpilling rules)
├── .env (all application/environment specific configs)
├── coverage (unit/integration test reports)
├── .esdoc.json (source documentation rules)
├── .eslintignore (files to be ingnored by eslint)
├── .eslintrc (app level linting rules)
├── .gitignore (files to be ignored by git)
├── .prettierrc (source formatting rules)
├── gulpfile.js (all automated dev tasks)
├── jest.config.js (test framework configs)
├── package.json (dependency declaration)
├── readme.md (proect read me guide)
├── swagger.json (api documentation)
└── yarn.lock (track dependency changes)
- node 8
- yarn
- copy the
.env
file to project directory - build the project using
yarn build
- start the project using
yarn start