A modern, real-time order delivery management system with separate interfaces for users, delivery partners, and administrators. Built with React, Node.js, Express, MongoDB, and Socket.io for real-time updates.
- Video Demo: https://drive.google.com/file/d/18zfuHwIwcuB-ZzGfxsfi_9udq20A81oJ/view?usp=sharing
- Frontend: https://delivery-system-1-i9dc.onrender.com
- Backend: https://delivery-system-backend-4w4v.onrender.com
The Real-Time Order Delivery System is a full-stack web application that facilitates seamless order management and delivery tracking. The system supports three types of users:
- Users: Browse products, place orders, track deliveries in real-time, and manage their cart
- Delivery Partners: Accept orders, update delivery status, and manage assigned deliveries
- Admins: Monitor all orders, manage users and partners, and oversee the entire system
- π JWT-based authentication with role-based access control
- π Real-time order status updates using Socket.io
- π Shopping cart management with Zustand state management
- π¦ Order tracking and management
- π₯ User and partner management for admins
- π³ Fully containerized with Docker
- π Nginx reverse proxy for efficient routing
- π± Responsive UI built with React and Tailwind CSS
ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
β Client Layer β
β ββββββββββββββββ ββββββββββββββββ ββββββββββββββββ β
β β User β β Partner β β Admin β β
β β Interface β β Interface β β Dashboard β β
β ββββββββ¬ββββββββ ββββββββ¬ββββββββ ββββββββ¬ββββββββ β
β β β β β
β ββββββββββββββββββββ΄βββββββββββββββββββ β
β β β
β ββββββββββΌβββββββββ β
β β React Frontend β β
β β (Vite + TS) β β
β ββββββββββ¬βββββββββ β
ββββββββββββββββββββββββββββββΌββββββββββββββββββββββββββββββββββββ
β
ββββββββββΌβββββββββ
β Nginx Reverse β
β Proxy β
ββββββββββ¬βββββββββ
β
ββββββββββββββββββββΌβββββββββββββββββββ
β β β
βββββββΌββββββ ββββββββΌβββββββ ββββββββΌβββββββ
β HTTP β β WebSocket β β Static β
β API β β Socket.io β β Assets β
βββββββ¬ββββββ ββββββββ¬βββββββ βββββββββββββββ
β β
ββββββββββββββββββββ
β
βββββββββββΌββββββββββ
β Express Server β
β (Node.js) β
β β
β βββββββββββββββ β
β β Routes β β
β βββββββββββββββ€ β
β β Controllers β β
β βββββββββββββββ€ β
β β Middleware β β
β βββββββββββββββ€ β
β β Validations β β
β βββββββββββββββ β
βββββββββββ¬ββββββββββ
β
βββββββββββΌββββββββββ
β MongoDB β
β (Database) β
β β
β Collections: β
β β’ Users β
β β’ Partners β
β β’ Admins β
β β’ Orders β
β β’ Deliveries β
β β’ BlacklistTokensβ
βββββββββββββββββββββ
- Framework: React 19 with TypeScript
- Build Tool: Vite
- Routing: React Router DOM v7
- State Management: Zustand
- Styling: Tailwind CSS v4
- UI Components: Radix UI primitives
- Animations: Motion (Framer Motion)
- Real-time: Socket.io Client
- Icons: Lucide React, Radix Icons
- Validation: Zod
- HTTP Client: Fetch API
- Runtime: Node.js
- Framework: Express v5
- Database: MongoDB with Mongoose ODM
- Authentication: JWT (jsonwebtoken)
- Password Hashing: bcrypt
- Validation: Zod + express-validator
- Real-time: Socket.io v4
- CORS: cors middleware
- Environment: dotenv
- Containerization: Docker & Docker Compose
- Web Server: Nginx (reverse proxy)
- Development: Nodemon (backend), Vite HMR (frontend)
- API Testing: Postman (collection included)
- Linting: ESLint
Real-Time-Order-Delivery-System/
β
βββ client/ # Frontend React Application
β βββ public/ # Static assets
β βββ src/
β β βββ assets/ # Images, fonts, etc.
β β βββ components/ # React components
β β β βββ ui/ # Reusable UI components (buttons, cards, etc.)
β β β βββ _admin/ # Admin-specific components
β β β βββ _partner/ # Partner-specific components
β β β βββ _user/ # User-specific components
β β β βββ Footer.tsx
β β β βββ Header.tsx
β β β βββ OffersCard.tsx
β β β βββ Products.tsx
β β β βββ ProtectedRoute.tsx
β β βββ context/ # State management (Zustand stores)
β β β βββ useCartStore.ts # Shopping cart state
β β β βββ useUserStore.ts # User authentication state
β β βββ lib/ # Utility functions
β β β βββ socket.ts # Socket.io client configuration
β β β βββ utils.ts # Helper functions
β β βββ pages/ # Page components
β β β βββ admin/ # Admin pages
β β β β βββ AdminHome.tsx
β β β β βββ AdminProfile.tsx
β β β β βββ OrdersList.tsx
β β β β βββ PartnersList.tsx
β β β β βββ UsersList.tsx
β β β βββ partner/ # Partner pages
β β β β βββ PartnerHome.tsx
β β β β βββ PartnerOrders.tsx
β β β βββ user/ # User pages
β β β β βββ UserCart.tsx
β β β β βββ UserHome.tsx
β β β β βββ UserOrders.tsx
β β β βββ Home.tsx
β β β βββ LandingPage.tsx
β β β βββ Login.tsx
β β β βββ Register.tsx
β β βββ App.tsx # Main App component
β β βββ main.tsx # Application entry point
β β βββ index.css # Global styles
β βββ components.json # shadcn/ui configuration
β βββ Dockerfile # Frontend Docker configuration
β βββ nginx.conf # Nginx config for frontend
β βββ package.json # Frontend dependencies
β βββ tsconfig.json # TypeScript configuration
β βββ vite.config.ts # Vite configuration
β βββ README.md # Client documentation
β
βββ server/ # Backend Node.js Application
β βββ controllers/ # Request handlers
β β βββ admin.controller.js # Admin operations
β β βββ delivery.controller.js # Delivery management
β β βββ map.controller.js # Map/location services
β β βββ partner.controller.js # Partner operations
β β βββ user.controller.js # User operations
β βββ db/
β β βββ db.js # Database connection
β βββ middlewares/
β β βββ auth.middleware.js # JWT authentication
β βββ models/ # Mongoose schemas
β β βββ admin.model.js
β β βββ BlacklistToken.model.js # Token revocation
β β βββ delivery.model.js
β β βββ order.model.js
β β βββ partner.model.js
β β βββ user.model.js
β βββ routes/ # API route definitions
β β βββ admin.routes.js
β β βββ partner.routes.js
β β βββ user.routes.js
β βββ validations/ # Input validation schemas
β β βββ admin.validation.js
β β βββ order.validation.js
β β βββ partner.validation.js
β β βββ user.validation.js
β βββ app.js # Express app configuration
β βββ server.js # Server entry point
β βββ socket.js # Socket.io configuration
β βββ seed-admin.js # Admin seeding script
β βββ Dockerfile # Backend Docker configuration
β βββ docker-compose.yml # Local development compose
β βββ package.json # Backend dependencies
β βββ Real-Time-Order-Delivery-System.postman_collection.json
β βββ Real-Time-Order-Delivery-System-Local.postman_environment.json
β
βββ docker-compose.yml # Production Docker Compose
βββ nginx.conf # Root Nginx reverse proxy config
βββ README.md # This file
- Node.js (v18 or higher)
- MongoDB (v7.0 or higher)
- Docker & Docker Compose (for containerized deployment)
# Build and start all services
docker-compose up -d
# View logs
docker-compose logs -f
# Stop services
docker-compose downThe application will be available at http://localhost
git clone https://github.com/dmelloaries/Delivery-System.git
cd Real-Time-Order-Delivery-Systemcd server
npm installCreate a .env file in the server directory:
PORT=8000
MONGODB_URI=mongodb://localhost:27017/delivery-system
JWT_SECRET=your-secret-key-here
CLIENT_URL=http://localhost:5173
NODE_ENV=developmentRun the admin seeder:
node seed-admin.jsStart the server:
npm startcd ../client
npm install
npm run devThe application will be available at:
- Frontend: http://localhost:5173
- Backend: http://localhost:8000
After running the seed script, use these credentials to login as admin:
- Email: [email protected]
- Password: admin123
Import the Postman collection and environment files from the server/ directory:
Real-Time-Order-Delivery-System.postman_collection.jsonReal-Time-Order-Delivery-System-Local.postman_environment.json
The system uses Socket.io for real-time updates:
order:created- New order placedorder:updated- Order status changedorder:assigned- Order assigned to partnerdelivery:updated- Delivery status updateddelivery:completed- Delivery completed
Made by dmelloaries