DEV Community

Abhishek
Abhishek

Posted on

Navigatop

πŸ“– Overview

Navigato Platinum is a premium...

In a venue hosting 132,000 attendees, congestion and emergency response are critical life-safety challenges. Navigato solves this by aggregating real-time occupancy data and delivering strategic insights via an AI-Grounded Spatial Hub.


🧠 Approach and Logic

Large venues suffer from "Information Blackouts" during peak events. Navigato creates a Single Source of Truth across defined zones (Gates, Food Courts, Pavilions).

1. Strategic Decision Making

  • Status Derivation: Zone health (Clear, Moderate, Crowded, Critical) is dynamically calculated using a weighted threshold algorithm based on live capacity-to-density ratios.
  • Pathfinding (Dijkstra's Algorithm): Navigation routes are not just the shortest path; they are the fastest path. The edge weights in our Dijkstra implementation are adjusted in real-time based on the congestion ratio of each zone.
  • AI Context Grounding: The Gemini assistant is "Stitched" into the stadium's live telemetry. Every prompt is injected with the current JSON state of the venue, enabling hyper-accurate, real-time advice.

⚑ The Twin-Engineβ„’ Architecture

To achieve 100% startup stability on Google Cloud Run, Navigato utilizes a proprietary Twin-Engine boot sequence.

sequenceDiagram
    participant GCR as Google Cloud Run
    participant E1 as Engine 1 (Safe-Start)
    participant E2 as Engine 2 (Platinum Core)

    GCR->>E1: SIGINIT Launch
    E1->>E1: Bind Port 8080 (Instantly)
    Note over E1: Health Check Passed (2ms)
    E1->>E2: Modular Dynamic Import
    E2->>E2: Warm up AI Clusters & GCS Streams
    E2-->>E1: Core Synchronized
    Note over E1,E2: Platform 100% Operational
Enter fullscreen mode Exit fullscreen mode
  • Engine 1 (The Shield): A lightweight Node.js entrypoint that binds to the assigned PORT immediately to prevent timeout errors.
  • Engine 2 (The Intelligence): The modular Express 5.0 application logic, loaded after the port is stable.

πŸ“‚ Full Project Structure

β”œβ”€β”€ server/                 # PLATINUM BACKEND ENGINE
β”‚   β”œβ”€β”€ boot.ts             # Engine 1: Instant-bind bootstrapper
β”‚   β”œβ”€β”€ index.ts            # Engine 2: Modular app logic (Express 5)
β”‚   β”œβ”€β”€ routes/             # API Endpoints
β”‚   β”‚   β”œβ”€β”€ ai.ts           # Gemini 1.5 Flash Chat & Triage
β”‚   β”‚   └── incidents.ts    # GCS Visual Telemetry Pipeline
β”‚   β”œβ”€β”€ services/           # External Service Layer
β”‚   β”‚   β”œβ”€β”€ gemini.ts       # Google Gen AI SDK Integration
β”‚   β”‚   β”œβ”€β”€ storage.ts      # Cloud Storage Stream Engine
β”‚   β”‚   └── analytics.ts    # BigQuery & Event Logging
β”‚   └── middleware/         # Security & Auth
β”‚       └── auth.ts         # Firebase Admin Token Verification
β”œβ”€β”€ src/                    # ELITE FRONTEND HUB (React 19)
β”‚   β”œβ”€β”€ components/         # Premium Component Library
β”‚   β”‚   β”œβ”€β”€ attendee/       # ZoneMap, LiveHub, Dispatch
β”‚   β”‚   └── layout/         # Glassmorphism Framework
β”‚   β”œβ”€β”€ context/            # Global State (ZoneContext)
β”‚   β”œβ”€β”€ hooks/              # Custom Logic (useAuth)
β”‚   └── App.tsx             # Main System Entrypoint
β”œβ”€β”€ Dockerfile              # Multi-Stage Production Shield
β”œβ”€β”€ vite.config.js          # Advanced Rollup Code-Splitting
└── deploy.ps1              # One-Click Cloud Run Deployer
Enter fullscreen mode Exit fullscreen mode

πŸ› οΈ Google Services Integration

Service Integration Detail Location
Google Cloud Run Multi-stage container runtime with Twin-Engine boot. Dockerfile, boot.ts
Google Maps JS API Satellite imagery + Advanced Markers + Directions. ZoneMap.tsx
Gemini 1.5 Flash AI Chat Assistant & Visual Incident Triage. gemini.ts, ai.ts
Cloud Storage Visual telemetry streams for emergency dispatch. storage.ts
Firebase Admin Role-based custom claims & Token security. auth.ts
Google Cloud Logging Structured JSON logging for 100% observability. index.ts, boot.ts

πŸ—οΈ System Visualizations

1. The Intelligence Pipeline (AI Triage)

graph TD
    A[Attendee Report] -->|Satellite Telemetry| B(Google Cloud Storage)
    A -->|Contextual Description| C(Navigato AI)
    B --> C
    C -->|Gemini 1.5 Flash| D{Strategic Severity}
    D -->|HIGH| E[Emergency Staff Dispatch]
    D -->|LOW/MED| F[Operational Logging]
    E --> G(Cloud Pub/Sub Alert)
Enter fullscreen mode Exit fullscreen mode

2. The Platinum Cloud Stack

graph LR
    User[Attendee] -->|React 19| FE(Frontend Hub)
    FE -->|Vite 8 / ESM| BE(Platinum Core)
    BE -->|Twin-Engineβ„’ Boot| CR(Cloud Run)
    CR -->|Security| FA(Firebase Admin)
    CR -->|Spatial| GM(Google Maps)
    CR -->|Gen AI| AI(Gemini 1.5)
Enter fullscreen mode Exit fullscreen mode

πŸš€ Setup & Running locally

  1. Environment Setup: Add your VITE_GOOGLE_MAPS_API_KEY to the .env file.
  2. Install & Build:

    npm install
    npm run build
    
  3. Ignite the Platform:

    npm start
    

[!IMPORTANT]
Production Note: Navigato Platinum is optimized for the Narendra Modi Stadium geolocation. For local testing, use the "Force Sync" demo mode to bypass live GPS requirements.

Navigato Platinum β€’ Strategic Crowd Intelligence

Built by Abhishek for Promptwars.

Top comments (0)