Skip to content

Folders and files

NameName
Last commit message
Last commit date

Latest commit

ย 

History

550 Commits
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 

Repository files navigation

SwadKart - Best Food Delivery App in Jaipur

๐Ÿ” SwadKart โ€” Multi-Vendor Food Delivery Platform

India's Next-Gen Food Ordering & Delivery System | MERN Stack | Real-Time Tracking | AI-Powered

Live Demo GitHub Stars Last Commit License


MongoDB Express.js React Node.js Redux Toolkit Socket.io Tailwind CSS Razorpay Firebase Redis

๐Ÿ“ธ Application Screenshots

๐Ÿ  Home Page โ€” Restaurant Discovery & Smart Search

SwadKart Home Page - Food Delivery App with Restaurant Discovery



๐Ÿ“Š Admin Dashboard โ€” Real-Time Analytics & Revenue Insights

SwadKart Admin Dashboard - Order Analytics and Revenue Tracking



๐Ÿฝ๏ธ Restaurant Menu โ€” Dynamic Cart & Ordering

SwadKart Restaurant Menu - Online Food Ordering System



๐Ÿ“ฑ Mobile Responsive โ€” PWA Installable App

SwadKart Mobile App - Progressive Web App Food Delivery



๐Ÿ” Biometric Security โ€” Fingerprint & FaceID Login

Premium Lock Screen Profile Control Center
SwadKart Biometric Lock Screen - WebAuthn Security SwadKart User Profile - Wallet and SwadCoins

๐Ÿ“– About SwadKart

SwadKart is a production-grade, scalable multi-vendor food delivery platform built with the MERN stack (MongoDB, Express.js, React, Node.js). Designed and developed at Jagannath University, Jaipur, it connects users with local restaurants through a sophisticated multi-role ecosystem โ€” Admin, Restaurant Owner, Delivery Partner, and Customer.

Why SwadKart?

  • ๐Ÿš€ Not a clone โ€” Production-hardened with 30+ API routes, fraud detection, and enterprise security
  • ๐Ÿค– AI-Powered โ€” Groq LLM chatbot for natural language food recommendations
  • ๐Ÿ—ฃ๏ธ Voice Search โ€” "Show me biryani under โ‚น200" works in English & Hindi
  • ๐Ÿ“ Real-Time Tracking โ€” Live GPS driver tracking via Socket.io
  • ๐Ÿ”’ Biometric Auth โ€” Fingerprint/FaceID login via WebAuthn (no password needed)
  • ๐Ÿ’ณ Razorpay Payments โ€” UPI, Cards, Wallets, and COD support
  • ๐ŸŒ PWA โ€” Installable on iOS/Android with offline support & push notifications

๐ŸŒŸ Key Features

๐Ÿ›๏ธ User Experience

  • Smart Discovery โ€” AI-powered restaurant & dish recommendations with natural language search
  • Voice Search โ€” Hands-free search in English & Hindi using Web Speech API
  • Dynamic Cart โ€” Real-time price calculation with surge pricing, coupons, and SwadPass discounts
  • Secure Auth โ€” Triple authentication: JWT + Firebase Google OAuth + WebAuthn Biometric
  • Live Order Tracking โ€” GPS driver tracking from "Preparing" โ†’ "Out for Delivery" โ†’ "Delivered"
  • Smart Reorder โ€” One-tap reorder from frequently ordered items
  • Chatbot Action Tools โ€” AI Genie executes actions (order status, cancel, reorder, coupons, delivery ETA, FAQ) via Groq function-calling pipeline

๐Ÿ‘‘ Admin Command Center

  • Live Analytics โ€” Revenue, order volume, active users, and restaurant performance trends
  • Demand Heatmap โ€” Interactive Leaflet.js map visualizing high-demand zones
  • User Management โ€” Full RBAC (Role-Based Access Control)
  • Coupon Engine โ€” Create, manage, and track coupon usage with auto-validation
  • Fraud Detection โ€” Heuristics engine flags suspicious orders, repeat addresses, coupon abuse

๐Ÿช Restaurant & Delivery Partner

  • Menu Lab โ€” Stock management, variant toggling, real-time availability
  • Delivery Dashboard โ€” Accept/reject orders, GPS tracking, OTP-verified delivery handoff
  • ETA Prediction โ€” Dynamic delivery time based on distance, traffic, and order queue

๐Ÿ’Ž SwadPass Subscription

  • Free Delivery โ€” Unlimited free delivery on all orders
  • Exclusive Discounts โ€” Additional 10% off every order
  • Priority Support โ€” Fast-track customer service

๐ŸŽฎ Gamification & Loyalty

  • Order Streaks โ€” 3-day, 7-day, and 30-day streak badges
  • SwadCoins โ€” Earn coins on every order, redeem for discounts
  • Achievement Badges โ€” First Bite, Week Warrior, Month Master, Explorer, Top 10
  • Referral System โ€” Invite friends and earn rewards on their first paid order

๐Ÿ“Š Enterprise Features

  • Surge Pricing โ€” Dynamic delivery fee multiplier based on demand vs supply
  • Group Ordering โ€” Split bills with friends via invite code (equal or item-wise)
  • Table Reservations โ€” Book tables with QR code confirmation
  • GDPR Compliance โ€” One-click data export (JSON) and account deletion with anonymization
  • Multi-Language โ€” Full i18n support (English & Hindi)
  • PWA โ€” Installable app with offline support, push notifications, service worker caching

๐Ÿ—๏ธ Architecture & Tech Stack

The project follows a clean MVC (Model-View-Controller) architecture. See docs/ARCHITECTURE.md for full system design.

Frontend (/frontend)

Layer Technology
Framework React 19 + Vite 7
State Management Redux Toolkit 2
Styling Tailwind CSS 3 + Lucide React Icons
Routing React Router 7 (Lazy Loading)
Real-time Socket.io-client 4
Maps Leaflet.js 1.9
Charts Recharts 3
AI Groq SDK (LLM chatbot + recommendations)
Voice Web Speech API (en-IN / hi-IN)
Auth Firebase Auth + Google OAuth + WebAuthn
i18n i18next (English + Hindi)
Build Vite PWA (vite-plugin-pwa 0.19)
PDF jsPDF + jsPDF-autotable
Push Firebase Cloud Messaging (FCM)

Backend (/backend)

Layer Technology
Runtime Node.js 22 + Express 5
Database MongoDB Atlas (Mongoose 9 ODM)
Cache Redis (ioredis) / In-Memory Fallback
Auth JWT (httpOnly cookies) + WebAuthn + Firebase Admin
Real-time Socket.io 4 (room-based authorization)
Payments Razorpay 2 (UPI/Card/Wallet/COD)
Email Brevo API + Nodemailer (BullMQ queue)
Storage Cloudinary (multer + sharp image processing)
AI Groq SDK (Llama 3 chat + dish recommendations + function-calling tools)
Testing fast-check (property-based testing for chatbot tools)
Validation express-validator + Custom NoSQL Sanitizer
Rate Limiting express-rate-limit (strict on auth/orders)
Security Helmet 8, CORS, CSRF protection
Job Queue BullMQ (Redis-backed email worker)

๐ŸŒฟ Documentation

Document Description
docs/API.md Complete REST API reference (30+ endpoints, auth & error patterns)
docs/ARCHITECTURE.md System design, middleware pipeline, security & caching layers
docs/DB_SCHEMA.md 14 MongoDB collections: models, fields, relations & ER diagram
docs/DEPLOYMENT.md Production deployment: Vercel + Render + MongoDB Atlas + Cloudinary
docs/EDGE_CASES.md Security & performance edge cases, graceful degradation, failure modes
docs/TECH_STACK.md Layer-by-layer dependency inventory: frontend, backend, DevOps
docs/WORKFLOW.md User journey, admin ops & delivery driver Mermaid workflows
docs/AI_DISCOVERABILITY_FRAMEWORKS.md AI discoverability: AEO, GEO, LLMO, AI-SEO, E-E-A-T & traditional SEO

๐Ÿš€ Getting Started

Prerequisites

1. Clone the Repository

git clone https://github.com/theunstopabble/swadkart.git
cd swadkart

2. Backend Setup

cd backend
npm install

Create a .env file in /backend:

# Server
PORT=8000
NODE_ENV=development

# Database
MONGO_URI=your_mongodb_connection_string

# JWT (MUST be 32+ chars)
JWT_SECRET=your_super_secure_random_jwt_secret_here_at_least_32_chars

# Frontend URL (CORS)
FRONTEND_URL=http://localhost:5173

# Email Service
SMTP_HOST=smtp.gmail.com
SMTP_PORT=465
SMTP_MAIL=your_email@gmail.com
SMTP_PASSWORD=your_app_password
BREVO_API_KEY=your_brevo_api_key

# Biometric Auth (WebAuthn)
RP_ID=localhost
RP_NAME=SwadKart

# Redis Cache (Optional โ€” falls back to in-memory)
REDIS_URL=your_upstash_or_redis_url

# Payment Gateway (Razorpay)
RAZORPAY_KEY_ID=rzp_test_xxxxxxxxxxxxxx
RAZORPAY_KEY_SECRET=your_razorpay_secret
RAZORPAY_WEBHOOK_SECRET=your_webhook_secret

# Cloudinary (Image Uploads)
CLOUDINARY_CLOUD_NAME=your_cloud_name
CLOUDINARY_API_KEY=your_api_key
CLOUDINARY_API_SECRET=your_api_secret

# AI (Groq LLM)
GROQ_API_KEY=gsk_your_groq_api_key

# Firebase Admin SDK
FIREBASE_SERVICE_ACCOUNT={"type":"service_account",...}

Start the backend:

node server.js

3. Frontend Setup

cd frontend
npm install

Create a .env file in /frontend:

VITE_API_URL=http://localhost:8000/api/v1
VITE_GOOGLE_CLIENT_ID=your_google_oauth_client_id.apps.googleusercontent.com
VITE_FIREBASE_API_KEY=your_firebase_key
VITE_FIREBASE_AUTH_DOMAIN=your_project.firebaseapp.com
VITE_FIREBASE_PROJECT_ID=your_project_id

Start the development server:

npm run dev

Visit http://localhost:5173 to see SwadKart running locally.


๐Ÿ“‚ Project Structure

swadkart/
โ”œโ”€โ”€ backend/
โ”‚   โ”œโ”€โ”€ config/             # DB, Cloudinary, Redis, WebAuthn configuration
โ”‚   โ”œโ”€โ”€ controllers/        # 30+ controllers (User, Order, Admin, Delivery, AI, GDPR)
โ”‚   โ”œโ”€โ”€ middleware/         # Auth, Error, Rate Limit, Fraud Detection, Cache
โ”‚   โ”œโ”€โ”€ models/             # 14 Mongoose Schemas with compound indexes
โ”‚   โ”œโ”€โ”€ routes/             # 30+ RESTful API route modules
โ”‚   โ”œโ”€โ”€ services/
โ”‚   โ”‚   โ””โ”€โ”€ chat/           # AI Chatbot pipeline
โ”‚   โ”‚       โ”œโ”€โ”€ tools/      # Action tools (orderStatus, cancel, coupon, ETA, FAQ, reorder)
โ”‚   โ”‚       โ””โ”€โ”€ *.js        # Pipeline, intent, sentiment, language, retrieval
โ”‚   โ”œโ”€โ”€ tests/
โ”‚   โ”‚   โ””โ”€โ”€ properties/     # Property-based tests (fast-check)
โ”‚   โ”œโ”€โ”€ utils/              # Token generators, email templates, cache helpers
โ”‚   โ””โ”€โ”€ server.js           # Express app entry point
โ”‚
โ”œโ”€โ”€ frontend/
โ”‚   โ”œโ”€โ”€ src/
โ”‚   โ”‚   โ”œโ”€โ”€ components/     # Reusable UI (Navbar, ChatBot, VoiceSearch, PWA Install)
โ”‚   โ”‚   โ”œโ”€โ”€ pages/          # 20+ pages (all user roles)
โ”‚   โ”‚   โ”œโ”€โ”€ redux/          # Global State (Cart, User slices with RTK)
โ”‚   โ”‚   โ”œโ”€โ”€ utils/          # Firebase config, biometric service, socket, invoice
โ”‚   โ”‚   โ”œโ”€โ”€ locales/        # i18n translations (en, hi)
โ”‚   โ”‚   โ””โ”€โ”€ App.jsx         # Router + lazy loading + biometric lock + role guards
โ”‚   โ”œโ”€โ”€ assets/             # Screenshots and branding assets
โ”‚   โ””โ”€โ”€ public/             # PWA assets (manifest, icons, hero image)
โ”‚
โ”œโ”€โ”€ docs/                   # ๐Ÿ“š Full project documentation
โ”‚   โ”œโ”€โ”€ ARCHITECTURE.md     # System design & security layers
โ”‚   โ”œโ”€โ”€ WORKFLOW.md         # 10 Mermaid diagrams (user journey, admin, driver)
โ”‚   โ”œโ”€โ”€ API.md              # Complete endpoint reference (30+ routes)
โ”‚   โ”œโ”€โ”€ DB_SCHEMA.md        # All 14 collections & ER diagram
โ”‚   โ”œโ”€โ”€ DEPLOYMENT.md       # Vercel + Render + MongoDB + Cloudinary setup
โ”‚   โ”œโ”€โ”€ TECH_STACK.md       # Layer-by-layer dependency tree
โ”‚   โ””โ”€โ”€ EDGE_CASES.md       # 20 security/performance edge cases
โ”‚
โ””โ”€โ”€ .github/workflows/      # CI/CD pipeline (lint + build + syntax check)

๐Ÿ›ก๏ธ Security & Performance

Feature Implementation Status
JWT Security 32+ char secret, httpOnly cookies, secure + sameSite โœ…
CORS Strict allowlist, dynamic origin validation โœ…
Rate Limiting Auth: 10/10min, API: 300/15min, Orders: 20/15min โœ…
NoSQL Injection Prevention Custom $ and . sanitizer + parameter binding โœ…
CSRF Protection Origin + Referer header validation โœ…
XSS Prevention Helmet headers + Content Security Policy โœ…
Fraud Detection Non-blocking heuristics on order creation โœ…
Graceful Shutdown SIGTERM โ†’ close HTTP โ†’ close MongoDB โ†’ exit(0) โœ…
Health Checks /health endpoint with MongoDB + Redis status โœ…
MongoDB Pool 50 connections, writeConcern: majority, heartbeat 10s โœ…
Query Optimization .lean() on all read-heavy endpoints (3-5x faster) โœ…
Response Caching Redis/in-memory cache on GET endpoints (1-5 min TTL) โœ…
Lazy Loading All pages lazy-loaded via React Router + Suspense โœ…
PWA Caching Service worker precaches 80+ assets โœ…

๐ŸŒ Production Deployment

Component Platform URL
Frontend Vercel swadkart.vercel.app
Backend Render swadkart-5wtf.onrender.com
Database MongoDB Atlas Cluster (M0 Free Tier compatible)
Cache Redis Cloud Optional โ€” in-memory fallback
Images Cloudinary Auto-optimized delivery
Payments Razorpay Test + Live keys supported

CI/CD Pipeline (GitHub Actions):

  1. Backend syntax check (node --check on all files)
  2. Frontend lint (npx eslint src/)
  3. Frontend build test (npm run build)
  4. Auto-deploy to Vercel on green build

๐Ÿค Contributing

Contributions are welcome! Please follow these steps:

  1. Fork the repository
  2. Create your feature branch (git checkout -b feature/amazing-feature)
  3. Commit your changes (git commit -m 'Add amazing feature')
  4. Push to the branch (git push origin feature/amazing-feature)
  5. Open a Pull Request

๐Ÿ“ž Contact & Support

Author: Gautam Kumar โ€” Full-Stack Developer | Solo-shipped SaaS Products | AI Integration

LinkedIn GitHub Twitter Portfolio


โญ Show Your Support

If you find SwadKart useful, please consider giving it a star โญ on GitHub โ€” it helps others discover this project!


๐ŸŒ Live Demo ยท ๐Ÿ“š Documentation ยท ๐Ÿ› Report Bug ยท โœจ Request Feature


Built with โค๏ธ by Gautam Kumar (from Sitamarhi, Bihar) at Jagannath University, Jaipur


๐ŸŒ More Projects by Gautam Kumar

Project Description Link
Portfolio Personal portfolio & developer profile gautam-kr.vercel.app
InterviewMinds Production-grade AI Mock Interview Platform interviewminds.vercel.app
Satark-AI Deepfake detection & speaker verification platform satark-deepfake.vercel.app
TexFolio AI-powered LaTeX resume builder with RBAC texfolio.vercel.app

About

A production-grade Multi-Vendor Food Delivery Platform with AI Chatbot (Groq LLM), Real-Time GPS Tracking (Socket.io), Biometric Auth (WebAuthn), Razorpay Payments, 4-Role Dashboards, and Gamification. MERN Stack + Redis + PWA.

Topics

Resources

Stars

12 stars

Watchers

0 watching

Forks

Used by

Contributors

Languages