Shop Sphere is a fully-featured microservices-based e-commerce platform designed for scalability, modularity, and high performance. Built with modern technologies and best practices, the platform consists of decoupled services that interact via RabbitMQ and gRPC, enabling seamless asynchronous and high-speed communication.
Shop Sphere is composed of the following services:
Responsible for managing customer-related operations:
- 🔐 Authentication
- 🛒 Cart & Wishlist
- 🧾 Order History
- 🔔 Unread notifications (with a TTL of 1 day)
gRPC Client to Product Service:
- Fetching personalized product recommendations based on:
- Wishlist
- Previous orders
Handles everything related to products and sellers:
- 🛠️ Seller authentication
- 📋 CRUD operations for products
- 🔍 Advanced search via MongoDB Aggregation Pipeline
- 🖼️ Image uploads to AWS S3
gRPC Server:
- Accepts wishlist/orders from Customer Service
- Returns personalized recommendations
Manages core shopping actions:
- 🛍️ Add/Remove products from cart
- 🔄 Order placement & cancellation
- 💖 Wishlist management
- 🚚 Simulated deliveries using BullMQ
- 📡 Real-time delivery tracking via WebSocket (Socket.io)
Acts as the entry point for all client requests:
- 🔁 Reverse proxy to route requests to the appropriate services
- 🛡️ Implements rate limiting for protection against DDoS attacks
- Node.js, Express.js
- MongoDB, Redis
- RabbitMQ, BullMQ
- gRPC, Socket.io
- AWS SDK (S3)
- React, Tailwind CSS
- Redux
- Socket.io Client
- 🧼 DRY Principles
- ✂️ Code splitting
- 🖼️ Lazy loading images
- ⚡ Memoization
- 🔍 Debounced search
- 📄 Pagination
🔐 Below are the required
.envconfigurations for each service. Be sure to create a.envfile in the root of each microservice directory.
👤 Customer Service
MONGO_DB_URI=
ACCESS_TOKEN_SECRET=
REFRESH_TOKEN_SECRET=
ACCESS_TOKEN_EXPIRY=
REFRESH_TOKEN_EXPIRY=
PORT=
RABBITMQ_URL=
FRONTEND_URL=
RECOMMENDATION_GRPC_ENDPOINT=📦 Product Service
MONGO_DB_URI=
ACCESS_TOKEN_SECRET=
SELLER_ACCESS_TOKEN_SECRET=
SELLER_ACCESS_TOKEN_EXPIRY=
SELLER_REFRESH_TOKEN_SECRET=
SELLER_REFRESH_TOKEN_EXPIRY=
PORT=
RABBITMQ_URL=
AWS_S3_BUCKET_NAME=
AWS_S3_CLIENT_ACCESS_KEY=
AWS_S3_CLIENT_SECRET_KEY=
AWS_REGION=🛒 Shopping Service
MONGO_DB_URI=
PORT=
ACCESS_TOKEN_SECRET=
REDIS_HOST=
REDIS_PORT=
REDIS_PASSWORD=
RABBITMQ_URL=
SOCKET_PORT=
FRONTEND_URL=🌐 API Gateway
REDIS_URL=
CUSTOMER_SERVICE_URL=
PRODUCT_SERVICE_URL=
SHOPPING_SERVICE_URL=
PORT=
FRONTEND_URL=Make sure the following tools/services are installed:
- ✅ Redis
- ✅ RabbitMQ
- ✅ AWS S3 (with proper credentials)
cd Customer && npm install
cd Product && npm install
cd Shopping && npm install
cd gateway && npm install- Create
.envfiles for each service (Customer, Product, Shopping, gateway) as described above.
- Use WSL, Ubuntu, or Docker depending on your environment to launch Redis and RabbitMQ.
npm run start
# Run this inside each service directorycd frontend
npm install
npm run devMake sure your package.json in src/Product has the following:
"scripts": {
"start:grpc": "node src/grpcServer.js"
}Then run:
cd src/Product
npm run start:grpcCheck the script in src/Shopping/package.json:
"scripts": {
"start:bullmq": "nodemon src/Queue/worker.js"
}Then run:
cd src/Shopping
npm run start:bullmq✅ Modular Microservice Architecture
📡 gRPC for fast, type-safe inter-service communication
📨 RabbitMQ for decoupled message brokering
📷 AWS S3 for secure image storage
⚡ Real-Time Updates using Socket.io
🛡️ API Gateway for routing, rate limiting, and centralized security
⏱️ BullMQ for background jobs like order delivery simulation
- 📊 Admin dashboard with analytics
- 🧠 Smarter product recommendations with ML
- 💳 Integrate payment gateways (Stripe, Razorpay)
- 🐳 Full CI/CD pipeline with Docker & Kubernetes
Contributions are welcome! 💡
- Fork this repository
- Create a feature branch
- Open a PR with your changes
- For major updates, open an issue first to discuss
Let’s build something amazing together! ✨
Happy Coding! 🚀