This project demonstrates how to create a microservice architecture using NestJS, MySQL, Docker, and NATS.
Ensure you have the following installed on your machine:
- Node.js
- Docker
- Docker Compose
NestJS is a progressive Node.js framework for building efficient and scalable server-side applications.
MySQL is a relational database management system based on SQL – Structured Query Language.
Docker is a platform for containerizing applications to ensure consistency across different environments.
NATS is a high-performance messaging system for cloud-native applications and microservices architectures.
This project includes the following microservices and components:
http-api-gateway
: Handles routing and serves as the entry point for the microservices.users-microservice
: Manages user-related operations.payments-microservice
: Handles payment processing.
-
Ensure Docker and Docker Compose are installed on your machine.
-
Build and start all services (including microservices, MySQL, and NATS) with Docker Compose:
docker-compose up --build
This command will spin up the
http-api-gateway
,users-microservice
,payments-microservice
, as well as the MySQL and NATS services. -
Verify the setup by checking the logs and ensuring that all services are running correctly.
This setup provides a complete microservice architecture using NestJS, MySQL, Docker, and NATS. Customize and extend it to fit your specific application requirements.