# myrzza01/aurafarm-datathon architecture

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

- Interactive diagram: https://gitdiagram.com/myrzza01/aurafarm-datathon
- Repository: https://github.com/myrzza01/aurafarm-datathon

## Overview

Forte Vision is a local web interface and API for reviewing cash-register-operation videos for possible violations. The main workflow is: upload a .mov, create a background job, analyze it, then poll for and display the verdict, violations, evidence frames, timestamps, and rule sources. The model is not yet connected; the current analyzer reports an explicit failure. The UI and API use separate session-cookie and API-key routes. The README documents UI behavior and planned capabilities; frontend implementation details were not sampled, so those connections cite the README.

Main entry points: [`backend/main.py`](https://github.com/myrzza01/aurafarm-datathon/blob/main/backend/main.py) (API routes), [`backend/schemas.py`](https://github.com/myrzza01/aurafarm-datathon/blob/main/backend/schemas.py) (Analysis result), [`frontend/assets/app.js`](https://github.com/myrzza01/aurafarm-datathon/blob/main/frontend/assets/app.js) (Upload and results), [`backend/analyzer.py`](https://github.com/myrzza01/aurafarm-datathon/blob/main/backend/analyzer.py) (Local analyzer)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_client["Browser interface"]
  node_web_ui["Review interface<br/>[index.html]"]
  node_web_client["Upload and results<br/>[app.js]"]
end

subgraph group_api["API and jobs"]
  node_api_routes["API routes<br/>[main.py]"]
  node_access_control["Route protection<br/>[main.py]"]
  node_upload_handling["Upload handling<br/>[main.py]"]
  node_job_processing["Job processing<br/>[main.py]"]
  node_job_state["In-memory job state<br/>[main.py]"]
end

subgraph group_analysis["Video analysis"]
  node_analyzer["Local analyzer<br/>[analyzer.py]"]
end

subgraph group_contracts["Result contracts"]
  node_result_contract["Analysis result<br/>[schemas.py]"]
  node_violation_contract["Violation details<br/>[schemas.py]"]
  node_evidence_contract["Frames and rules<br/>[schemas.py]"]
end

node_operator(("Reviewer"))

node_operator -->|"uses"| node_web_ui
node_web_client -->|"uploads and polls"| node_api_routes
node_api_routes -->|"protects routes"| node_access_control
node_api_routes -->|"accepts upload"| node_upload_handling
node_upload_handling -->|"schedules"| node_job_processing
node_job_processing -->|"calls"| node_analyzer
node_job_processing -->|"validates result"| node_result_contract
node_job_processing -->|"updates status"| node_job_state
node_api_routes -->|"reads job"| node_job_state
node_analyzer -->|"returns"| node_result_contract
node_result_contract -->|"contains"| node_violation_contract
node_violation_contract -->|"includes"| node_evidence_contract
node_web_client -->|"displays job result"| node_job_state

click node_web_ui "https://github.com/myrzza01/aurafarm-datathon/blob/main/frontend/index.html"
click node_web_client "https://github.com/myrzza01/aurafarm-datathon/blob/main/frontend/assets/app.js"
click node_api_routes "https://github.com/myrzza01/aurafarm-datathon/blob/main/backend/main.py"
click node_access_control "https://github.com/myrzza01/aurafarm-datathon/blob/main/backend/main.py"
click node_upload_handling "https://github.com/myrzza01/aurafarm-datathon/blob/main/backend/main.py"
click node_job_processing "https://github.com/myrzza01/aurafarm-datathon/blob/main/backend/main.py"
click node_job_state "https://github.com/myrzza01/aurafarm-datathon/blob/main/backend/main.py"
click node_analyzer "https://github.com/myrzza01/aurafarm-datathon/blob/main/backend/analyzer.py"
click node_result_contract "https://github.com/myrzza01/aurafarm-datathon/blob/main/backend/schemas.py"
click node_violation_contract "https://github.com/myrzza01/aurafarm-datathon/blob/main/backend/schemas.py"
click node_evidence_contract "https://github.com/myrzza01/aurafarm-datathon/blob/main/backend/schemas.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_web_ui,node_web_client,node_operator toneBlue
class node_api_routes,node_access_control,node_upload_handling,node_job_processing,node_job_state toneAmber
class node_analyzer toneMint
class node_result_contract,node_violation_contract,node_evidence_contract toneRose
```

## Components

### Browser interface

- [Review interface](https://github.com/myrzza01/aurafarm-datathon/blob/main/frontend/index.html): `frontend/index.html`
- [Upload and results](https://github.com/myrzza01/aurafarm-datathon/blob/main/frontend/assets/app.js): `frontend/assets/app.js`

### API and jobs

- [API routes](https://github.com/myrzza01/aurafarm-datathon/blob/main/backend/main.py): `backend/main.py`
- [Route protection](https://github.com/myrzza01/aurafarm-datathon/blob/main/backend/main.py): `backend/main.py`
- [Upload handling](https://github.com/myrzza01/aurafarm-datathon/blob/main/backend/main.py): `backend/main.py`
- [Job processing](https://github.com/myrzza01/aurafarm-datathon/blob/main/backend/main.py): `backend/main.py`
- [In-memory job state](https://github.com/myrzza01/aurafarm-datathon/blob/main/backend/main.py): `backend/main.py`

### Video analysis

- [Local analyzer](https://github.com/myrzza01/aurafarm-datathon/blob/main/backend/analyzer.py): `backend/analyzer.py`

### Result contracts

- [Analysis result](https://github.com/myrzza01/aurafarm-datathon/blob/main/backend/schemas.py): `backend/schemas.py`
- [Violation details](https://github.com/myrzza01/aurafarm-datathon/blob/main/backend/schemas.py): `backend/schemas.py`
- [Frames and rules](https://github.com/myrzza01/aurafarm-datathon/blob/main/backend/schemas.py): `backend/schemas.py`

### Other components

- **Reviewer**

## Connections

- Reviewer → Review interface: uses (evidence: `README.md`)
- Upload and results → API routes: uploads and polls (evidence: `README.md`)
- API routes → Route protection: protects routes (evidence: `backend/main.py`)
- API routes → Upload handling: accepts upload (evidence: `backend/main.py`)
- Upload handling → Job processing: schedules (evidence: `backend/main.py`)
- Job processing → Local analyzer: calls (evidence: `backend/main.py`)
- Job processing → Analysis result: validates result (evidence: `backend/main.py`)
- Job processing → In-memory job state: updates status (evidence: `backend/main.py`)
- API routes → In-memory job state: reads job (evidence: `backend/main.py`)
- Local analyzer → Analysis result: returns (evidence: `backend/analyzer.py`)
- Analysis result → Violation details: contains (evidence: `backend/schemas.py`)
- Violation details → Frames and rules: includes (evidence: `backend/schemas.py`)
- Upload and results → In-memory job state: displays job result (evidence: `README.md`)
