A microservices e-commerce project built with NestJS, RabbitMQ, PostgreSQL, and Next.js, deployed on AWS using Terraform and Kubernetes.
- Microservices Architecture: API Gateway routing requests to
auth-service,prod-service,cart-service, andorder-service. - Event-Driven Messaging: Inter-service RPC communication via RabbitMQ message broker.
- Authentication: JWT Access/Refresh tokens with bcrypt password hashing.
- Payments: Razorpay order creation and HMAC SHA256 signature verification.
- Infrastructure as Code: Terraform scripts to provision VPC subnets, EC2 nodes, RDS PostgreSQL, and S3.
- Kubernetes Deployment: Declarative Kustomize manifests running on a 3-node
kubeadmcluster with Flannel CNI.
- Node.js 20+
- Docker and Docker Compose
- PostgreSQL 15+ & RabbitMQ 3.x (if running without Docker)
- Terraform 1.5+ (optional, for AWS infrastructure)
# 1. Clone repository
git clone https://github.com/Kusagra9308/Shoptiq.git
cd Shoptiq
# 2. Start PostgreSQL and RabbitMQ containers
docker-compose up -d
# 3. Install dependencies & push database schema
cd backend
npm install
npx prisma@5.22.0 db push --schema=./libs/database/prisma/schema.prisma
# 4. Start backend services
npm run start:allCreate a .env file inside backend/:
DATABASE_URL="postgresql://postgres:shoptiq_password_123@localhost:5432/shoptiq"
RABBITMQ_URL="amqp://localhost:5672"
JWT_SECRET="your_jwt_access_secret"
RAZORPAY_ID_KEY="your_razorpay_id"
RAZORPAY_SECRET_KEY="your_razorpay_secret"flowchart TD
Client([Client / Frontend]) -->|HTTP / REST| Gateway[API Gateway: Port 3000]
Gateway -->|JWT Auth Guards| AuthCheck{Authorized?}
AuthCheck -->|Yes| RabbitMQ[(RabbitMQ Event Broker)]
RabbitMQ -->|RPC| AuthService[Auth Service]
RabbitMQ -->|RPC| ProdService[Product Service]
RabbitMQ -->|RPC| CartService[Cart Service]
RabbitMQ -->|RPC| OrderService[Order Service]
AuthService --> DB[(AWS RDS PostgreSQL)]
ProdService --> DB
CartService --> DB
OrderService --> DB
OrderService --> Razorpay[Razorpay API]
# Register User
curl -X POST http://localhost:3000/auth/register \
-H "Content-Type: application/json" \
-d '{"email":"user@example.com","password":"Password123!","mobileno":"9999999999","name":"John Doe"}'
# Browse Catalog
curl http://localhost:3000/products?page=1&limit=10
# Add to Cart
curl -X POST http://localhost:3000/cart \
-H "Content-Type: application/json" \
-H "Authorization: Bearer <ACCESS_TOKEN>" \
-d '{"productId":"prod-1","quantity":1}'// Sample Response: POST /cart
{
"id": "cart-item-123",
"userId": "user-456",
"productId": "prod-1",
"quantity": 1,
"createdAt": "2026-08-02T10:00:00.000Z"
}Load tested on AWS (1 Master + 2 Worker EC2 t3.medium instances with RDS db.t3.micro) using Grafana k6:
- Peak Load: Tested up to 500 concurrent Virtual Users (VUs).
- Success Rate: 100% request success rate across 18,500+ iterations on read/cart paths.
- Median Latency: 779 ms median HTTP response time under load.
- Add Redis caching layer for catalog queries.
- Add Stripe and PayPal payment integrations alongside Razorpay.
- Add Prometheus and Grafana container monitoring dashboards.
- Fork the repository
- Create your feature branch (
git checkout -b feature/my-feature) - Commit your changes (
git commit -m "add my feature") - Push to the branch (
git push origin feature/my-feature) - Open a Pull Request
Distributed under the MIT License.