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
express
for exposing REST endpointsjsonwebtoken
for authentication tokensamqplib
as a client for RabbitMQmongoose
as the Object data Mapper for MongoDB@nirangad/is-authenticated
is used as a middleware forexpress
to validate Authorization header for the token- NPM -
npm i @nirangad/is-authenticated
- GitHub Repo
- NPM -
- For input validation,
express-validator
is used- Reference: https://express-validator.github.io/docs/
winston
andexpress-winston
for Logging.access.log
anderror.log
will be created underlogs
folder- Comment/Uncomment
app.use(logger())
in theindex.ts
of any service
- Comment/Uncomment
i18next
used to handle localization in the API responses.- At the moment it supports only English and German
- New languages can be enabled by updating
supportedLngs
incommon\locales\localize.ts
- New resources file should be placed in
common\locales\i18n
with<language_code>.json
as the file name - German translation are taken directly from Google Translate. So might not be accurate
- All services are dockerized and
docker-compose
is used to spin everything up and/or shut it all down