A full-stack Amazon-inspired e-commerce platform built using:
- React (Vite)
- Node.js
- Express
- PostgreSQL (pgAdmin 4)
- JWT Authentication
- Automated Testing
This project demonstrates a complete e-commerce workflow with relational database design, authentication, cart management, order lifecycle handling, and backend/frontend testing.
- User Registration
- User Login
- JWT-based Authentication
- Protected Routes
- Role-based Access (User/Admin)
- Product Listing
- Add to Cart
- Cart Management (Context API)
- Checkout Flow
- Order Placement
- Order History (My Orders)
- Admin Order Monitoring
- Relational Schema Design
- Foreign Key Relationships
- Normalized Tables
- Referential Integrity
- Managed using pgAdmin 4
Tables:
- users
- products
- orders
- order_items
Located in:
backend/tests/
- Controller unit tests
- API testing
- Authentication testing
Run backend tests:
npm testLocated in:
frontend/tests/
- Shopping flow testing
- UI validation
- End-to-end test scenarios
Run frontend tests:
npx playwright testAMAZON_CLONE/
β
βββ backend/
β βββ config/
β β βββ db.js
β βββ controllers/
β βββ middleware/
β βββ routes/
β βββ tests/
β βββ server.js
β
βββ frontend/
β βββ src/
β β βββ components/
β β βββ context/
β β βββ pages/
β β βββ services/
β β βββ App.jsx
β βββ tests/
β βββ vite.config.js
β
βββ README.md
User β Register/Login β Browse Products β Add to Cart β Checkout β Place Order β View Order History
- React (Vite)
- Context API
- Axios
- Playwright (Testing)
- Node.js
- Express
- PostgreSQL
- pg (Node PostgreSQL driver)
- JWT
- REST APIs
- PostgreSQL 17
- Managed via pgAdmin 4
- id (PK)
- name
- password
- role
- created_at
- id (PK)
- name
- price
- image
- created_at
- id (PK)
- user_id (FK β users.id)
- total
- status
- created_at
- id (PK)
- order_id (FK β orders.id)
- product_id (FK β products.id)
- quantity
git clone https://github.com/adarshmane146/amazon-clone.git
cd amazon-clonecd backend
npm installCreate .env file:
PORT=5000
DB_USER=postgres
DB_PASSWORD=your_password
DB_HOST=localhost
DB_PORT=5432
DB_NAME=amazon_db
JWT_SECRET=your_secret_key
Run backend:
npm run devBackend runs at:
http://localhost:5000
cd frontend
npm install
npm run devFrontend runs at:
http://localhost:5173
POST /api/auth/register
POST /api/auth/login
GET /api/products
POST /api/orders
GET /api/orders/myorders
- Full-stack architecture
- Relational database design (PostgreSQL)
- Foreign key relationships
- Secure authentication (JWT)
- REST API development
- State management using Context API
- Automated backend testing
- End-to-end frontend testing
- Clean modular folder structure
Adarsh Mane B.Tech Computer Science Engineering Full Stack Developer