FastAPI + React application for disruption-aware essential-goods logistics simulation across India.
Live demo: https://logisight.app | API docs: https://logisight.app/docs
Disruption-aware logistics coordination platform featuring AI/ML decision engines, real-time simulation, driver mobile loop, and Google Cloud integration.
One-liner pitch: "A disruption-aware logistics brain for India. We simulate real supply chains, ingest weather/news data, and use an AI decision engine to reroute vehicles before stockouts happen β all visible on a live map with a driver mobile loop."
India loses 4β8% of cereals and 5β15% of fruits & vegetables between harvest and the consumer (NABCONS, 2022 study commissioned by the Ministry of Food Processing Industries). The FSSAI reports that 1/3 of all food produced in India spoils before it is eaten β amounting to ~78.2 million tonnes of food waste annually (UNEP Food Waste Index, 2024). That quantity could feed 377 million people.
The primary cause is supply chain disruption β not scarcity. Inefficient routing, weather-related road closures (cyclones, monsoon flooding, fog), and lack of real-time rerouting lead to inventory piling up at origin facilities while destination warehouses stock out. The problem is accelerating: India experiences 5β6 cyclonic storms annually, extreme weather events are increasing in frequency, and the logistics cold-chain market relies on temperature-sensitive transport that cannot tolerate delays.
Logisight addresses this at the operational decision layer. Rather than building new infrastructure, it optimises the existing fleet β detecting disruptions early, rerouting vehicles before stockouts occur, and providing a live operations dashboard + driver mobile loop for ground-level execution. The result: fewer stockouts, less spoilage, lower COβ emissions from empty return trips, and a logistics system that adapts in minutes, not days.
- Network management: facilities, ports, port links, vehicles, drivers, and objectives
- Simulation controls: start, pause, resume, reset, and speed multiplier (up to 5000x)
- AI Decision Engine: dispatch scoring, RL-based rerouting (DQN with PyTorch), NSGA-II multi-objective optimization
- RL agent convergence: DQN trained offline (500 epochs, loss 1.83 β 0.55, epsilon 1.0 β 0.05) β see
docs/rl_training_curve.png - Route planning: OSRM first, automatic estimated-route fallback when OSRM is unavailable
- Disruption management: weather/news ingestion from workbooks + manual driver incident injection + auto-demo disruption
- Scenario comparison: baseline vs AI-optimized with trigger presets
- Driver mobile loop: pending instructions, accept/ignore decisions, incident reporting, AI chat assistant
- SDG-style metrics: stockouts prevented, critical deliveries saved, CO2 reduction
- Real-time WebSocket stream at
/ws/operations - Multi-tenant architecture: isolated simulation engines per client
- Cryptographic audit trail: tamper-evident SHA-256 hash-chain ledger
- Bilingual UI: English + Hindi (i18n)
- PWA support with offline caching
| Endpoint | URL | Platform |
|---|---|---|
| Admin Dashboard | https://logisight.app | Cloud Run + Firebase Hosting |
| API & WebSocket | https://api.logisight.app | Google Cloud Run |
| Driver Mobile App | https://driver.logisight.app | Firebase Hosting |
| Swagger Docs | https://logisight.app/docs | Cloud Run |
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
β Admin Dashboard (React/Vite) β
β Map Β· Live Ops Β· Scenarios Β· Events Β· Impact Β· Analytics β
βββββββββββββββββββββββββββ¬ββββββββββββββββββββββββββββββββββ β
β HTTP / WS
βββββββββββββββββββββββββββΌβββββββββββββββββββββββββββββββββββ
β FastAPI Backend (Python 3.11) β
β βββββββββββββββ ββββββββββββ ββββββββββββββββββββββββββ β
β βSimulation β βAI/ML β βGoogle Cloud Integration β β
β βEngine β βEngine β βFirebase Β· Pub/Sub β β
β β(1905 lines) β βDQN RL β βVertex AI Β· BigQuery β β
β β β βNSGA-II β βCloud Messaging Β· CloudSQLβ β
β βββββββββββββββ ββββββββββββ ββββββββββββββββββββββββββ β
β βββββββββββββββ ββββββββββββ ββββββββββββββββββββββββββ β
β βRoute Plannerβ βEvent β βCryptographic Audit β β
β βOSRM + Fallb.β βIngestion β βSHA-256 Hash-chain β β
β βββββββββββββββ ββββββββββββ ββββββββββββββββββββββββββ β
βββββββββββββββββββββββββββ¬βββββββββββββββββββββββββββββββββββ
β HTTP / WS
βββββββββββββββββββββββββββΌβββββββββββββββββββββββββββββββββββ
β Driver Mobile App (React/PWA) β
β Instructions Β· Incident Report Β· AI Chat Β· Real-time Map β
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
| Layer | Technology |
|---|---|
| Backend | Python 3.11+, FastAPI 0.115, Uvicorn |
| Database | PostgreSQL (prod) / SQLite (dev), SQLAlchemy 2.0, Alembic |
| Frontend | React 18, Vite 6, React Router 7, Leaflet, Recharts, Framer Motion |
| AI/ML | PyTorch (DQN RL), scikit-learn, Google Gemini, Groq (LLM) |
| Infrastructure | Docker, Google Cloud Run, Firebase Hosting, Cloud SQL, Pub/Sub, Vertex AI, BigQuery |
| Real-time | WebSocket (FastAPI native) |
| Mobile | Driver PWA (React + Vite) |
| i18n | English, Hindi |
| Category | Status | Coverage |
|---|---|---|
| Backend pytest | β 7 test suites | 20%+ target |
| Frontend Vitest | β 3 test suites (formatters, validators, dashboard utils) | 30+ unit tests |
| Driver App Vitest | β Real unit tests | Added |
| CI Pipeline | β GitHub Actions (lint β test β build β Docker) | View runs |
| Code Coverage | β
pytest-cov with .coveragerc |
View on Codecov |
# Run all backend tests
python -m pytest tests/ -v --cov=. --cov-report=term
# Run frontend tests
cd frontend && npx vitest run
# Run driver app tests
cd driver-app-main && npx vitest runMigrations managed via Alembic (replaces legacy auto-ALTER TABLE):
# Create a new migration
alembic revision --autogenerate -m "description"
# Apply migrations
alembic upgrade head
# Rollback one step
alembic downgrade -1The initial migration (0001_initial_schema.py) captures the full schema at project inception. All new columns should be added via Alembic revisions.
- Python 3.11+
- Node.js 20+
- PostgreSQL (optional, SQLite used by default)
python -m venv .venv
.\.venv\Scripts\Activate.ps1
pip install -r requirements.txt
python -m uvicorn main:app --reloadcd frontend
npm install
npm run dev # β http://localhost:5173cd driver-app-main
npm install
npm run dev # β http://localhost:5174docker build -t logisight .
docker run -p 8000:8000 logisightKey environment variables β see config.py for the full list.
| Variable | Default | Purpose |
|---|---|---|
DATABASE_URL |
postgresql://postgres:postgres@localhost:5432/supply_chain |
Production database |
GCP_PROJECT_ID |
logisight-prod |
Google Cloud project |
GCP_REGION |
asia-south1 |
GCP region (Mumbai) |
GEMINI_API_KEY |
β | Google Gemini for AI chat |
GROQ_API_KEY |
β | Groq fallback for AI chat |
FIREBASE_ENABLED |
true |
Firebase Realtime DB + Auth |
PUBSUB_ENABLED |
true |
Cloud Pub/Sub event streaming |
VERTEX_AI_ENABLED |
true |
Vertex AI model hosting |
BIGQUERY_ENABLED |
true |
BigQuery analytics |
FCM_ENABLED |
true |
Firebase Cloud Messaging |
SIMULATION_SPEED |
5000.0 |
Default speed multiplier |
DEMO_MODE |
true |
Auto-start + auto-disruptions |
logisight/
βββ main.py # FastAPI entry point
βββ config.py # Settings with env validation
βββ database.py # SQLAlchemy + Alembic migrations
βββ models.py # ORM models (20+ tables)
βββ requirements.txt # Python dependencies
βββ alembic.ini / alembic/ # Database migrations
βββ .github/workflows/ci.yml # CI/CD pipeline
βββ .coveragerc # Code coverage config
βββ firebase-service-account.json.template # GCP credentials template
βββ gcp_config.yaml.template # GCP configuration template
βββ Dockerfile # Multi-stage Docker build
βββ render.yaml # Render Blueprint config
βββ routes/ # API route modules (12 files)
βββ services/ # Business logic services (25 modules)
β βββ simulation/engine.py # Core simulation engine (1905 lines)
β βββ rl_decision_engine.py # DQN-based RL agent
β βββ multi_objective_optimizer.py # NSGA-II optimizer
β βββ blockchain_audit.py # Tamper-evident SHA-256 hash-chain audit ledger
β βββ google_cloud_integration.py # GCP services (Firebase, Pub/Sub, Vertex AI, BigQuery, FCM)
β βββ ...
βββ schemas/ # Pydantic schemas (17 files)
βββ middleware/ # Auth middleware (API key, Firebase)
βββ frontend/ # Admin dashboard (React + Vite)
β βββ src/components/views/ # 23 view components
β βββ src/i18n/ # Bilingual translations
βββ driver-app-main/ # Driver mobile app (React + Vite)
βββ tests/ # Backend tests (pytest)
- Demo Script β 5-7 minute walkthrough for judges
- Deployment Guide β Nginx, Docker, Render + cron-job.org
- GCP Free Tier Deploy β Cloud Run + Firebase Hosting
- Driver App Setup β Architecture and data flow
- Frontend Quick Start β Development reference
