# bhaktisharma23/ksit_hackathon architecture

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

- Interactive diagram: https://gitdiagram.com/bhaktisharma23/ksit_hackathon
- Repository: https://github.com/bhaktisharma23/ksit_hackathon

## Overview

This repository combines a smoke-and-fire detection dashboard, a FastAPI backend, and model-development scripts. The intended user workflow includes uploading a video, starting analysis, and reviewing detection results; the sampled frontend code confirms upload, analysis polling, and results fetching services, while backend processing details are not fully sampled. The README provides no additional capability documentation, so uncertain service wiring is omitted.

Main entry points: [`frontend/smoke-fire-dashboard/src/routes/AppRoutes.tsx`](https://github.com/bhaktisharma23/ksit_hackathon/blob/main/frontend/smoke-fire-dashboard/src/routes/AppRoutes.tsx) (Page routes), [`backend/app.py`](https://github.com/bhaktisharma23/ksit_hackathon/blob/main/backend/app.py) (FastAPI app), [`frontend/smoke-fire-dashboard/src/services/videoService.ts`](https://github.com/bhaktisharma23/ksit_hackathon/blob/main/frontend/smoke-fire-dashboard/src/services/videoService.ts) (Video API service), [`frontend/smoke-fire-dashboard/src/services/api.ts`](https://github.com/bhaktisharma23/ksit_hackathon/blob/main/frontend/smoke-fire-dashboard/src/services/api.ts) (HTTP client)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_dashboard["Dashboard"]
  node_routes["Page routes<br/>[AppRoutes.tsx]"]
  node_video_page["Video analysis<br/>[VideoAnalysis.tsx]"]
  node_monitor_page["Live monitoring"]
  node_dashboard_page["Overview<br/>[Dashboard.tsx]"]
  node_alerts_page["Alert logs<br/>[AlertLogs.tsx]"]
  node_history_page["History<br/>[History.tsx]"]
  node_models_page["AI models<br/>[AIModels.tsx]"]
  node_settings_page["Settings<br/>[Settings.tsx]"]
  node_upload_hook["Upload state<br/>[useUpload.ts]"]
  node_analysis_hook["Analysis polling"]
  node_results_hook["Detection results"]
  node_video_service["Video API service<br/>[videoService.ts]"]
  node_detection_service["Detection service"]
  node_realtime_service["Realtime stream<br/>[realtimeService.ts]"]
  node_alert_service["Alert service<br/>[alertService.ts]"]
  node_api_client["HTTP client<br/>[api.ts]"]
end

subgraph group_api["Backend API"]
  node_backend_app["FastAPI app<br/>[app.py]"]
  node_upload_route["Upload endpoint<br/>[upload.py]"]
  node_detection_route["Detection endpoint<br/>[detection.py]"]
  node_results_route["Results endpoint<br/>[results.py]"]
end

subgraph group_pipeline["Detection Pipeline"]
  node_detection_service_backend["Detection service<br/>[detection.py]"]
  node_video_processor["Video processing<br/>[video_processor.py]"]
  node_inference["Frame inference<br/>[inference.py]"]
  node_postprocessing["Postprocessing<br/>[postprocessing.py]"]
  node_metrics["Detection metrics<br/>[metrics.py]"]
  node_video_utils["Video utilities<br/>[video_utils.py]"]
  node_file_utils["File utilities<br/>[file_utils.py]"]
end

subgraph group_ml["Model Development"]
  node_train["Train model<br/>[train.py]"]
  node_predict["Model prediction<br/>[predict.py]"]
  node_validate["Validate model<br/>[validate.py]"]
  node_export["Export model<br/>[export_best.py]"]
end

node_user(("Dashboard user"))

node_user -->|"navigates"| node_routes
node_routes -->|"routes to"| node_video_page
node_routes -->|"routes to"| node_monitor_page
node_routes -->|"routes to"| node_dashboard_page
node_routes -->|"routes to"| node_alerts_page
node_routes -->|"routes to"| node_history_page
node_routes -->|"routes to"| node_models_page
node_routes -->|"routes to"| node_settings_page
node_upload_hook -->|"calls"| node_video_service
node_analysis_hook -->|"calls"| node_video_service
node_results_hook -->|"calls"| node_detection_service
node_video_service -->|"sends requests"| node_api_client
node_alert_service -->|"sends requests"| node_api_client
node_backend_app -->|"mounts"| node_upload_route
node_backend_app -->|"mounts"| node_detection_route
node_backend_app -->|"mounts"| node_results_route
node_inference --> node_user

click node_routes "https://github.com/bhaktisharma23/ksit_hackathon/blob/main/frontend/smoke-fire-dashboard/src/routes/AppRoutes.tsx"
click node_video_page "https://github.com/bhaktisharma23/ksit_hackathon/blob/main/frontend/smoke-fire-dashboard/src/pages/VideoAnalysis.tsx"
click node_monitor_page "https://github.com/bhaktisharma23/ksit_hackathon/blob/main/frontend/smoke-fire-dashboard/src/pages/RealTimeMonitoring.tsx"
click node_dashboard_page "https://github.com/bhaktisharma23/ksit_hackathon/blob/main/frontend/smoke-fire-dashboard/src/pages/Dashboard.tsx"
click node_alerts_page "https://github.com/bhaktisharma23/ksit_hackathon/blob/main/frontend/smoke-fire-dashboard/src/pages/AlertLogs.tsx"
click node_history_page "https://github.com/bhaktisharma23/ksit_hackathon/blob/main/frontend/smoke-fire-dashboard/src/pages/History.tsx"
click node_models_page "https://github.com/bhaktisharma23/ksit_hackathon/blob/main/frontend/smoke-fire-dashboard/src/pages/AIModels.tsx"
click node_settings_page "https://github.com/bhaktisharma23/ksit_hackathon/blob/main/frontend/smoke-fire-dashboard/src/pages/Settings.tsx"
click node_upload_hook "https://github.com/bhaktisharma23/ksit_hackathon/blob/main/frontend/smoke-fire-dashboard/src/hooks/useUpload.ts"
click node_analysis_hook "https://github.com/bhaktisharma23/ksit_hackathon/blob/main/frontend/smoke-fire-dashboard/src/hooks/useVideoAnalysis.ts"
click node_results_hook "https://github.com/bhaktisharma23/ksit_hackathon/blob/main/frontend/smoke-fire-dashboard/src/hooks/useDetectionResults.ts"
click node_video_service "https://github.com/bhaktisharma23/ksit_hackathon/blob/main/frontend/smoke-fire-dashboard/src/services/videoService.ts"
click node_detection_service "https://github.com/bhaktisharma23/ksit_hackathon/blob/main/frontend/smoke-fire-dashboard/src/services/detectionService.ts"
click node_realtime_service "https://github.com/bhaktisharma23/ksit_hackathon/blob/main/frontend/smoke-fire-dashboard/src/services/realtimeService.ts"
click node_alert_service "https://github.com/bhaktisharma23/ksit_hackathon/blob/main/frontend/smoke-fire-dashboard/src/services/alertService.ts"
click node_api_client "https://github.com/bhaktisharma23/ksit_hackathon/blob/main/frontend/smoke-fire-dashboard/src/services/api.ts"
click node_backend_app "https://github.com/bhaktisharma23/ksit_hackathon/blob/main/backend/app.py"
click node_upload_route "https://github.com/bhaktisharma23/ksit_hackathon/blob/main/backend/routes/upload.py"
click node_detection_route "https://github.com/bhaktisharma23/ksit_hackathon/blob/main/backend/routes/detection.py"
click node_results_route "https://github.com/bhaktisharma23/ksit_hackathon/blob/main/backend/routes/results.py"
click node_detection_service_backend "https://github.com/bhaktisharma23/ksit_hackathon/blob/main/backend/services/detection.py"
click node_video_processor "https://github.com/bhaktisharma23/ksit_hackathon/blob/main/backend/services/video_processor.py"
click node_inference "https://github.com/bhaktisharma23/ksit_hackathon/blob/main/backend/services/inference.py"
click node_postprocessing "https://github.com/bhaktisharma23/ksit_hackathon/blob/main/backend/services/postprocessing.py"
click node_metrics "https://github.com/bhaktisharma23/ksit_hackathon/blob/main/backend/services/metrics.py"
click node_video_utils "https://github.com/bhaktisharma23/ksit_hackathon/blob/main/backend/utils/video_utils.py"
click node_file_utils "https://github.com/bhaktisharma23/ksit_hackathon/blob/main/backend/utils/file_utils.py"
click node_train "https://github.com/bhaktisharma23/ksit_hackathon/blob/main/ml/train.py"
click node_predict "https://github.com/bhaktisharma23/ksit_hackathon/blob/main/ml/predict.py"
click node_validate "https://github.com/bhaktisharma23/ksit_hackathon/blob/main/ml/validate.py"
click node_export "https://github.com/bhaktisharma23/ksit_hackathon/blob/main/ml/export_best.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_routes,node_video_page,node_monitor_page,node_dashboard_page,node_alerts_page,node_history_page,node_models_page,node_settings_page,node_upload_hook,node_analysis_hook,node_results_hook,node_video_service,node_detection_service,node_realtime_service,node_alert_service,node_api_client,node_user toneBlue
class node_backend_app,node_upload_route,node_detection_route,node_results_route toneAmber
class node_detection_service_backend,node_video_processor,node_inference,node_postprocessing,node_metrics,node_video_utils,node_file_utils toneMint
class node_train,node_predict,node_validate,node_export toneRose
```

## Components

### Dashboard

- [Page routes](https://github.com/bhaktisharma23/ksit_hackathon/blob/main/frontend/smoke-fire-dashboard/src/routes/AppRoutes.tsx): `frontend/smoke-fire-dashboard/src/routes/AppRoutes.tsx`
- [Video analysis](https://github.com/bhaktisharma23/ksit_hackathon/blob/main/frontend/smoke-fire-dashboard/src/pages/VideoAnalysis.tsx): `frontend/smoke-fire-dashboard/src/pages/VideoAnalysis.tsx`
- [Live monitoring](https://github.com/bhaktisharma23/ksit_hackathon/blob/main/frontend/smoke-fire-dashboard/src/pages/RealTimeMonitoring.tsx): `frontend/smoke-fire-dashboard/src/pages/RealTimeMonitoring.tsx`
- [Overview](https://github.com/bhaktisharma23/ksit_hackathon/blob/main/frontend/smoke-fire-dashboard/src/pages/Dashboard.tsx): `frontend/smoke-fire-dashboard/src/pages/Dashboard.tsx`
- [Alert logs](https://github.com/bhaktisharma23/ksit_hackathon/blob/main/frontend/smoke-fire-dashboard/src/pages/AlertLogs.tsx): `frontend/smoke-fire-dashboard/src/pages/AlertLogs.tsx`
- [History](https://github.com/bhaktisharma23/ksit_hackathon/blob/main/frontend/smoke-fire-dashboard/src/pages/History.tsx): `frontend/smoke-fire-dashboard/src/pages/History.tsx`
- [AI models](https://github.com/bhaktisharma23/ksit_hackathon/blob/main/frontend/smoke-fire-dashboard/src/pages/AIModels.tsx): `frontend/smoke-fire-dashboard/src/pages/AIModels.tsx`
- [Settings](https://github.com/bhaktisharma23/ksit_hackathon/blob/main/frontend/smoke-fire-dashboard/src/pages/Settings.tsx): `frontend/smoke-fire-dashboard/src/pages/Settings.tsx`
- [Upload state](https://github.com/bhaktisharma23/ksit_hackathon/blob/main/frontend/smoke-fire-dashboard/src/hooks/useUpload.ts): `frontend/smoke-fire-dashboard/src/hooks/useUpload.ts`
- [Analysis polling](https://github.com/bhaktisharma23/ksit_hackathon/blob/main/frontend/smoke-fire-dashboard/src/hooks/useVideoAnalysis.ts): `frontend/smoke-fire-dashboard/src/hooks/useVideoAnalysis.ts`
- [Detection results](https://github.com/bhaktisharma23/ksit_hackathon/blob/main/frontend/smoke-fire-dashboard/src/hooks/useDetectionResults.ts): `frontend/smoke-fire-dashboard/src/hooks/useDetectionResults.ts`
- [Video API service](https://github.com/bhaktisharma23/ksit_hackathon/blob/main/frontend/smoke-fire-dashboard/src/services/videoService.ts): `frontend/smoke-fire-dashboard/src/services/videoService.ts`
- [Detection service](https://github.com/bhaktisharma23/ksit_hackathon/blob/main/frontend/smoke-fire-dashboard/src/services/detectionService.ts): `frontend/smoke-fire-dashboard/src/services/detectionService.ts`
- [Realtime stream](https://github.com/bhaktisharma23/ksit_hackathon/blob/main/frontend/smoke-fire-dashboard/src/services/realtimeService.ts): `frontend/smoke-fire-dashboard/src/services/realtimeService.ts`
- [Alert service](https://github.com/bhaktisharma23/ksit_hackathon/blob/main/frontend/smoke-fire-dashboard/src/services/alertService.ts): `frontend/smoke-fire-dashboard/src/services/alertService.ts`
- [HTTP client](https://github.com/bhaktisharma23/ksit_hackathon/blob/main/frontend/smoke-fire-dashboard/src/services/api.ts): `frontend/smoke-fire-dashboard/src/services/api.ts`

### Backend API

- [FastAPI app](https://github.com/bhaktisharma23/ksit_hackathon/blob/main/backend/app.py): `backend/app.py`
- [Upload endpoint](https://github.com/bhaktisharma23/ksit_hackathon/blob/main/backend/routes/upload.py): `backend/routes/upload.py`
- [Detection endpoint](https://github.com/bhaktisharma23/ksit_hackathon/blob/main/backend/routes/detection.py): `backend/routes/detection.py`
- [Results endpoint](https://github.com/bhaktisharma23/ksit_hackathon/blob/main/backend/routes/results.py): `backend/routes/results.py`

### Detection Pipeline

- [Detection service](https://github.com/bhaktisharma23/ksit_hackathon/blob/main/backend/services/detection.py): `backend/services/detection.py`
- [Video processing](https://github.com/bhaktisharma23/ksit_hackathon/blob/main/backend/services/video_processor.py): `backend/services/video_processor.py`
- [Frame inference](https://github.com/bhaktisharma23/ksit_hackathon/blob/main/backend/services/inference.py): `backend/services/inference.py`
- [Postprocessing](https://github.com/bhaktisharma23/ksit_hackathon/blob/main/backend/services/postprocessing.py): `backend/services/postprocessing.py`
- [Detection metrics](https://github.com/bhaktisharma23/ksit_hackathon/blob/main/backend/services/metrics.py): `backend/services/metrics.py`
- [Video utilities](https://github.com/bhaktisharma23/ksit_hackathon/blob/main/backend/utils/video_utils.py): `backend/utils/video_utils.py`
- [File utilities](https://github.com/bhaktisharma23/ksit_hackathon/blob/main/backend/utils/file_utils.py): `backend/utils/file_utils.py`

### Model Development

- [Train model](https://github.com/bhaktisharma23/ksit_hackathon/blob/main/ml/train.py): `ml/train.py`
- [Model prediction](https://github.com/bhaktisharma23/ksit_hackathon/blob/main/ml/predict.py): `ml/predict.py`
- [Validate model](https://github.com/bhaktisharma23/ksit_hackathon/blob/main/ml/validate.py): `ml/validate.py`
- [Export model](https://github.com/bhaktisharma23/ksit_hackathon/blob/main/ml/export_best.py): `ml/export_best.py`

### Other components

- **Dashboard user**

## Connections

- Dashboard user → Page routes: navigates
- Page routes → Video analysis: routes to
- Page routes → Live monitoring: routes to
- Page routes → Overview: routes to
- Page routes → Alert logs: routes to
- Page routes → History: routes to
- Page routes → AI models: routes to
- Page routes → Settings: routes to
- Upload state → Video API service: calls
- Analysis polling → Video API service: calls
- Detection results → Detection service: calls
- Video API service → HTTP client: sends requests
- Alert service → HTTP client: sends requests
- FastAPI app → Upload endpoint: mounts
- FastAPI app → Detection endpoint: mounts
- FastAPI app → Results endpoint: mounts
- Frame inference → Dashboard user
