- Node.js services
- RabbitMQ (message broker)
- MongoDB
- Docker
The repository represents the backend for a cat adoption center application, which is managed by the following microservices:
- User Service: For user management.
- Cat Service: For cat management.
- Notifications Service: Sends notifications to users.
- RabbitMQ Message Broker: For asynchronous communication between the microservices.
Before you begin, ensure you have the following installed:
- Node.js version 16 or higher
- Docker: Install Docker
- Clone this repository to your local machine.
- Navigate to the repository's root directory.
-
Open a terminal window.
-
Navigate to each service within the
services
directory, then install and build each one using the following commands:yarn yarn build
-
Navigate to the repository's root directory.
-
Run the following command to start the application:
docker-compose up
- Image: rabbitmq:3-management
- Ports: 5672 (AMQP), 15672 (Management UI)
- Healthcheck: RabbitMQ status check
- Volumes: rabbitmq_data (for persistent data)
- Image: mongo:latest
- Port: 27017
- Volumes: mongodb_data (for persistent data)
- Custom microservice for user-related operations.
- Built from:
./services/user-service
context. - Port: 3001
- Environment variables:
- NODE_ENV: production
- PORT: 3000
- MONGODB_URI: mongodb://mongodb:27017
- AMQP_URI: amqp://guest:guest@rabbitmq:5672
- Depends on: MongoDB (service_started), RabbitMQ (service_healthy)
- Custom microservice for cat-related operations.
- Built from:
./services/cat-service
context. - Port: 3002
- Environment variables:
- NODE_ENV: production
- PORT: 3000
- MONGODB_URI: mongodb://mongodb:27017
- AMQP_URI: amqp://guest:guest@rabbitmq:5672
- Depends on: MongoDB (service_started), RabbitMQ (service_healthy)
- Custom microservice for sending notifications.
- Built from:
./services/notifications-service
context. - Port: 3003
- Environment variables:
- NODE_ENV: production
- PORT: 3000
- MONGODB_URI: mongodb://mongodb:27017
- AMQP_URI: amqp://guest:guest@rabbitmq:5672
- Depends on: MongoDB (service_started), RabbitMQ (service_healthy)