# sribhavanayalla-01/sitewatch-project architecture

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

- Interactive diagram: https://gitdiagram.com/sribhavanayalla-01/sitewatch-project
- Repository: https://github.com/sribhavanayalla-01/sitewatch-project

## Overview

SiteWatch AI is a Streamlit construction-safety monitoring prototype. Users upload images or videos; the app processes them, detects objects, classifies risks, presents recommendations, and records qualifying incidents for later history and dashboard views. The README documents the processing stages, while the sampled app.py excerpts confirm image analysis, database access, and incident saving; unsampled implementation details are represented only where the README supports them.

Main entry points: [`app.py`](https://github.com/sribhavanayalla-01/sitewatch-project/blob/main/app.py) (YOLO detection), [`sitewatch.db`](https://github.com/sribhavanayalla-01/sitewatch-project/blob/main/sitewatch.db) (Incident database), [`yolo11n.pt`](https://github.com/sribhavanayalla-01/sitewatch-project/blob/main/yolo11n.pt) (YOLO weights)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_interface["User interface"]
  node_app["Streamlit application<br/>[app.py]"]
  node_image_upload["Image upload<br/>[app.py]"]
  node_video_upload["Video upload<br/>[app.py]"]
end

subgraph group_analysis["Safety analysis"]
  node_image_processing["Image processing<br/>[app.py]"]
  node_video_processing["Video processing<br/>[app.py]"]
  node_yolo["YOLO detection<br/>[app.py]"]
  node_model_weights["YOLO weights<br/>[yolo11n.pt]"]
  node_risk["Risk assessment<br/>[app.py]"]
  node_recommendations["Safety recommendations<br/>[app.py]"]
  node_annotation["Detection annotation<br/>[app.py]"]
end

subgraph group_records["Incident records"]
  node_incident_store[("Incident database<br/>[sitewatch.db]")]
  node_incident_history["Incident history<br/>[app.py]"]
end

subgraph group_insights["Safety insights"]
  node_dashboard["Safety dashboard<br/>[app.py]"]
  node_overview["Overview page<br/>[app.py]"]
end

node_user(("Site inspector"))

node_user -->|"uses"| node_app
node_app -->|"offers"| node_image_upload
node_app -->|"offers"| node_video_upload
node_image_upload -->|"submits image"| node_image_processing
node_video_upload -->|"submits video"| node_video_processing
node_image_processing -->|"processes with"| node_yolo
node_video_processing -->|"analyzes frames"| node_yolo
node_yolo -->|"uses weights"| node_model_weights
node_yolo -->|"provides detections"| node_risk
node_risk -->|"informs"| node_recommendations
node_yolo -->|"draws boxes"| node_annotation
node_app -->|"saves incidents"| node_incident_store
node_incident_store -->|"supplies records"| node_incident_history
node_incident_store -->|"supplies analytics"| node_dashboard
node_incident_store -->|"supplies metrics"| node_overview

click node_app "https://github.com/sribhavanayalla-01/sitewatch-project/blob/main/app.py"
click node_image_upload "https://github.com/sribhavanayalla-01/sitewatch-project/blob/main/app.py"
click node_video_upload "https://github.com/sribhavanayalla-01/sitewatch-project/blob/main/app.py"
click node_image_processing "https://github.com/sribhavanayalla-01/sitewatch-project/blob/main/app.py"
click node_video_processing "https://github.com/sribhavanayalla-01/sitewatch-project/blob/main/app.py"
click node_yolo "https://github.com/sribhavanayalla-01/sitewatch-project/blob/main/app.py"
click node_model_weights "https://github.com/sribhavanayalla-01/sitewatch-project/blob/main/yolo11n.pt"
click node_risk "https://github.com/sribhavanayalla-01/sitewatch-project/blob/main/app.py"
click node_recommendations "https://github.com/sribhavanayalla-01/sitewatch-project/blob/main/app.py"
click node_annotation "https://github.com/sribhavanayalla-01/sitewatch-project/blob/main/app.py"
click node_incident_store "https://github.com/sribhavanayalla-01/sitewatch-project/blob/main/sitewatch.db"
click node_incident_history "https://github.com/sribhavanayalla-01/sitewatch-project/blob/main/app.py"
click node_dashboard "https://github.com/sribhavanayalla-01/sitewatch-project/blob/main/app.py"
click node_overview "https://github.com/sribhavanayalla-01/sitewatch-project/blob/main/app.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_image_upload,node_video_upload toneBlue
class node_image_processing,node_video_processing,node_yolo,node_model_weights,node_risk,node_recommendations,node_annotation toneAmber
class node_incident_store,node_incident_history toneMint
class node_dashboard,node_overview toneRose
class node_user toneIndigo
```

## Components

### User interface

- [Streamlit application](https://github.com/sribhavanayalla-01/sitewatch-project/blob/main/app.py): `app.py`
- [Image upload](https://github.com/sribhavanayalla-01/sitewatch-project/blob/main/app.py): `app.py`
- [Video upload](https://github.com/sribhavanayalla-01/sitewatch-project/blob/main/app.py): `app.py`

### Safety analysis

- [Image processing](https://github.com/sribhavanayalla-01/sitewatch-project/blob/main/app.py): `app.py`
- [Video processing](https://github.com/sribhavanayalla-01/sitewatch-project/blob/main/app.py): `app.py`
- [YOLO detection](https://github.com/sribhavanayalla-01/sitewatch-project/blob/main/app.py): `app.py`
- [YOLO weights](https://github.com/sribhavanayalla-01/sitewatch-project/blob/main/yolo11n.pt): `yolo11n.pt`
- [Risk assessment](https://github.com/sribhavanayalla-01/sitewatch-project/blob/main/app.py): `app.py`
- [Safety recommendations](https://github.com/sribhavanayalla-01/sitewatch-project/blob/main/app.py): `app.py`
- [Detection annotation](https://github.com/sribhavanayalla-01/sitewatch-project/blob/main/app.py): `app.py`

### Incident records

- [Incident database](https://github.com/sribhavanayalla-01/sitewatch-project/blob/main/sitewatch.db): `sitewatch.db`
- [Incident history](https://github.com/sribhavanayalla-01/sitewatch-project/blob/main/app.py): `app.py`

### Safety insights

- [Safety dashboard](https://github.com/sribhavanayalla-01/sitewatch-project/blob/main/app.py): `app.py`
- [Overview page](https://github.com/sribhavanayalla-01/sitewatch-project/blob/main/app.py): `app.py`

### Other components

- **Site inspector**

## Connections

- Site inspector → Streamlit application: uses (evidence: `README.md`)
- Streamlit application → Image upload: offers (evidence: `README.md`)
- Streamlit application → Video upload: offers (evidence: `README.md`)
- Image upload → Image processing: submits image (evidence: `README.md`)
- Video upload → Video processing: submits video (evidence: `README.md`)
- Image processing → YOLO detection: processes with (evidence: `README.md`)
- Video processing → YOLO detection: analyzes frames (evidence: `README.md`)
- YOLO detection → YOLO weights: uses weights (evidence: `README.md`)
- YOLO detection → Risk assessment: provides detections (evidence: `README.md`)
- Risk assessment → Safety recommendations: informs (evidence: `README.md`)
- YOLO detection → Detection annotation: draws boxes (evidence: `README.md`)
- Streamlit application → Incident database: saves incidents (evidence: `app.py`)
- Incident database → Incident history: supplies records (evidence: `README.md`)
- Incident database → Safety dashboard: supplies analytics (evidence: `README.md`)
- Incident database → Overview page: supplies metrics (evidence: `app.py`)
