# shreyanshtripathi/businessmeetstechhackathon architecture

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

- Interactive diagram: https://gitdiagram.com/shreyanshtripathi/businessmeetstechhackathon
- Repository: https://github.com/shreyanshtripathi/businessmeetstechhackathon

## Overview

NERV is a factory-shift intelligence product: simulated plant activity and specialized staffing, assembly, and safety signals are fused into ranked incidents and actionable recommendations for human supervisors. The backend also exposes forecasts, emergency response, vision review, oversight, what-if checks, and shift handover; the dashboard presents live decisions and supporting operational views. The graph reflects documented and indexed calls only; several API and UI branches are included from README capabilities, with uncertain internal links omitted.

Main entry points: [`src/lib/live.tsx`](https://github.com/shreyanshtripathi/businessmeetstechhackathon/blob/main/src/lib/live.tsx) (Live Client), [`backend/shiftloop/api/app.py`](https://github.com/shreyanshtripathi/businessmeetstechhackathon/blob/main/backend/shiftloop/api/app.py) (REST & WebSocket API), [`backend/shiftloop/plant.py`](https://github.com/shreyanshtripathi/businessmeetstechhackathon/blob/main/backend/shiftloop/plant.py) (Shift Plant), [`src/routes/index.tsx`](https://github.com/shreyanshtripathi/businessmeetstechhackathon/blob/main/src/routes/index.tsx) (Dashboard Views)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_plant["Factory Runtime"]
  node_plant["Shift Plant<br/>[plant.py]"]
  node_simulator["Shift Simulator<br/>[shift.py]"]
  node_state[("Factory State<br/>[state.py]")]
  node_domain["Factory Domain<br/>[models.py]"]
  node_vision["Camera Detection<br/>[service.py]"]
end

subgraph group_intelligence["Intelligence &amp; Models"]
  node_agents["Specialist Agents"]
  node_central["Incident Intelligence<br/>[engine.py]"]
  node_recommend["Action Recommendations<br/>[recommend.py]"]
  node_matching["Staff Matching<br/>[matching.py]"]
  node_ml_bridge["ML Forecast Bridge<br/>[ml_bridge.py]"]
  node_ml_predict["Forest Predictions<br/>[predict.py]"]
end

subgraph group_operations["Supervisor Operations"]
  node_backend["REST &amp; WebSocket API<br/>[app.py]"]
  node_oversight["Decision Oversight<br/>[oversight.py]"]
  node_whatif["Staffing What-if<br/>[whatif.py]"]
  node_llm_chat["Copilot Service<br/>[chat.py]"]
  node_handover["Shift Handover<br/>[handover.py]"]
end

subgraph group_dashboard["Supervisor Dashboard"]
  node_dashboard["Dashboard Views<br/>[index.tsx]"]
  node_live["Live Client<br/>[live.tsx]"]
  node_api_client["API Client<br/>[api.ts]"]
  node_people_ui["People &amp; What-if<br/>[people.tsx]"]
  node_line_ui["Line View<br/>[line.tsx]"]
  node_oversight_ui["Oversight View<br/>[oversight.tsx]"]
  node_alerts_ui["Alerts View<br/>[alerts.tsx]"]
  node_handover_ui["Handover View<br/>[handover.tsx]"]
  node_decision_card["Decision Controls<br/>[DecisionCard.tsx]"]
  node_copilot_ui["Chat Copilot<br/>[Copilot.tsx]"]
end

node_supervisor(("Supervisor"))
node_claude{{"Claude API"}}

node_supervisor -->|"reviews decisions"| node_dashboard
node_dashboard -->|"reads live state"| node_live
node_decision_card -->|"submits actions"| node_live
node_people_ui -->|"reads staffing"| node_live
node_line_ui -->|"reads line state"| node_live
node_oversight_ui -->|"reads records"| node_live
node_live -->|"fetches &amp; polls"| node_api_client
node_api_client -->|"calls REST"| node_backend
node_backend -->|"advances shift"| node_plant
node_backend -->|"routes camera input"| node_vision
node_plant -->|"steps scenario"| node_simulator
node_plant -->|"updates state"| node_state
node_simulator -->|"reads &amp; advances"| node_state
node_plant -->|"runs agents"| node_agents
node_plant -->|"ingests events"| node_central
node_central -->|"builds actions"| node_recommend
node_recommend -->|"matches workers"| node_matching
node_plant -->|"gets forecasts"| node_ml_bridge
node_ml_bridge -->|"requests predictions"| node_ml_predict
node_vision -->|"records detections"| node_plant
node_backend -->|"serves oversight"| node_oversight
node_backend -->|"serves checks"| node_whatif
node_backend -->|"routes chat"| node_llm_chat
node_backend -->|"routes handover"| node_handover
node_llm_chat -.->|"requests answers"| node_claude
node_handover -.->|"requests summary"| node_claude
node_copilot_ui -.->|"uses live client"| node_live
node_alerts_ui -.->|"uses live client"| node_live
node_handover_ui -.->|"uses live client"| node_live
node_dashboard -->|"renders cards"| node_decision_card
node_dashboard -->|"renders copilot"| node_copilot_ui

click node_dashboard "https://github.com/shreyanshtripathi/businessmeetstechhackathon/blob/main/src/routes/index.tsx"
click node_live "https://github.com/shreyanshtripathi/businessmeetstechhackathon/blob/main/src/lib/live.tsx"
click node_api_client "https://github.com/shreyanshtripathi/businessmeetstechhackathon/blob/main/src/lib/api.ts"
click node_people_ui "https://github.com/shreyanshtripathi/businessmeetstechhackathon/blob/main/src/routes/people.tsx"
click node_line_ui "https://github.com/shreyanshtripathi/businessmeetstechhackathon/blob/main/src/routes/line.tsx"
click node_oversight_ui "https://github.com/shreyanshtripathi/businessmeetstechhackathon/blob/main/src/routes/oversight.tsx"
click node_alerts_ui "https://github.com/shreyanshtripathi/businessmeetstechhackathon/blob/main/src/routes/alerts.tsx"
click node_handover_ui "https://github.com/shreyanshtripathi/businessmeetstechhackathon/blob/main/src/routes/handover.tsx"
click node_decision_card "https://github.com/shreyanshtripathi/businessmeetstechhackathon/blob/main/src/components/sl/DecisionCard.tsx"
click node_copilot_ui "https://github.com/shreyanshtripathi/businessmeetstechhackathon/blob/main/src/components/sl/Copilot.tsx"
click node_backend "https://github.com/shreyanshtripathi/businessmeetstechhackathon/blob/main/backend/shiftloop/api/app.py"
click node_plant "https://github.com/shreyanshtripathi/businessmeetstechhackathon/blob/main/backend/shiftloop/plant.py"
click node_simulator "https://github.com/shreyanshtripathi/businessmeetstechhackathon/blob/main/backend/shiftloop/simulator/shift.py"
click node_state "https://github.com/shreyanshtripathi/businessmeetstechhackathon/blob/main/backend/shiftloop/state.py"
click node_domain "https://github.com/shreyanshtripathi/businessmeetstechhackathon/blob/main/backend/shiftloop/models.py"
click node_agents "https://github.com/shreyanshtripathi/businessmeetstechhackathon/tree/main/backend/shiftloop/agents"
click node_central "https://github.com/shreyanshtripathi/businessmeetstechhackathon/blob/main/backend/shiftloop/central/engine.py"
click node_recommend "https://github.com/shreyanshtripathi/businessmeetstechhackathon/blob/main/backend/shiftloop/central/recommend.py"
click node_matching "https://github.com/shreyanshtripathi/businessmeetstechhackathon/blob/main/backend/shiftloop/matching.py"
click node_ml_bridge "https://github.com/shreyanshtripathi/businessmeetstechhackathon/blob/main/backend/shiftloop/ml_bridge.py"
click node_ml_predict "https://github.com/shreyanshtripathi/businessmeetstechhackathon/blob/main/ml/predict.py"
click node_vision "https://github.com/shreyanshtripathi/businessmeetstechhackathon/blob/main/backend/shiftloop/vision/service.py"
click node_oversight "https://github.com/shreyanshtripathi/businessmeetstechhackathon/blob/main/backend/shiftloop/oversight.py"
click node_whatif "https://github.com/shreyanshtripathi/businessmeetstechhackathon/blob/main/backend/shiftloop/whatif.py"
click node_llm_chat "https://github.com/shreyanshtripathi/businessmeetstechhackathon/blob/main/backend/shiftloop/llm/chat.py"
click node_handover "https://github.com/shreyanshtripathi/businessmeetstechhackathon/blob/main/backend/shiftloop/llm/handover.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_plant,node_simulator,node_state,node_domain,node_vision toneBlue
class node_agents,node_central,node_recommend,node_matching,node_ml_bridge,node_ml_predict toneAmber
class node_backend,node_oversight,node_whatif,node_llm_chat,node_handover,node_claude toneMint
class node_dashboard,node_live,node_api_client,node_people_ui,node_line_ui,node_oversight_ui,node_alerts_ui,node_handover_ui,node_decision_card,node_copilot_ui toneRose
class node_supervisor toneIndigo
```

## Components

### Factory Runtime

- [Shift Plant](https://github.com/shreyanshtripathi/businessmeetstechhackathon/blob/main/backend/shiftloop/plant.py): `backend/shiftloop/plant.py`
- [Shift Simulator](https://github.com/shreyanshtripathi/businessmeetstechhackathon/blob/main/backend/shiftloop/simulator/shift.py): `backend/shiftloop/simulator/shift.py`
- [Factory State](https://github.com/shreyanshtripathi/businessmeetstechhackathon/blob/main/backend/shiftloop/state.py): `backend/shiftloop/state.py`
- [Factory Domain](https://github.com/shreyanshtripathi/businessmeetstechhackathon/blob/main/backend/shiftloop/models.py): `backend/shiftloop/models.py`
- [Camera Detection](https://github.com/shreyanshtripathi/businessmeetstechhackathon/blob/main/backend/shiftloop/vision/service.py): `backend/shiftloop/vision/service.py`

### Intelligence & Models

- [Specialist Agents](https://github.com/shreyanshtripathi/businessmeetstechhackathon/tree/main/backend/shiftloop/agents): `backend/shiftloop/agents`
- [Incident Intelligence](https://github.com/shreyanshtripathi/businessmeetstechhackathon/blob/main/backend/shiftloop/central/engine.py): `backend/shiftloop/central/engine.py`
- [Action Recommendations](https://github.com/shreyanshtripathi/businessmeetstechhackathon/blob/main/backend/shiftloop/central/recommend.py): `backend/shiftloop/central/recommend.py`
- [Staff Matching](https://github.com/shreyanshtripathi/businessmeetstechhackathon/blob/main/backend/shiftloop/matching.py): `backend/shiftloop/matching.py`
- [ML Forecast Bridge](https://github.com/shreyanshtripathi/businessmeetstechhackathon/blob/main/backend/shiftloop/ml_bridge.py): `backend/shiftloop/ml_bridge.py`
- [Forest Predictions](https://github.com/shreyanshtripathi/businessmeetstechhackathon/blob/main/ml/predict.py): `ml/predict.py`

### Supervisor Operations

- [REST & WebSocket API](https://github.com/shreyanshtripathi/businessmeetstechhackathon/blob/main/backend/shiftloop/api/app.py): `backend/shiftloop/api/app.py`
- [Decision Oversight](https://github.com/shreyanshtripathi/businessmeetstechhackathon/blob/main/backend/shiftloop/oversight.py): `backend/shiftloop/oversight.py`
- [Staffing What-if](https://github.com/shreyanshtripathi/businessmeetstechhackathon/blob/main/backend/shiftloop/whatif.py): `backend/shiftloop/whatif.py`
- [Copilot Service](https://github.com/shreyanshtripathi/businessmeetstechhackathon/blob/main/backend/shiftloop/llm/chat.py): `backend/shiftloop/llm/chat.py`
- [Shift Handover](https://github.com/shreyanshtripathi/businessmeetstechhackathon/blob/main/backend/shiftloop/llm/handover.py): `backend/shiftloop/llm/handover.py`

### Supervisor Dashboard

- [Dashboard Views](https://github.com/shreyanshtripathi/businessmeetstechhackathon/blob/main/src/routes/index.tsx): `src/routes/index.tsx`
- [Live Client](https://github.com/shreyanshtripathi/businessmeetstechhackathon/blob/main/src/lib/live.tsx): `src/lib/live.tsx`
- [API Client](https://github.com/shreyanshtripathi/businessmeetstechhackathon/blob/main/src/lib/api.ts): `src/lib/api.ts`
- [People & What-if](https://github.com/shreyanshtripathi/businessmeetstechhackathon/blob/main/src/routes/people.tsx): `src/routes/people.tsx`
- [Line View](https://github.com/shreyanshtripathi/businessmeetstechhackathon/blob/main/src/routes/line.tsx): `src/routes/line.tsx`
- [Oversight View](https://github.com/shreyanshtripathi/businessmeetstechhackathon/blob/main/src/routes/oversight.tsx): `src/routes/oversight.tsx`
- [Alerts View](https://github.com/shreyanshtripathi/businessmeetstechhackathon/blob/main/src/routes/alerts.tsx): `src/routes/alerts.tsx`
- [Handover View](https://github.com/shreyanshtripathi/businessmeetstechhackathon/blob/main/src/routes/handover.tsx): `src/routes/handover.tsx`
- [Decision Controls](https://github.com/shreyanshtripathi/businessmeetstechhackathon/blob/main/src/components/sl/DecisionCard.tsx): `src/components/sl/DecisionCard.tsx`
- [Chat Copilot](https://github.com/shreyanshtripathi/businessmeetstechhackathon/blob/main/src/components/sl/Copilot.tsx): `src/components/sl/Copilot.tsx`

### Other components

- **Supervisor**
- **Claude API**

## Connections

- Supervisor → Dashboard Views: reviews decisions (evidence: `src/routes/index.tsx`)
- Dashboard Views → Live Client: reads live state (evidence: `src/routes/index.tsx`)
- Decision Controls → Live Client: submits actions (evidence: `src/components/sl/DecisionCard.tsx`)
- People & What-if → Live Client: reads staffing (evidence: `src/routes/people.tsx`)
- Line View → Live Client: reads line state (evidence: `src/routes/line.tsx`)
- Oversight View → Live Client: reads records (evidence: `src/routes/oversight.tsx`)
- Live Client → API Client: fetches & polls (evidence: `src/lib/live.tsx`)
- API Client → REST & WebSocket API: calls REST (evidence: `src/lib/api.ts`)
- REST & WebSocket API → Shift Plant: advances shift (evidence: `backend/shiftloop/api/app.py`)
- REST & WebSocket API → Camera Detection: routes camera input (evidence: `backend/shiftloop/api/app.py`)
- Shift Plant → Shift Simulator: steps scenario (evidence: `backend/shiftloop/plant.py`)
- Shift Plant → Factory State: updates state (evidence: `backend/shiftloop/plant.py`)
- Shift Simulator → Factory State: reads & advances (evidence: `backend/shiftloop/simulator/shift.py`)
- Shift Plant → Specialist Agents: runs agents (evidence: `backend/shiftloop/plant.py`)
- Shift Plant → Incident Intelligence: ingests events (evidence: `backend/shiftloop/plant.py`)
- Incident Intelligence → Action Recommendations: builds actions (evidence: `backend/shiftloop/central/engine.py`)
- Action Recommendations → Staff Matching: matches workers (evidence: `backend/shiftloop/central/recommend.py`)
- Shift Plant → ML Forecast Bridge: gets forecasts (evidence: `backend/shiftloop/plant.py`)
- ML Forecast Bridge → Forest Predictions: requests predictions (evidence: `backend/shiftloop/ml_bridge.py`)
- Camera Detection → Shift Plant: records detections (evidence: `backend/shiftloop/vision/service.py`)
- REST & WebSocket API → Decision Oversight: serves oversight (evidence: `backend/shiftloop/api/app.py`)
- REST & WebSocket API → Staffing What-if: serves checks (evidence: `backend/shiftloop/api/app.py`)
- REST & WebSocket API → Copilot Service: routes chat (evidence: `backend/shiftloop/api/app.py`)
- REST & WebSocket API → Shift Handover: routes handover (evidence: `backend/shiftloop/api/app.py`)
- Copilot Service → Claude API: requests answers
- Shift Handover → Claude API: requests summary
- Chat Copilot → Live Client: uses live client
- Alerts View → Live Client: uses live client
- Handover View → Live Client: uses live client
- Dashboard Views → Decision Controls: renders cards (evidence: `src/routes/index.tsx`)
- Dashboard Views → Chat Copilot: renders copilot
