A scalable, real-time Order Management System built with Next.js, Fastify (Node.js), and MongoDB. It supports full CRUD operations for orders, products, and customers, enforces a strict order-status pipeline, and provides real-time updates via WebSockets.
- β CRUD for Orders, Products, Customers
- π Status pipeline:
PENDING β PAID β FULFILLED β CANCELLED - π Real-time updates using Socket.IO
- π Role-based Access (Admin / Customer)
- π€ Export orders to CSV
- π Search & Filter Dashboard
- βοΈ Fastify-based API Server
- π― MongoDB with ER modeling
Use these credentials to log in as different roles:
- Email:
unnatigandhi1999@gmail.com - Password:
123456
- Email:
admin@gmail.com - Password:
123456
βββ apps/ β βββ client/ # Next.js frontend β βββ packages/ β βββ api/ # Fastify API server β βββ db/ # Database layer (Prisma/ORM config) β βββ config/ # Shared config/env utils β βββ docs/ β βββ high-level-design.md # π System architecture & diagrams β βββ .env.example # Sample environment variables βββ README.md # You are here
Copy .env.example to .env and fill in the appropriate values:
DATABASE_URL=MongoDB://user:password@host:5432/db
JWT_SECRET=your_jwt_secret
NEXTAUTH_SECRET=your_nextauth_secret
π§ͺ Common Commands
| Command | Location | Description |
| -------------- | --------------- | ---------------------------------- |
| `pnpm install` | root | Install all dependencies |
| `pnpm dev` | client/ or api/ | Run frontend or backend dev server |
| `pnpm lint` | root | Run ESLint |
| `pnpm format` | root | Format code with Prettier |
| `pnpm build` | client/api | Build frontend or backend |
π‘ Deployment Steps
Local Setup
git clone https://github.com/your-username/oms-project
cd oms-project
pnpm install
cp .env.example .env
pnpm dev
Production Deployment
| Service | Platform | Notes |
| ----------- | -------- | ------------------------ |
| Frontend | Vercel | Auto deploys from `main` |
| API Backend | Render | Fastify server |
| Database | Supabase | Hosted MongoDB |
| Realtime | Same API | WebSocket with Socket.IO |
π High-Level Design Document
π Click here to view the full system design
Includes:
β
Architecture & request flows
β
Component breakdown
β
API contracts & sequence diagrams
β
Deployment topology
β
Security & observability
π₯ Roles
| Role | Capabilities |
| -------- | --------------------------------------- |
| Admin | Full CRUD, CSV export, filter dashboard |
| Customer | View orders only |
π¦ Tech Stack
Frontend: React.js + TailwindCSS + Zustand/Context
Backend: Fastify + Node.js + Socket.IO
Database: MongoDB via Prisma or native driver
Deployment: Vercel (Frontend) + Render (Backend)
Auth: NextAuth + JWT
Logging/Monitoring: Pino, Sentry
π©Ί Health Check
API server exposes /healthz endpoint for uptime monitoring.
π License
MIT Β© 2025 Your Name
---
### β
Tips
- Use VS Code preview or markdown viewer to check formatting.
- Include badges if your repo is public (e.g., CI status, license, etc.)
- Ensure the relative link to `docs/high-level-design.md` works from the root.
Let me know if you want this in a GitHub-compatible Markdown file or if you'd like me to auto-generate the file for download.