# quyenmcu/senior-project architecture

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

- Interactive diagram: https://gitdiagram.com/quyenmcu/senior-project
- Repository: https://github.com/quyenmcu/senior-project

## Overview

IrisMind is a Django fatigue-aware usage-based insurance decision-support app. Drivers register, start a session, submit browser-camera frames and smartphone telemetry, and view fatigue histories, risk summaries, and premium forecasts; staff get an overview. Source excerpts show the ingestion, detector, persistence, risk, and dashboard calls. The README documents charts and optional demo panels; unsampled presentation wiring is not inferred beyond those documented capabilities.

Main entry points: [`apps/driving/api.py`](https://github.com/quyenmcu/senior-project/blob/main/apps/driving/api.py) (Session and ingestion API), [`apps/dashboard/views.py`](https://github.com/quyenmcu/senior-project/blob/main/apps/dashboard/views.py) (Driver dashboard), [`apps/driving/models.py`](https://github.com/quyenmcu/senior-project/blob/main/apps/driving/models.py) (Driving records), [`apps/driving/services.py`](https://github.com/quyenmcu/senior-project/blob/main/apps/driving/services.py) (Risk summary)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_accounts["Accounts"]
  node_registration["Registration<br/>[views.py]"]
  node_registration_form["Registration form<br/>[forms.py]"]
end

subgraph group_driving["Driving data"]
  node_sessions_api["Session and ingestion API<br/>[api.py]"]
  node_fatigue_detector["Camera fatigue detection"]
  node_driving_records[("Driving records<br/>[models.py]")]
end

subgraph group_analysis["Risk and forecasts"]
  node_risk_summary["Risk summary<br/>[services.py]"]
  node_premium_forecast["Premium forecasts<br/>[services.py]"]
end

subgraph group_dashboards["Dashboards"]
  node_driver_dashboard["Driver dashboard<br/>[views.py]"]
  node_staff_overview["Staff overview<br/>[views.py]"]
  node_demo_summary["Demo telemetry summary<br/>[demo_data.py]"]
  node_fatigue_monitor["Fatigue monitor page<br/>[views.py]"]
end

node_driver(("Driver"))
node_staff(("Staff"))
node_camera(("Browser camera"))
node_phone(("Smartphone client"))

node_driver -->|"registers"| node_registration
node_registration -->|"validates with"| node_registration_form
node_driver -->|"submits session data"| node_sessions_api
node_phone -->|"sends telemetry"| node_sessions_api
node_sessions_api -->|"creates records"| node_driving_records
node_sessions_api -->|"analyzes frames"| node_fatigue_detector
node_fatigue_detector -->|"returns detection result"| node_sessions_api
node_camera -.->|"provides frames"| node_fatigue_monitor
node_driver -->|"opens monitor"| node_fatigue_monitor
node_driver_dashboard -->|"calculates risk"| node_risk_summary
node_risk_summary -->|"queries events and profile"| node_driving_records
node_driver_dashboard -->|"requests forecasts"| node_premium_forecast
node_premium_forecast -->|"reads estimates"| node_driving_records
node_driver -->|"views history and forecasts"| node_driver_dashboard
node_driver_dashboard -->|"loads when telemetry absent"| node_demo_summary
node_staff -->|"views summaries"| node_staff_overview
node_staff_overview -->|"summarizes users"| node_risk_summary
node_staff_overview -->|"aggregates fatigue events"| node_driving_records

click node_registration "https://github.com/quyenmcu/senior-project/blob/main/apps/accounts/views.py"
click node_registration_form "https://github.com/quyenmcu/senior-project/blob/main/apps/accounts/forms.py"
click node_sessions_api "https://github.com/quyenmcu/senior-project/blob/main/apps/driving/api.py"
click node_fatigue_detector "https://github.com/quyenmcu/senior-project/blob/main/apps/driving/fatigue_detector.py"
click node_driving_records "https://github.com/quyenmcu/senior-project/blob/main/apps/driving/models.py"
click node_risk_summary "https://github.com/quyenmcu/senior-project/blob/main/apps/driving/services.py"
click node_premium_forecast "https://github.com/quyenmcu/senior-project/blob/main/apps/driving/services.py"
click node_driver_dashboard "https://github.com/quyenmcu/senior-project/blob/main/apps/dashboard/views.py"
click node_staff_overview "https://github.com/quyenmcu/senior-project/blob/main/apps/dashboard/views.py"
click node_demo_summary "https://github.com/quyenmcu/senior-project/blob/main/apps/dashboard/demo_data.py"
click node_fatigue_monitor "https://github.com/quyenmcu/senior-project/blob/main/apps/dashboard/views.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_registration,node_registration_form,node_camera,node_phone toneBlue
class node_sessions_api,node_fatigue_detector,node_driving_records toneAmber
class node_risk_summary,node_premium_forecast toneMint
class node_driver_dashboard,node_staff_overview,node_demo_summary,node_fatigue_monitor toneRose
class node_driver,node_staff toneIndigo
```

## Components

### Accounts

- [Registration](https://github.com/quyenmcu/senior-project/blob/main/apps/accounts/views.py): `apps/accounts/views.py`
- [Registration form](https://github.com/quyenmcu/senior-project/blob/main/apps/accounts/forms.py): `apps/accounts/forms.py`

### Driving data

- [Session and ingestion API](https://github.com/quyenmcu/senior-project/blob/main/apps/driving/api.py): `apps/driving/api.py`
- [Camera fatigue detection](https://github.com/quyenmcu/senior-project/blob/main/apps/driving/fatigue_detector.py): `apps/driving/fatigue_detector.py`
- [Driving records](https://github.com/quyenmcu/senior-project/blob/main/apps/driving/models.py): `apps/driving/models.py`

### Risk and forecasts

- [Risk summary](https://github.com/quyenmcu/senior-project/blob/main/apps/driving/services.py): `apps/driving/services.py`
- [Premium forecasts](https://github.com/quyenmcu/senior-project/blob/main/apps/driving/services.py): `apps/driving/services.py`

### Dashboards

- [Driver dashboard](https://github.com/quyenmcu/senior-project/blob/main/apps/dashboard/views.py): `apps/dashboard/views.py`
- [Staff overview](https://github.com/quyenmcu/senior-project/blob/main/apps/dashboard/views.py): `apps/dashboard/views.py`
- [Demo telemetry summary](https://github.com/quyenmcu/senior-project/blob/main/apps/dashboard/demo_data.py): `apps/dashboard/demo_data.py`
- [Fatigue monitor page](https://github.com/quyenmcu/senior-project/blob/main/apps/dashboard/views.py): `apps/dashboard/views.py`

### Other components

- **Driver**
- **Staff**
- **Browser camera**
- **Smartphone client**

## Connections

- Driver → Registration: registers (evidence: `README.md`)
- Registration → Registration form: validates with (evidence: `apps/accounts/views.py`)
- Driver → Session and ingestion API: submits session data (evidence: `README.md`)
- Smartphone client → Session and ingestion API: sends telemetry (evidence: `README.md`)
- Session and ingestion API → Driving records: creates records (evidence: `apps/driving/api.py`)
- Session and ingestion API → Camera fatigue detection: analyzes frames (evidence: `apps/driving/api.py`)
- Camera fatigue detection → Session and ingestion API: returns detection result (evidence: `apps/driving/api.py`)
- Browser camera → Fatigue monitor page: provides frames
- Driver → Fatigue monitor page: opens monitor (evidence: `README.md`)
- Driver dashboard → Risk summary: calculates risk (evidence: `apps/dashboard/views.py`)
- Risk summary → Driving records: queries events and profile (evidence: `apps/driving/services.py`)
- Driver dashboard → Premium forecasts: requests forecasts (evidence: `apps/dashboard/views.py`)
- Premium forecasts → Driving records: reads estimates (evidence: `apps/driving/services.py`)
- Driver → Driver dashboard: views history and forecasts (evidence: `README.md`)
- Driver dashboard → Demo telemetry summary: loads when telemetry absent (evidence: `apps/dashboard/views.py`)
- Staff → Staff overview: views summaries (evidence: `README.md`)
- Staff overview → Risk summary: summarizes users (evidence: `apps/dashboard/views.py`)
- Staff overview → Driving records: aggregates fatigue events (evidence: `apps/dashboard/views.py`)
