High-Performance E-Commerce Backend built using Express.js, PostgreSQL, Redis, JWT Authentication, Inventory Management, Cart Reservation System, Checkout, Orders, and Cashfree Payments.
Fast Commerce is a production-grade backend architecture designed for modern e-commerce applications.
The system focuses on:
- Scalability
- Inventory Accuracy
- Secure Authentication
- High Performance Caching
- Payment Integration
- Auditability
- Modular Architecture
The project demonstrates how enterprise commerce systems handle:
Authentication
Products
Inventory
Cart Reservation
Checkout
Orders
Payments
Caching
Analytics
Admin Operations| Layer | Technology |
|---|---|
| Runtime | Node.js |
| Framework | Express.js |
| Database | PostgreSQL |
| Cache Layer | Redis |
| Authentication | JWT |
| Authorization | RBAC |
| Validation | Zod |
| API Documentation | Swagger |
| Image Storage | Cloudinary |
| Email Service | Resend |
| Security | Helmet |
| Rate Limiting | Express Rate Limit |
| Payments | Cashfree |
| Password Hashing | bcrypt |
- User Registration
- Login
- Logout
- Refresh Tokens
- OTP Verification
- Password Reset
- JWT Authentication
- Redis Session Layer
- Get Users
- User Statistics
- User Role Updates
- Soft Delete Users
- Create Products
- Update Products
- Delete Products
- Product Search
- Product Listing
- Cloudinary Upload
- Product Images
- Product Videos
- Primary Image Management
Tracks:
Total Stock
Available Stock
Reserved Stock
Sold StockInventory Formula:
available_stock =
total_stock
- reserved_stock
- sold_stockTracks every stock operation:
STOCK_IN
STOCK_OUT
RESERVED
RELEASED
SOLD
RETURNED
DAMAGED
ADJUSTMENTFeatures:
- Add Item
- Update Quantity
- Remove Item
- Clear Cart
- Cart Summary
Integrated with Inventory Reservation.
Features:
- Cart Validation
- Inventory Validation
- Price Validation
- Checkout Summary
- Order Preparation
Features:
- Order Creation
- Order Items
- Order Status Tracking
- Order History
- Order Management
Integrated with:
Supports:
- Payment Initiation
- Payment Verification
- Webhooks
- Failed Payments
- Successful Payments
- Payment History
User Login
│
▼
Generate JWT Access Token
│
▼
Generate Refresh Token
│
▼
Store Refresh Token in Redis
│
▼
Protected API Access
Add Product To Cart
│
▼
Reserve Inventory
│
▼
Create Checkout
│
▼
Validate Inventory
│
▼
Create Order
│
▼
Initiate Cashfree Payment
│
▼
Payment Success
│
▼
Convert Reserved → Sold
│
▼
Order Completed
Admin Adds Stock
│
▼
STOCK_IN
│
▼
Customer Adds To Cart
│
▼
RESERVED
│
▼
Checkout Success
│
▼
SOLD
│
▼
Order Delivered
| Table |
|---|
| users |
| products |
| product_media |
| inventory |
| inventory_movements |
| carts |
| cart_items |
| checkouts |
| checkout_items |
| orders |
| order_items |
| payments |
Used For:
Refresh Tokens
OTP Storage
Rate Limiting
Product Cache
Inventory Cache
Cart Cache
Analytics Cache
Session ManagementSwagger Documentation:
http://localhost:8000/api-docs/RedisImplementation/Clone Repository
git clone https://github.com/KarthickRamAlagar/FastCommerce---Backend-SystemInstall Dependencies
npm installEnvironment Setup
PORT=8000
DATABASE_URL=
JWT_SECRET=
JWT_REFRESH_SECRET=
REDIS_URL=
CLOUDINARY_CLOUD_NAME=
CLOUDINARY_API_KEY=
CLOUDINARY_API_SECRET=
RESEND_API_KEY=
CASHFREE_APP_ID=
CASHFREE_SECRET_KEY=Run Development Server
npm run dev✅ Authentication
✅ RBAC
✅ Redis Integration
✅ Product Catalog
✅ Product Media
✅ Inventory Management
✅ Inventory Movements
✅ Cart System
✅ Checkout
✅ Orders
✅ Payments (Cashfree)
✅ Swagger Documentation
✅ Rate Limiting
✅ Cloudinary IntegrationWishlist Module
Coupon System
Address Management
Returns & Refunds
Notification Service
Admin Dashboard
Microservices Migration
Docker Deployment
CI/CD Pipeline
Queue Processing (BullMQ)Karthick Ramalagar
Backend Developer
Built for learning scalable e-commerce backend architecture using:
Express.js
PostgreSQL
Redis
JWT
Cashfree
Swagger
Cloudinary
