This project demonstrates a microservices-based architecture for User and Product management using Kafka for communication between services. It includes features like JWT-based authentication, data validation, and error logging. Feel free to use, modify, and expand upon this project for personal or professional use.
- Clone this repository: Microservices-Kafka
- An IDE or text editor like VS Code
- Node version installed above 20.12.1
- Run
npm install
to install the necessary node packages. - Install MySQL and phpMyAdmin
- Create an
.env
file based on the.env.sample
and update MongoDB credentials. - Run the following commands to start the full project
- Make the bash script executable:
chmod +x nodeServe.sh
- Run the bash script:
./nodeServe.sh
- Make the bash script executable:
- Run the Docker commands for setup the Kafka
docker-compose up -d
- Import the MIcroservice-Kafka.postman_collection.json file in postman
- Microservices APIs ready for the testing
- Make the bash script executable:
chmod +x nodeServe.sh
- Run the bash script:
./nodeServe.sh
The following topics were covered in this unit:
- User CRUD module with SignUp and Login
- Product CRUD module
- Express-Gateway
- Microservices architecture
- Kafka communication
- Request method like Get, Post, Put, Delete
- JWT authorization and authentication
- Joi validation
- Sequelize ORM
- Winston error and info loggers
- Bcrypt for password hashing and compare
- Helmet
- Eslint
- Multi environment config
- PM2 for alive forever
- Prettier for code formatter
- Postman collection
- Bash script
Node.js: | Nodejs.org |
Typescript: | typescriptlang.org |
Microservice: | microservices.io |
Kafka: | kafka.apache.org |
© 2024 Rajneshwar Singh