Skip to content

Robust, scalable microservice backend for e-commerce with auth, catalog, cart mock payments and notifications

License

Notifications You must be signed in to change notification settings

kisugez/ecommerce-backend

Repository files navigation

Scalable E-commerce Platform

A scalable microservices-based e-commerce platform built with Node.js, Express, and Docker.

Javascript Node.js Express Docker Microservices License

Overview

This project implements a complete e-commerce system using a microservices architecture. Each service is independently deployable, scalable, and maintainable.

Architecture

The platform consists of the following services:

  • API Gateway (Port 3000): Routes requests to appropriate microservices
  • User Service (Port 3001): Authentication, JWT tokens, and user profile management
  • Product Service (Port 3002): Product catalog, categories, and inventory management
  • Cart Service (Port 3003): Shopping cart operations per user
  • Order Service (Port 3004): Order creation and tracking
  • Payment Service (Port 3005): Mock payment processing (Stripe/PayPal simulation)
  • Notification Service (Port 3006): Mock email/SMS notifications

Technology Stack

  • Runtime: Node.js 18
  • Framework: Express.js
  • Language: JavaScript (ES6+)
  • Authentication: JWT (JSON Web Tokens)
  • Containerization: Docker & Docker Compose
  • Communication: REST APIs
  • Logging: Morgan

Quick Start

With Docker (Recommended)

# Start all services
docker compose up --build

# Access the API Gateway
curl http://localhost:3000/health

Without Docker

Start each service in separate terminals:

# Install dependencies for each service
cd user-service && npm install && npm start       # Port 3001
cd product-service && npm install && npm start    # Port 3002
cd cart-service && npm install && npm start       # Port 3003
cd order-service && npm install && npm start      # Port 3004
cd payment-service && npm install && npm start    # Port 3005
cd notification-service && npm install && npm start # Port 3006
cd api-gateway && npm install && npm start        # Port 3000

Documentation

For detailed documentation, please refer to the docs branch:

  • Local setup instructions
  • Complete API reference
  • Architecture details
  • Testing guide

Project Structure

.
├── api-gateway/           # API Gateway service
├── user-service/          # User authentication service
├── product-service/       # Product management service
├── cart-service/          # Shopping cart service
├── order-service/         # Order management service
├── payment-service/       # Payment processing service
├── notification-service/  # Notification service
├── docker-compose.yml     # Docker orchestration
└── README.md             # This file

Service Health Checks

All services expose a /health endpoint:

curl http://localhost:3000/health  # API Gateway
curl http://localhost:3001/health  # User Service
curl http://localhost:3002/health  # Product Service
curl http://localhost:3003/health  # Cart Service
curl http://localhost:3004/health  # Order Service
curl http://localhost:3005/health  # Payment Service
curl http://localhost:3006/health  # Notification Service

Features

  • User registration and authentication with JWT
  • Product browsing and searching
  • Shopping cart management
  • Order creation and tracking
  • Mock payment processing
  • Automated notifications
  • Microservices architecture
  • Docker containerization
  • RESTful API design
  • Health check endpoints

Development

Each service is developed in its own feature branch:

  • feature/user-service
  • feature/product-service
  • feature/cart-service
  • feature/order-service
  • feature/payment-service
  • feature/notification-service

Documentation is maintained in the docs branch.

About

Robust, scalable microservice backend for e-commerce with auth, catalog, cart mock payments and notifications

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published