- Node.js v20+
- NestJS v10+
- npm
- Docker & Docker Compose
- Git
-
Clone the repository:
git clone <repo-url> cd MicroservicesArchitecture-NestJS-RabbitMQ
-
Run with Docker Compose
docker compose up --build -
To stop the Services
docker compose down
- All inter-service communication (token validation, user events) is handled via RabbitMQ.
- For development, use
npm run start:devinside each service for hot-reloading. - Adjust .env files as needed for your environment.
A demonstration of a microservices architecture using NestJS and RabbitMQ for inter-service communication between an Auth Service and a Product Service.
- User authentication (registration, login, logout)
- JWT token management (access & refresh tokens)
- Product catalog management (CRUD operations)
- Service-to-service authentication via RabbitMQ RPC
- Event-driven architecture with RabbitMQ Pub/Sub
- Containerized with Docker
- Comprehensive API documentation with Swagger
- Handles user authentication and authorization
- Manages JWT tokens (access & refresh)
- Provides RPC endpoints for token validation
- Publishes user events to RabbitMQ
- Check if Service Started: http://localhost:3001/
- Swagger UI: http://localhost:3000/api
- Manages product catalog with owner-based permissions
- Consumes Auth Service via RabbitMQ RPC
- Subscribes to user events (e.g., logs when a user registers)
- Check if Service Started: http://localhost:3001/
- Swagger UI: http://localhost:3001/api
- REST APIs for external communication
- RabbitMQ for internal service communication (Pub/Sub and RPC)
- MongoDB for data persistence
- Docker for containerization
- Backend Framework: NestJS
- Message Broker: RabbitMQ
- Database: MongoDB
- ORM: Typegoose
- Containerization: Docker
- API Documentation: Swagger/OpenAPI