Modular e-commerce backend with a GraphQL gateway and gRPC microservices for accounts, products, orders, payments, and recommendations.
Modular e-commerce backend with a GraphQL gateway and gRPC microservices for accounts, products, orders, payments, and recommendations.
This repository hosts a sample e-commerce platform demonstrating a microservices architecture using multiple Go services alongside a Python-based Recommender service. The project showcases:
The system comprises several microservices:
The entire ecosystem is containerized using Docker Compose. Datastores include PostgreSQL, Elasticsearch, and Kafka.
Below is a high-level overview of the system architecture:
API Gateway (GraphQL) talks to:
Account client → Account server → PostgresProduct client → Product server → ElasticSearch + KafkaOrder client → Order server → Postgres + Kafka
(also communicates with Product service via gRPC)Payment client → Payment service → payment provider + Postgres + KafkaRecommender client → Recommender server (Python) → Postgres (Replica) + KafkaEvent Flow:
Order and Product services act as Kafka producers.Payment service is a Kafka consumer, ingesting product events and saving them in payment provider (DodoPayments).Recommender service is also a Kafka consumer, ingesting order/product events and updating internal state for recommendations./graphql.Before running the project, ensure you have the following installed:
git clone https://github.com/rasadov/EcommerceAPI.git
cd ecommercemicroservicesTo build and start all services using Docker Compose, run:
# Step 1: Build the base image
docker compose build base
# Step 2: Build and start all services
docker compose up -d --build```
…
graphql
mutation {
register(account: {
name: "Alice"
email: "[email protected]"
password: "secret123"
}) {
token
}
}mutation {
login(account: {
email: "[email protected]"
password: "secret123"
}) {
token
}
}mutation {
createProduct(product: {
name: "Camera"
description: "A digital camera"
price: 99.99
}) {
id
name
}
}query {
product(pagination: { skip: 0, take: 10 }) {
id
name
price
}
}mutation {
createOrder(order: {
products: [
{ id: "PRODUCT_ID", quantity: 2 }
]
}) {
id
totalPrice
products {
name
quantity
}
}
}We welcome contributions! To contribute:
Fork the repository
Create a new branch
Commit and push your changes
Open a Pull Request
Rauf Asadov
GitHub: @rasadov
LinkedIn: Rauf Asadov
Email: [email protected]
This project is licensed under the Apache License 2.0.
No open issues yet, or sync has not completed.