Tiniest E-Commerce skeleton with microservices architecture with NodeJS. This is an attempt to cover basics of microservices architecture. Many concepts/tools are being used.
Please note that connections to MongoDB and RabbitMQ are made without authentication. Make sure to do the necessary changes to the code if authentication is required
expressfor exposing REST endpointsjsonwebtokenfor authentication tokensamqplibas a client for RabbitMQmongooseas the Object data Mapper for MongoDB@nirangad/is-authenticatedis used as a middleware forexpressto validate Authorization header for the token- NPM -
npm i @nirangad/is-authenticated - GitHub Repo
- NPM -
- For input validation,
express-validatoris used- Reference: https://express-validator.github.io/docs/
winstonandexpress-winstonfor Logging.access.loganderror.logwill be created underlogsfolder- Comment/Uncomment
app.use(logger())in theindex.tsof any service
- Comment/Uncomment
i18nextused to handle localization in the API responses.- At the moment it supports only English and German
- New languages can be enabled by updating
supportedLngsincommon\locales\localize.ts - New resources file should be placed in
common\locales\i18nwith<language_code>.jsonas the file name - German translation are taken directly from Google Translate. So might not be accurate
- All services are dockerized and
docker-composeis used to spin everything up and/or shut it all down