Skip to content

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.

Notifications You must be signed in to change notification settings

unnati1004/order-management-system

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

68 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

πŸ›’ Order Management System (OMS)

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.


πŸš€ Features

  • βœ… 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

πŸ” Credentials

Use these credentials to log in as different roles:

πŸ‘€ Customer

  • Email: unnatigandhi1999@gmail.com
  • Password: 123456

πŸ‘©β€πŸ’Ό Admin

  • Email: admin@gmail.com
  • Password: 123456

πŸ“ Project Structure

β”œβ”€β”€ 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


βš™οΈ Environment Variables

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.

About

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.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages