This repository contains the backend model of an Amazon E-Commerce clone built using Nest.js microservices, powered by PostgreSQL, Redis for caching, and delivered via Docker.
It was originally planned as a full-stack project, but is now focused purely on the backend system design to ensure scalability and reliability.
- Auth Service – Handles user authentication, authorization, and token management (JWT).
- Product Service – Manages product catalog, details, and availability.
- Cart Service – Uses the product-service to fetch products and manage carts.
🗄️ Saves cart data in cache memory using Redis for high performance. - API Gateway – Routes client requests to respective microservices via Nginx.
- Nest.js
11.0.1 - Node.js
20.x
- Class Validator & Class Transformer
- TypeORM (with PostgreSQL support)
- Bcrypt.js (Password Hashing)
- Dotenv (Environment Configurations)
- JSON Web Tokens (JWT Authentication)
- PostgreSQL
17.4 - Redis (for session & cart caching)
- Firestore (NoSQL, optional for analytics / secondary storage)
- Docker
28.0.4 - Nginx (Reverse Proxy & Load Balancer)
- GitHub Actions (CI/CD)
- DBeaver (DB management)
1. Install Node.js
Verify installation:
node -v
npm -v
## Configuration for Local Machine
### 1. Download and Install [Node.js](https://nodejs.org/en/download)
- Go to the official Node.js website by clicking the link above.
- Download the LTS (Long-Term Support) version for stability.
- Follow the installation instructions based on your operating system:
`Windows/macOS`: Run the installer and follow the setup wizard.
`Linux`: Use your package manager (`apt`, `dnf`, or `yum`) or download the binaries directly.
### 📦 Debian/Ubuntu (APT)
```bash
sudo apt update
sudo apt install nodejs npm -y- To get the latest version, it's better to use NodeSource:
curl -fsSL https://deb.nodesource.com/setup_lts.x | sudo -E bash -
sudo apt install -y nodejssudo dnf install nodejs -y- To get the latest version, it's better to use NodeSource:
curl -fsSL https://deb.nodesource.com/setup_lts.x | sudo -E bash -
sudo dnf install -y nodejssudo yum install nodejs -y- To get the latest version, it's better to use NodeSource:
curl -fsSL https://deb.nodesource.com/setup_lts.x | sudo -E bash -
sudo yum install -y nodejsmacOS: Recommended: Using Homebrew
brew install nodeVerify installation by running the following commands in your terminal:
node -v
npm -v2. Download and Install Docker
(Docker part is not yet implemented in this project, but you can set it up for containerization and deployment.)
Verify installation by running the following commands in your terminal:
docker --vor
docker --versionChange the secret as per your database keys:
POSTGRES_USER=
POSTGRES_PASSWORD=
POSTGRES_DB=amazon_clone
DATABASE_URL=
JWT_SECRET=✅ Now, we are good to build an image of our application and run the instance of our application.
Run the following command:
docker-compose up -d --buildEdit typeorm.config.ts and set
synchronize: true- Node.js - https://nodejs.org/en/download
- Next.js - https://nextjs.org/docs/app/getting-started/installation
- React.js - https://react.dev/learn
- Tailwind CSS - https://tailwindcss.com/
- Lightning CSS - https://lightningcss.dev/docs.html
- Nest.js - https://docs.nestjs.com/
- PostgreSQL - https://www.postgresql.org/docs/
- Firestore - https://firebase.google.com/docs/firestore/quickstart
- Docker - https://docs.docker.com/
- nginx - http://nginx.org/en/docs/beginners_guide.html
- ShadCN/UI - https://ui.shadcn.com/docs/installation/next
- Vercel - https://vercel.com/