Delicia is a production-grade, event-driven full-stack food delivery and logistics platform built on the MERN stack and enhanced with Apache Kafka, Redis Geospatial Indexing, Server-Sent Events (SSE), Docker, and OpenAI GPT.
It features an end-to-end customer ordering web application, an interactive driver tracking system, a secured administrative analytics dashboard, and automated event streaming for order allocation and real-time delivery tracking.
- Key Architecture & Highlights
- System Architecture Flow
- Application Screenshots
- Feature Breakdown
- Tech Stack & Tooling
- API Reference
- Repository Structure
- Getting Started & Local Setup
- Environment Configuration
- Automated Testing & CI/CD
- Author & Contact
- Event-Driven Micro-Messaging (Apache Kafka): Decoupled event streaming pipeline utilizing
kafkajsfor handlingorder-allocatedanddriver-location-updatestopics asynchronously. - Geospatial Nearest-Driver Matching (Redis): Uses Redis
GEOSEARCH(FROMLONLATradius querying) to compute proximity and automatically assign orders to the nearest available delivery partner. - Real-Time GPS Streaming (Server-Sent Events): Low-latency, unidirectional SSE channel (
/api/order/track/:orderId) streaming live telemetry updates to the frontend map UI without client-side polling overhead. - Dual Payment Processing: Integrated with Stripe Checkout for online payments alongside Cash on Delivery (COD) checkout workflows and instant verification callbacks.
- Containerized Infrastructure (Docker Compose): Single-command orchestration for Zookeeper, Apache Kafka, and Redis services.
- Multi-Job Automated CI/CD Pipeline (GitHub Actions): Automated pipeline with live MongoDB container execution, Jest backend API test verification, and ESLint + Vite build validation for both frontend applications.
- Analytics Engine (Recharts): Visual sales, revenue curves, order volumes, and categorical distributions in the Admin control panel.
flowchart TD
subgraph Client Applications
A[Customer Frontend - Vite/React]
B[Admin Dashboard - Vite/React]
S[Driver Telemetry Simulator]
end
subgraph Backend API Gateway
API[Express.js REST API :4000]
SSE[SSE Stream Engine]
end
subgraph Distributed Services
K[Apache Kafka Broker :9092]
R[(Redis 7.2 Cache & GeoIndex :6379)]
M[(MongoDB Atlas Database)]
OAI[OpenAI GPT API]
ST[Stripe Payment Gateway]
end
A -->|Browse, Cart, Order, Auth| API
A -->|Subscribe to Live Location| SSE
B -->|Menu & Order CRUD, Analytics| API
S -->|Push Live GPS Coordinates| API
API -->|Persist Users, Orders, Menu| M
API -->|Geospatial Radius Query & Caching| R
API -->|Publish Location & Order Events| K
API -->|Process Payments| ST
API -->|Delicia AI Assistant Chat| OAI
K -->|Consume Location Updates| SSE
SSE -->|Stream Lat/Lon Coordinates| A
π High-resolution images are located in the
screenshots/directory.
- Interactive Menu & Category Filtering: Filter by Salad, Rolls, Deserts, Sandwich, Cake, Pure Veg, Pasta, Noodles, and more.
- Dynamic Search & Filtering: Multi-condition search across dish names, descriptions, price boundaries, and bestseller chips.
- Cart State Management: Persistent cart context with quantity controls, delivery charge computation, and instant total calculations.
- Currency Localization: Complete support for Indian Rupees (βΉ INR) using
Intl.NumberFormat("en-IN"). - User Profile & Order Center: Dedicated user dashboard managing personal details, avatar uploads (
multer), multi-address book, password updates, and historical orders. - Dual Payment Workflow: Seamless integration with Stripe Checkout and direct Cash on Delivery (COD) verification.
- Proximity Allocation: Redis Geospatial
GEOSEARCHautomatically locates available drivers within a 10km radius upon payment confirmation. - Real-Time Map & Telemetry: Live order tracking interface (
/tracking/:orderId) with Server-Sent Events (SSE) streaming live vehicle coordinates directly from Kafka events. - Driver Simulator: Built-in simulator script (
simulate-driver.js) generating realistic GPS telemetry trajectories.
- Secured Authentication: JWT-protected admin portal with restricted role access.
- Interactive Analytics (Recharts): Visual graphs displaying total revenue, active orders, user counts, item distribution, and daily performance metrics.
- Menu Management (CRUD): Add dishes with custom image uploads via Multer, update menu pricing, and manage category listings.
- Order Lifecycle Workflow: Real-time status management (
Food ProcessingβOut for DeliveryβDelivered).
- Delicia AI Chatbot: Built-in floating assistant powered by OpenAI GPT (
/api/chat) offering personalized dish recommendations, order assistance, and FAQ resolution. - Partner & Franchise Portal: Application submission workflow (
/partner) with document/resume attachment uploads and automated email notifications. - Contact & Inquiries: Customer support contact forms routed via Nodemailer.
| Layer | Technologies |
|---|---|
| Frontend (User & Admin) | React 18, Vite, Tailwind CSS v4, Framer Motion, GSAP, Lucide Icons, Recharts, React Router v6, Axios, React Toastify |
| Backend API | Node.js, Express.js (ES Modules), Mongoose, Multer, JWT, Bcrypt, CORS, Dotenv |
| Distributed Messaging & Cache | Apache Kafka (kafkajs), Confluent Zookeeper, Redis 7.2 (ioredis Geospatial) |
| Real-Time Communication | Server-Sent Events (SSE) |
| Database & Cloud | MongoDB / MongoDB Atlas |
| Integrations & AI | Stripe API, OpenAI GPT API, Nodemailer (SMTP) |
| DevOps & Infrastructure | Docker, Docker Compose, GitHub Actions CI/CD |
| Testing & Quality | Jest, Supertest, ESLint |
POST /api/user/registerβ Register new customer accountPOST /api/user/loginβ Authenticate and return JWT tokenGET /api/user/profileβ Fetch current user profile (Authenticated)PUT /api/user/updateprofileβ Update name, phone, and profile detailsPUT /api/user/changepasswordβ Update account security passwordPOST /api/user/upload-avatarβ Upload profile avatar image (multipart/form-data)GET /api/user/useraddressesβ Retrieve saved delivery addressesPUT /api/user/update-addressβ Add or modify saved delivery address
GET /api/food/listβ Retrieve menu items (supports search, category filter, sorting, pagination)POST /api/food/addβ Add new food dish with image file (multipart/form-data)POST /api/food/removeβ Delete food dish by ID
POST /api/cart/getβ Fetch user's cart contentsPOST /api/cart/addβ Add item / increment quantity in cartPOST /api/cart/removeβ Decrement / remove item from cart
POST /api/order/placeβ Place an order (generates Stripe checkout session or COD order)POST /api/order/verifyβ Verify Stripe transaction, trigger Redis driver match & Kafka allocationPOST /api/order/userordersβ Retrieve orders for authenticated userGET /api/order/listβ List all customer orders (Admin)POST /api/order/statusβ Update order progress state (Admin)GET /api/order/track/:orderIdβ SSE stream broadcasting live driver telemetry
POST /api/driver/registerβ Register a delivery driverPOST /api/driver/locationβ Push GPS latitude/longitude (updates Redis Geo & Kafka stream)
POST /api/admin/loginβ Admin portal authenticationGET /api/dashboard/statsβ High-level analytics metrics (Revenue, Orders, Category splits)POST /api/chatβ Query Delicia AI assistant (OpenAI GPT)POST /api/contactβ Submit customer support message (Nodemailer)POST /api/partnerβ Submit partner/franchise application with documents
Delicia/
βββ .github/
β βββ workflows/
β βββ ci.yml # GitHub Actions CI Pipeline (Mongo, Jest, Lint, Build)
βββ admin/ # Admin Analytics & Management Dashboard (Vite + React)
β βββ src/
β β βββ components/ # Navbar, Sidebar, UI components
β β βββ pages/ # Dashboard (Charts), Add, List, Orders, Login
β βββ package.json
β βββ vite.config.js
βββ backend/ # Node.js Express REST API & Streaming Engine
β βββ config/ # MongoDB, Kafka, and Redis client configurations
β βββ controllers/ # Business logic (User, Order, Food, Driver, Dashboard, etc.)
β βββ middleware/ # Auth verification & Multer file upload handlers
β βββ models/ # Mongoose Schemas (User, Food, Order, Driver, Admin)
β βββ routes/ # Express route declarations
β βββ tests/ # Jest & Supertest automated API tests
β βββ uploads/ # Static media storage for dishes & avatars
β βββ server.js # Server entry point, SSE stream & OpenAI endpoint
β βββ package.json
βββ frontend/ # Customer-Facing Web Application (Vite + React)
β βββ src/
β β βββ components/ # Navbar, Footer, FoodDisplay, Chatbot, LoginPopup, etc.
β β βββ Context/ # React Context Store for Cart & Global State
β β βββ pages/ # Home, Cart, PlaceOrder, MyOrders, Dashboard, Tracking
β β βββ assets/ # Icons, banners, and graphical assets
β βββ package.json
β βββ vite.config.js
βββ screenshots/ # Application preview screenshots
βββ docker-compose.yml # Multi-container orchestration (Kafka, Zookeeper, Redis)
βββ simulate-driver.js # Live driver GPS telemetry simulation script
βββ README.md
- Node.js:
v18.xor higher - npm:
v9.xor higher - Docker & Docker Compose: Installed and running (Docker Desktop)
- MongoDB: Local instance or free MongoDB Atlas cluster
git clone https://github.com/Vikaumar/Delicia.git
cd DeliciaLaunch Apache Kafka, Zookeeper, and Redis containers:
docker-compose up -dVerify services are healthy:
- Redis:
localhost:6379 - Kafka:
localhost:9092 - Zookeeper:
localhost:2181
cd backend
npm installCreate a .env file inside backend/ (refer to Environment Configuration):
# Start backend in development mode (with nodemon)
npm run devBackend runs on: http://localhost:4000
Open a new terminal:
cd frontend
npm install
npm run devCustomer web application runs on: http://localhost:5173
Open a new terminal:
cd admin
npm install
npm run devAdmin management dashboard runs on: http://localhost:5174
To test real-time geospatial driver allocation and live map SSE streaming:
# In the root directory:
npm install axios
node simulate-driver.jsThis registers a simulated delivery driver and pushes GPS coordinates to the backend every 2 seconds.
Create a .env file in the backend/ directory:
# βββ Server & Ports βββ
PORT=4000
NODE_ENV=development
# βββ Database βββ
MONGO_URI=mongodb+srv://<username>:<password>@cluster.mongodb.net/Delicia?retryWrites=true&w=majority
# βββ Authentication βββ
JWT_SECRET=your_jwt_secret_key_here
# βββ Stripe Payment Gateway βββ
STRIPE_SECRET_KEY=sk_test_your_stripe_secret_key
# βββ OpenAI Chatbot Assistant βββ
OPENAI_API_KEY=sk-proj-your_openai_api_key
# βββ Application URLs (CORS & Callbacks) βββ
FRONTEND_URL=http://localhost:5173
ADMIN_URL=http://localhost:5174
# βββ Email & Notifications (Nodemailer SMTP) βββ
SUPPORT_EMAIL=support@delicia.com
PARTNERS_EMAIL=partners@delicia.com
EMAIL_HOST=smtp.example.com
EMAIL_PORT=587
EMAIL_USER=your_email@example.com
EMAIL_PASS=your_email_password
EMAIL_FROM="Delicia Support <support@delicia.com>"The project includes automated integration tests using Jest and Supertest:
cd backend
npm testThe repository contains a robust CI workflow (.github/workflows/ci.yml) that automatically triggers on every push and pull request to main:
- Backend Integration Pipeline: Spins up a native
mongo:latestservice container and executes the Jest test suite. - Frontend Quality Check: Executes ESLint analysis and verifies Vite production build bundle creation.
- Admin Portal Check: Executes ESLint validation and verifies Vite production build.
This project is open source and available under the MIT License.
Vikas Kumar
- π B.Tech CSE, IIIT Kota (3rd Year)
- πΌ Aspiring FullβStack / Software Development Engineer
- π GitHub: @Vikaumar
β If you find this project helpful, consider starring the repository!



