# rashvandhappukutty/enginex architecture

> Architecture diagram of the GitHub repository rashvandhappukutty/enginex, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-10-09). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/rashvandhappukutty/enginex
- Repository: https://github.com/rashvandhappukutty/enginex

## Overview

EngineX is a campus emergency coordination and helpdesk system with a React interface and FastAPI backend. Its principal workflow is incident reporting, classification and risk assessment, followed by response recommendations, team coordination, and hazard-aware routing; users can also manage routine helpdesk requests and view operational metrics and notifications. The graph includes the documented AI reasoning stages and the frontend’s demo-state/API boundary. Source excerpts do not establish most router-to-service calls or frontend-to-backend transport, so those connections are omitted; README claims preserve the broader product capabilities.

Main entry points: [`ai/engine.py`](https://github.com/rashvandhappukutty/enginex/blob/main/ai/engine.py) (AI analysis engine), [`app/routers`](https://github.com/rashvandhappukutty/enginex/tree/main/app/routers) (API routers), [`src/App.tsx`](https://github.com/rashvandhappukutty/enginex/blob/main/src/App.tsx) (Application routes), [`app/services/classification_service.py`](https://github.com/rashvandhappukutty/enginex/blob/main/app/services/classification_service.py) (Classification service)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_frontend["Operations interface"]
  node_app["Application routes<br/>[App.tsx]"]
  node_pages["Operations pages"]
  node_state["Demo state<br/>[demoState.tsx]"]
  node_webapi["API client<br/>[api.ts]"]
end

subgraph group_backend["API and coordination"]
  node_server["FastAPI application<br/>[main.py]"]
  node_api_routes["API routers"]
  node_classification["Classification service"]
  node_coordination["Incident and response services"]
  node_ai_router["AI endpoint<br/>[ai.py]"]
  node_notifications["Live notifications"]
  node_metrics["Dashboard analytics<br/>[dashboard.py]"]
end

subgraph group_ai["AI decision support"]
  node_ai_engine["AI analysis engine<br/>[engine.py]"]
  node_classifier["Incident classification<br/>[classifier.py]"]
  node_risk["Risk assessment<br/>[risk_assessment.py]"]
  node_decision["Response planning"]
  node_evacuation["AI evacuation advice<br/>[evacuation.py]"]
  node_ai_schemas["AI result schemas<br/>[schemas.py]"]
end

subgraph group_data["Persistent state"]
  node_database[("SQL database<br/>[database.py]")]
  node_models["Domain records<br/>[models.py]"]
end

subgraph group_campus["Campus operations"]
  node_campus["Campus graph and hazards<br/>[campus.py]"]
  node_routing["Route computation<br/>[routing_service.py]"]
  node_helpdesk["Campus helpdesk"]
end

node_operator(("Campus operator"))
node_ai_service["Optional AI service"]

node_operator -->|"uses"| node_app
node_app -->|"routes to"| node_pages
node_app -->|"provides state"| node_state
node_state -->|"requests analysis"| node_webapi
node_server -->|"registers"| node_api_routes
node_server -->|"initializes"| node_database
node_database -->|"creates tables"| node_models
node_api_routes -->|"includes campus routes"| node_campus
node_api_routes -->|"includes dashboard routes"| node_metrics
node_api_routes -->|"includes AI routes"| node_ai_router
node_ai_router -->|"invokes analysis"| node_ai_engine
node_classification -->|"uses internal engine"| node_ai_engine
node_classification -.->|"tries HTTP classification"| node_ai_service
node_ai_engine -->|"classifies"| node_classifier
node_ai_engine -->|"assesses risk"| node_risk
node_ai_engine -->|"plans response"| node_decision
node_ai_engine -->|"recommends routes"| node_evacuation
node_ai_engine -->|"returns structured results"| node_ai_schemas
node_api_routes -->|"routes calculation"| node_routing
node_helpdesk -->|"classifies requests"| node_classification
node_coordination -->|"emits updates"| node_notifications

click node_app "https://github.com/rashvandhappukutty/enginex/blob/main/src/App.tsx"
click node_pages "https://github.com/rashvandhappukutty/enginex/tree/main/src/pages"
click node_state "https://github.com/rashvandhappukutty/enginex/blob/main/src/store/demoState.tsx"
click node_webapi "https://github.com/rashvandhappukutty/enginex/blob/main/src/services/api.ts"
click node_server "https://github.com/rashvandhappukutty/enginex/blob/main/app/main.py"
click node_api_routes "https://github.com/rashvandhappukutty/enginex/tree/main/app/routers"
click node_classification "https://github.com/rashvandhappukutty/enginex/blob/main/app/services/classification_service.py"
click node_coordination "https://github.com/rashvandhappukutty/enginex/tree/main/app/services"
click node_database "https://github.com/rashvandhappukutty/enginex/blob/main/app/db/database.py"
click node_models "https://github.com/rashvandhappukutty/enginex/blob/main/app/db/models.py"
click node_ai_router "https://github.com/rashvandhappukutty/enginex/blob/main/app/routers/ai.py"
click node_ai_engine "https://github.com/rashvandhappukutty/enginex/blob/main/ai/engine.py"
click node_classifier "https://github.com/rashvandhappukutty/enginex/blob/main/ai/classifier.py"
click node_risk "https://github.com/rashvandhappukutty/enginex/blob/main/ai/risk_assessment.py"
click node_decision "https://github.com/rashvandhappukutty/enginex/blob/main/ai/decision_support.py"
click node_evacuation "https://github.com/rashvandhappukutty/enginex/blob/main/ai/evacuation.py"
click node_ai_schemas "https://github.com/rashvandhappukutty/enginex/blob/main/ai/schemas.py"
click node_campus "https://github.com/rashvandhappukutty/enginex/blob/main/app/routers/campus.py"
click node_routing "https://github.com/rashvandhappukutty/enginex/blob/main/app/services/routing_service.py"
click node_helpdesk "https://github.com/rashvandhappukutty/enginex/blob/main/app/services/helpdesk_service.py"
click node_notifications "https://github.com/rashvandhappukutty/enginex/blob/main/app/services/notification_service.py"
click node_metrics "https://github.com/rashvandhappukutty/enginex/blob/main/app/routers/dashboard.py"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_app,node_pages,node_state,node_webapi toneBlue
class node_server,node_api_routes,node_classification,node_coordination,node_ai_router,node_notifications,node_metrics toneAmber
class node_ai_engine,node_classifier,node_risk,node_decision,node_evacuation,node_ai_schemas toneMint
class node_database,node_models toneRose
class node_campus,node_routing,node_helpdesk,node_operator,node_ai_service toneIndigo
```

## Components

### Operations interface

- [Application routes](https://github.com/rashvandhappukutty/enginex/blob/main/src/App.tsx): `src/App.tsx`
- [Operations pages](https://github.com/rashvandhappukutty/enginex/tree/main/src/pages): `src/pages`
- [Demo state](https://github.com/rashvandhappukutty/enginex/blob/main/src/store/demoState.tsx): `src/store/demoState.tsx`
- [API client](https://github.com/rashvandhappukutty/enginex/blob/main/src/services/api.ts): `src/services/api.ts`

### API and coordination

- [FastAPI application](https://github.com/rashvandhappukutty/enginex/blob/main/app/main.py): `app/main.py`
- [API routers](https://github.com/rashvandhappukutty/enginex/tree/main/app/routers): `app/routers`
- [Classification service](https://github.com/rashvandhappukutty/enginex/blob/main/app/services/classification_service.py): `app/services/classification_service.py`
- [Incident and response services](https://github.com/rashvandhappukutty/enginex/tree/main/app/services): `app/services`
- [AI endpoint](https://github.com/rashvandhappukutty/enginex/blob/main/app/routers/ai.py): `app/routers/ai.py`
- [Live notifications](https://github.com/rashvandhappukutty/enginex/blob/main/app/services/notification_service.py): `app/services/notification_service.py`
- [Dashboard analytics](https://github.com/rashvandhappukutty/enginex/blob/main/app/routers/dashboard.py): `app/routers/dashboard.py`

### AI decision support

- [AI analysis engine](https://github.com/rashvandhappukutty/enginex/blob/main/ai/engine.py): `ai/engine.py`
- [Incident classification](https://github.com/rashvandhappukutty/enginex/blob/main/ai/classifier.py): `ai/classifier.py`
- [Risk assessment](https://github.com/rashvandhappukutty/enginex/blob/main/ai/risk_assessment.py): `ai/risk_assessment.py`
- [Response planning](https://github.com/rashvandhappukutty/enginex/blob/main/ai/decision_support.py): `ai/decision_support.py`
- [AI evacuation advice](https://github.com/rashvandhappukutty/enginex/blob/main/ai/evacuation.py): `ai/evacuation.py`
- [AI result schemas](https://github.com/rashvandhappukutty/enginex/blob/main/ai/schemas.py): `ai/schemas.py`

### Persistent state

- [SQL database](https://github.com/rashvandhappukutty/enginex/blob/main/app/db/database.py): `app/db/database.py`
- [Domain records](https://github.com/rashvandhappukutty/enginex/blob/main/app/db/models.py): `app/db/models.py`

### Campus operations

- [Campus graph and hazards](https://github.com/rashvandhappukutty/enginex/blob/main/app/routers/campus.py): `app/routers/campus.py`
- [Route computation](https://github.com/rashvandhappukutty/enginex/blob/main/app/services/routing_service.py): `app/services/routing_service.py`
- [Campus helpdesk](https://github.com/rashvandhappukutty/enginex/blob/main/app/services/helpdesk_service.py): `app/services/helpdesk_service.py`

### Other components

- **Campus operator**
- **Optional AI service**

## Connections

- Campus operator → Application routes: uses (evidence: `src/App.tsx`)
- Application routes → Operations pages: routes to (evidence: `src/App.tsx`)
- Application routes → Demo state: provides state (evidence: `src/App.tsx`)
- Demo state → API client: requests analysis (evidence: `src/store/demoState.tsx`)
- FastAPI application → API routers: registers (evidence: `app/main.py`)
- FastAPI application → SQL database: initializes (evidence: `app/main.py`)
- SQL database → Domain records: creates tables (evidence: `app/db/models.py`)
- API routers → Campus graph and hazards: includes campus routes (evidence: `app/main.py`)
- API routers → Dashboard analytics: includes dashboard routes (evidence: `app/main.py`)
- API routers → AI endpoint: includes AI routes (evidence: `app/main.py`)
- AI endpoint → AI analysis engine: invokes analysis (evidence: `app/routers/ai.py`)
- Classification service → AI analysis engine: uses internal engine (evidence: `app/services/classification_service.py`)
- Classification service → Optional AI service: tries HTTP classification (evidence: `app/services/classification_service.py`)
- AI analysis engine → Incident classification: classifies (evidence: `ai/engine.py`)
- AI analysis engine → Risk assessment: assesses risk (evidence: `ai/engine.py`)
- AI analysis engine → Response planning: plans response (evidence: `ai/engine.py`)
- AI analysis engine → AI evacuation advice: recommends routes (evidence: `ai/engine.py`)
- AI analysis engine → AI result schemas: returns structured results (evidence: `ai/schemas.py`)
- API routers → Route computation: routes calculation (evidence: `app/routers/routing.py`)
- Campus helpdesk → Classification service: classifies requests (evidence: `app/services/helpdesk_service.py`)
- Incident and response services → Live notifications: emits updates (evidence: `app/services/assignment_service.py`)
