Skip to content

aahil-khan/intellidine

Repository files navigation

IntelliDine - Restaurant Management SaaS

frontend: https://github.com/jntbatra/frontend-intellidine


Overview

IntelliDine is a modern microservices-based restaurant management platform featuring:

  • Multi-tenant QR-based ordering with real-time updates
  • Kitchen Display System (KDS) for order management
  • Inventory management with real-time deduction
  • Payment processing with Razorpay integration
  • Analytics dashboard with daily metrics
  • Kafka-based event streaming for real-time processing

What's Included

  • 9 microservices (NestJS + FastAPI) fully scaffolded
  • PostgreSQL + Prisma ORM for data persistence
  • Redis for session management and caching
  • Kafka for event-driven architecture
  • Docker Compose for local development and production deployment
  • Comprehensive API documentation with Postman collection (35+ endpoints)
  • CI/CD workflow (GitHub Actions ready)

Quick Start

Prerequisites

  • Docker Desktop or Docker Engine
  • Git
  • bash or WSL2 (Windows)

Setup (5 minutes)

git clone <repo>
cd Intellidine

# Copy environment template
cp ENV.example .env

# Start all services
docker compose up -d --build

# Run database migrations
docker compose exec api-gateway npx prisma migrate deploy

# Verify services are running
docker ps

Verify Services

# Check API Gateway health
curl http://localhost:3000/health

# Check individual services
curl http://localhost:3001/health  # Auth Service
curl http://localhost:3002/health  # Order Service
curl http://localhost:3003/health  # Menu Service
curl http://localhost:3005/health  # Payment Service

Service URLs

Service Port Status
API Gateway 3000
Auth Service 3001
Order Service 3002
Menu Service 3003
Inventory Service 3004
Payment Service 3005
Notification Service 3006
Analytics Service 3007
Discount Engine 3008
ML Service 8000
PostgreSQL 5432
Redis 6379
Kafka 9092

Architecture

┌─────────────────────────────────────────────────────────┐
│                    API Gateway (3000)                    │
│              (Request Routing & Load Balancing)          │
└─────────┬───────────────────────────────────────────────┘
          │
    ┌─────┼─────┬──────────┬─────────┬──────────┐
    │     │     │          │         │          │
    ▼     ▼     ▼          ▼         ▼          ▼
 ┌─────┐ ┌────┐ ┌─────┐ ┌──────┐ ┌────┐    ┌────┐
 │Auth │ │Menu│ │Order│ │Payment│ │Inv │    │Notif│
 │3001 │ │3003│ │3002 │ │ 3005  │ │3004│    │3006 │
 └─────┘ └────┘ └─────┘ └──────┘ └────┘    └────┘
   ✅      ✅      ✅       ✅       ✅         ✅

┌──────────────────────────────────────────────────────┐
│      Data Layer (PostgreSQL, Redis, Kafka)           │
└──────────────────────────────────────────────────────┘

Tech Stack: NestJS 10 • PostgreSQL 15 • Prisma 5 • Redis 7 • Kafka 3 • Docker • Node 20 Alpine


API Overview

Authentication

  • POST /api/auth/customer/request-otp - Request OTP for customer login
  • POST /api/auth/customer/verify-otp - Verify OTP and receive JWT token
  • POST /api/auth/staff/login - Staff login with credentials

Menu Management

  • GET /api/menu - List all menu items
  • POST /api/menu/items - Create new menu item
  • GET /api/menu/items/:id - Get item details
  • PATCH /api/menu/items/:id - Update menu item
  • DELETE /api/menu/items/:id - Delete menu item

Order Management

  • POST /api/orders - Create new order
  • GET /api/orders - List orders
  • GET /api/orders/:id - Get order details
  • PATCH /api/orders/:id/status - Update order status
  • PATCH /api/orders/:id/cancel - Cancel order

Payment Processing

  • POST /api/payments/create-razorpay-order - Create Razorpay order
  • POST /api/payments/verify-razorpay - Verify payment
  • POST /api/payments/confirm-cash - Record cash payment
  • GET /api/payments/:payment_id - Get payment details
  • GET /api/payments - List payments

See POSTMAN_TESTING_COMPLETE.md for complete API documentation with examples.


Testing

All 35 API endpoints have been tested and verified:

  • ✅ 35/35 requests passing
  • ✅ 6/6 assertions passing
  • ✅ 100% success rate
  • ✅ Average response time: 13ms

Run Postman Tests

newman run Intellidine-API-Collection.postman_collection.json \
  -e local.env.postman.json

Database Schema

The Prisma schema includes models for:

  • Tenant: Multi-tenancy isolation
  • User: Authentication and role-based access control
  • MenuItem: Menu items with categories and pricing
  • Order: Order management with line items and status tracking
  • Payment: Payment tracking with Razorpay/Cash support
  • Inventory: Stock levels and reorder management

See backend/prisma/schema.prisma for complete schema.


Deployment

Development

docker compose up -d --build

Production

For production deployment with Cloudflare tunnel integration:

  1. Clone to deployment server:

    git clone <repo> /opt/intellidine
    cd /opt/intellidine
  2. Configure environment:

    # Create .env.production with secure values
    cp ENV.example .env.production
    # Edit with production secrets, database URL, JWT keys, etc.
  3. Run database migrations:

    docker compose exec api-gateway npx prisma migrate deploy
  4. Start services:

    docker compose up -d
  5. Set up Cloudflare tunnel: See PRODUCTION_DEPLOYMENT_GUIDE.md for detailed steps.


📚 Comprehensive Documentation

Start Here

Individual Service Guides (Complete API & Integration Details)

Complete Workflow Guides (Step-by-Step Processes with Real Examples)

For Deployment & Operations

For E2E Testing & Verification

Total Documentation: 10,000+ lines | 10 Service Guides | 5 Workflow Guides | E2E Flow Guide | Deployment Guide | 50+ Real Examples


Verification Status

✅ All Services Operational

  • ✅ Auth Service - OTP + JWT working
  • ✅ Menu Service - Browsing + caching working
  • ✅ Order Service - Creation + status management working
  • ✅ Payment Service - Razorpay + cash payments working
  • ✅ Inventory Service - Stock deduction + alerts working
  • ✅ Notification Service - SMS + Socket.io working
  • ✅ Analytics Service - Metrics + reporting working
  • ✅ Discount Engine - ML predictions + rules working
  • ✅ API Gateway - All 52 endpoints working (100%)
  • ✅ Kafka - Event streaming working

✅ Complete E2E Flows

  • Authentication - OTP → JWT → Session
  • Menu Browsing - List categories → Get items → Cache
  • Order Creation - Add to cart → Create order → Kafka events
  • Discount Calculation - ML evaluation → Rules application
  • Payment Processing - Online (Razorpay) + Cash
  • Inventory Deduction - Automatic on order confirmation
  • Kitchen Display - Real-time order updates
  • Notifications - SMS alerts + Socket.io broadcasts
  • Analytics - Complete metrics capture

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors