This project consists of three microservices (user-service
, product-service
, and order-service
) that manage user registration, product inventory, and order placement. The services communicate asynchronously using RabbitMQ for event-driven architecture and use PostgreSQL for data persistence.
- Microservices: Independent services for users, products, and orders.
- Asynchronous Communication: RabbitMQ for event-driven message passing.
- Data Persistence: PostgreSQL with migrations handled via Golang's
sqlx
. - Caching: Redis is used for caching to improve read performance.
- Authentication: JWT-based authentication in the
user-service
.
- Golang (Fiber Framework)
- PostgreSQL
- RabbitMQ
- Redis
- Docker (for containerization)
- gqlgen (for the GraphQL API gateway)
- User Service Documentation
- Product Service Documentation
- Order Service Documentation
- API Endpoints Documentation
- Event Communication Documentation
Follow these steps to run the project locally:
-
Clone the repository:
git clone https://github.com/ajaysinghpanwar2002/pratilipi.git
-
Navigate into the repository:
cd pratilipi
-
Build the services:
make build
-
Start the services using Docker:
make start
-
Accessing the services:
- GraphQL Gateway:
http://localhost:8080
- User Service:
http://localhost:8081
- Product Service:
http://localhost:8082
- Order Service:
http://localhost:8083
- GraphQL Gateway:
I am providing a Postman collection to test the API endpoints. You can download it using the link: Postman Collection