Build an inventory management system. The inventory management system aims to efficiently manage inventory items, track stock levels, and handle orders through a microservices architecture. The system will utilize RabbitMQ for inter-service communication and Docker for containerisation, ensuring scalability, modularity, and ease of deployment.
- Scalable Architecture: Design a microservices architecture that allows independent development, deployment, and scaling of each component.
- Robust Communication: Implement communication between microservices using RabbitMQ queues to ensure reliable message passing.
- Functional Microservices: Develop microservices to handle specific tasks such as health checks, item creation, stock management, and order processing.
- Database Integration: Integrate a database service to store inventory data and ensure proper CRUD operations.
- Containerization: Containerize the application using Docker to provide consistency and portability across different environments.
- Testing and Documentation: Conduct thorough testing to ensure the system functions as expected and provide comprehensive documentation for setup, usage, and maintenance.
The technologies used in this project include:
- RabbitMQ: A message broker that enables communication between microservices.
- Docker: A containerization platform used for packaging and deploying the application.
- Flask: A web framework for building HTTP servers and implementing RESTful APIs.
- MySQL: A database to store our data.
- Create Dockerfiles for each microservice.
- Write a docker-compose.yml file to define the services and network configurations.
- Test Docker setup locally to ensure containers can communicate with each other.
- Set up RabbitMQ container and network.
- Implement basic RabbitMQ communication between producer and consumer services.
- Test message passing between microservices via RabbitMQ queues.
- Choose a suitable web framework (e.g., Flask for Python) for implementing HTTP servers.
- Implement HTTP endpoints for health checks, and CRUD operations related to inventory management.
- Test HTTP servers locally to ensure they are functional.
- Develop the producer service responsible for constructing queues/exchanges and transferring data to consumers.
- Implement the HTTP server to listen to health_check and CRUD requests.
- Test the producer service to ensure it interacts correctly with RabbitMQ and handles HTTP requests.
- Implement consumer services (consumer_one to consumer_four) to handle specific tasks like health checks, item creation, stock management, and order processing.
- Ensure each consumer service can communicate with RabbitMQ and perform its designated actions.
- Test each consumer service individually to verify its functionality.
- Integrate all microservices into the Docker environment.
- Perform end-to-end testing to ensure seamless communication between microservices via RabbitMQ queues.
- Test various scenarios to ensure the proper functioning of the inventory management system.
├── <microservices-project-directory>
├── docker-compose.yml
├── producer
│ ├── producer.py
│ ├── Dockerfile
│ └──requirements.txt
├── consumer_one
│ ├── healthcheck.py
│ ├── Dockerfile
│ └──requirements.txt
├── consumer_two
│ ├── item_creation.py
│ ├── Dockerfile
│ └──requirements.txt
├── consumer_three
│ ├── stock_management.py
│ ├── Dockerfile
│ └──requirements.txt
├── consumer_four
│ ├── orderproccessing.py
│ ├── Dockerfile
│ └──requirements.txt
└── database_service