# pythonom/lost-time-analyzer architecture

> Architecture diagram of the GitHub repository pythonom/lost-time-analyzer, 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/pythonom/lost-time-analyzer
- Repository: https://github.com/pythonom/lost-time-analyzer

## Overview

Lost Time Analyzer turns faculty-uploaded class grading data into risk scores and student-performance views. The documented workflow runs from CSV upload through backend parsing, rule-based scoring, ML prediction and Supabase persistence; faculty then review class insights, high-risk students, comparisons, leaderboards and individual profiles with notes. The frontend also provides authentication and shared presentation state. Backend internals beyond the indexed imports and README workflow were not excerpted, so those relationships are documented rather than source-verified.

Main entry points: [`src/App.jsx`](https://github.com/pythonom/lost-time-analyzer/blob/main/src/App.jsx) (App routing), [`src/services/api.js`](https://github.com/pythonom/lost-time-analyzer/blob/main/src/services/api.js) (API client), [`backend/app.py`](https://github.com/pythonom/lost-time-analyzer/blob/main/backend/app.py) (Flask API), [`src/pages/UploadData.jsx`](https://github.com/pythonom/lost-time-analyzer/blob/main/src/pages/UploadData.jsx) (CSV upload)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_faculty_ui["Faculty interface"]
  node_app_routes["App routing<br/>[App.jsx]"]
  node_login["Faculty login<br/>[Login.jsx]"]
  node_upload["CSV upload<br/>[UploadData.jsx]"]
  node_dashboard["Class dashboard<br/>[Dashboard.jsx]"]
  node_student_directory["Student directory<br/>[Students.jsx]"]
  node_at_risk["At-risk view<br/>[AtRisk.jsx]"]
  node_compare["Student comparison<br/>[Compare.jsx]"]
  node_leaderboard["Leaderboard<br/>[Leaderboard.jsx]"]
  node_profile["Student profile<br/>[StudentProfile.jsx]"]
end

subgraph group_frontend_state["Frontend services"]
  node_auth["Auth state<br/>[AuthContext.jsx]"]
  node_notifications["Notifications"]
  node_api_client["API client<br/>[api.js]"]
  node_student_adapter["Student adapter<br/>[adapter.js]"]
end

subgraph group_analysis_api["Analysis backend"]
  node_backend_api["Flask API<br/>[app.py]"]
  node_csv_processing["CSV processing<br/>[preprocess.py]"]
  node_risk_scoring["Risk and trend<br/>[app.py]"]
  node_ml_prediction["ML prediction<br/>[model.py]"]
end

subgraph group_persistence["Data services"]
  node_supabase_client["Supabase access<br/>[supabase_client.py]"]
  node_supabase[("Supabase")]
end

node_faculty(("Faculty"))

node_faculty -->|"uses"| node_app_routes
node_app_routes -->|"routes to"| node_login
node_app_routes -->|"routes to"| node_upload
node_app_routes -->|"routes to"| node_dashboard
node_app_routes -->|"routes to"| node_student_directory
node_app_routes -->|"routes to"| node_at_risk
node_app_routes -->|"routes to"| node_compare
node_app_routes -->|"routes to"| node_leaderboard
node_app_routes -->|"routes to"| node_profile
node_app_routes -->|"provides"| node_auth
node_faculty -->|"submits CSV"| node_upload
node_upload -->|"uploads data"| node_backend_api
node_backend_api -->|"parses CSV"| node_csv_processing
node_backend_api -->|"computes scores"| node_risk_scoring
node_backend_api -->|"runs prediction"| node_ml_prediction
node_backend_api -->|"saves results"| node_supabase_client
node_supabase_client -->|"reads and writes"| node_supabase
node_dashboard -->|"requests insights"| node_api_client
node_student_directory -->|"loads students"| node_api_client
node_at_risk -->|"requests students"| node_api_client
node_compare -->|"loads students"| node_api_client
node_leaderboard -->|"loads students"| node_api_client
node_profile -->|"loads students"| node_api_client
node_profile -->|"loads and saves notes"| node_backend_api
node_api_client -->|"calls Flask API"| node_backend_api
node_login -.->|"sets session"| node_auth
node_api_client -->|"adapts student data"| node_student_adapter
node_upload -->|"reports upload status"| node_notifications

click node_app_routes "https://github.com/pythonom/lost-time-analyzer/blob/main/src/App.jsx"
click node_login "https://github.com/pythonom/lost-time-analyzer/blob/main/src/pages/Login.jsx"
click node_upload "https://github.com/pythonom/lost-time-analyzer/blob/main/src/pages/UploadData.jsx"
click node_dashboard "https://github.com/pythonom/lost-time-analyzer/blob/main/src/pages/Dashboard.jsx"
click node_student_directory "https://github.com/pythonom/lost-time-analyzer/blob/main/src/pages/Students.jsx"
click node_at_risk "https://github.com/pythonom/lost-time-analyzer/blob/main/src/pages/AtRisk.jsx"
click node_compare "https://github.com/pythonom/lost-time-analyzer/blob/main/src/pages/Compare.jsx"
click node_leaderboard "https://github.com/pythonom/lost-time-analyzer/blob/main/src/pages/Leaderboard.jsx"
click node_profile "https://github.com/pythonom/lost-time-analyzer/blob/main/src/pages/StudentProfile.jsx"
click node_auth "https://github.com/pythonom/lost-time-analyzer/blob/main/src/context/AuthContext.jsx"
click node_notifications "https://github.com/pythonom/lost-time-analyzer/blob/main/src/context/NotificationContext.jsx"
click node_api_client "https://github.com/pythonom/lost-time-analyzer/blob/main/src/services/api.js"
click node_student_adapter "https://github.com/pythonom/lost-time-analyzer/blob/main/src/utils/adapter.js"
click node_backend_api "https://github.com/pythonom/lost-time-analyzer/blob/main/backend/app.py"
click node_csv_processing "https://github.com/pythonom/lost-time-analyzer/blob/main/backend/utils/preprocess.py"
click node_risk_scoring "https://github.com/pythonom/lost-time-analyzer/blob/main/backend/app.py"
click node_ml_prediction "https://github.com/pythonom/lost-time-analyzer/blob/main/backend/ml/model.py"
click node_supabase_client "https://github.com/pythonom/lost-time-analyzer/blob/main/backend/services/supabase_client.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_routes,node_login,node_upload,node_dashboard,node_student_directory,node_at_risk,node_compare,node_leaderboard,node_profile toneBlue
class node_auth,node_notifications,node_api_client,node_student_adapter toneAmber
class node_backend_api,node_csv_processing,node_risk_scoring,node_ml_prediction toneMint
class node_supabase_client,node_supabase toneRose
class node_faculty toneIndigo
```

## Components

### Faculty interface

- [App routing](https://github.com/pythonom/lost-time-analyzer/blob/main/src/App.jsx): `src/App.jsx`
- [Faculty login](https://github.com/pythonom/lost-time-analyzer/blob/main/src/pages/Login.jsx): `src/pages/Login.jsx`
- [CSV upload](https://github.com/pythonom/lost-time-analyzer/blob/main/src/pages/UploadData.jsx): `src/pages/UploadData.jsx`
- [Class dashboard](https://github.com/pythonom/lost-time-analyzer/blob/main/src/pages/Dashboard.jsx): `src/pages/Dashboard.jsx`
- [Student directory](https://github.com/pythonom/lost-time-analyzer/blob/main/src/pages/Students.jsx): `src/pages/Students.jsx`
- [At-risk view](https://github.com/pythonom/lost-time-analyzer/blob/main/src/pages/AtRisk.jsx): `src/pages/AtRisk.jsx`
- [Student comparison](https://github.com/pythonom/lost-time-analyzer/blob/main/src/pages/Compare.jsx): `src/pages/Compare.jsx`
- [Leaderboard](https://github.com/pythonom/lost-time-analyzer/blob/main/src/pages/Leaderboard.jsx): `src/pages/Leaderboard.jsx`
- [Student profile](https://github.com/pythonom/lost-time-analyzer/blob/main/src/pages/StudentProfile.jsx): `src/pages/StudentProfile.jsx`

### Frontend services

- [Auth state](https://github.com/pythonom/lost-time-analyzer/blob/main/src/context/AuthContext.jsx): `src/context/AuthContext.jsx`
- [Notifications](https://github.com/pythonom/lost-time-analyzer/blob/main/src/context/NotificationContext.jsx): `src/context/NotificationContext.jsx`
- [API client](https://github.com/pythonom/lost-time-analyzer/blob/main/src/services/api.js): `src/services/api.js`
- [Student adapter](https://github.com/pythonom/lost-time-analyzer/blob/main/src/utils/adapter.js): `src/utils/adapter.js`

### Analysis backend

- [Flask API](https://github.com/pythonom/lost-time-analyzer/blob/main/backend/app.py): `backend/app.py`
- [CSV processing](https://github.com/pythonom/lost-time-analyzer/blob/main/backend/utils/preprocess.py): `backend/utils/preprocess.py`
- [Risk and trend](https://github.com/pythonom/lost-time-analyzer/blob/main/backend/app.py): `backend/app.py`
- [ML prediction](https://github.com/pythonom/lost-time-analyzer/blob/main/backend/ml/model.py): `backend/ml/model.py`

### Data services

- [Supabase access](https://github.com/pythonom/lost-time-analyzer/blob/main/backend/services/supabase_client.py): `backend/services/supabase_client.py`
- **Supabase**

### Other components

- **Faculty**

## Connections

- Faculty → App routing: uses (evidence: `README.md`)
- App routing → Faculty login: routes to (evidence: `src/App.jsx`)
- App routing → CSV upload: routes to (evidence: `src/App.jsx`)
- App routing → Class dashboard: routes to (evidence: `src/App.jsx`)
- App routing → Student directory: routes to (evidence: `src/App.jsx`)
- App routing → At-risk view: routes to (evidence: `src/App.jsx`)
- App routing → Student comparison: routes to (evidence: `src/App.jsx`)
- App routing → Leaderboard: routes to (evidence: `src/App.jsx`)
- App routing → Student profile: routes to (evidence: `src/App.jsx`)
- App routing → Auth state: provides (evidence: `src/App.jsx`)
- Faculty → CSV upload: submits CSV (evidence: `README.md`)
- CSV upload → Flask API: uploads data (evidence: `README.md`)
- Flask API → CSV processing: parses CSV (evidence: `README.md`)
- Flask API → Risk and trend: computes scores (evidence: `README.md`)
- Flask API → ML prediction: runs prediction (evidence: `README.md`)
- Flask API → Supabase access: saves results (evidence: `README.md`)
- Supabase access → Supabase: reads and writes (evidence: `README.md`)
- Class dashboard → API client: requests insights (evidence: `src/pages/Dashboard.jsx`)
- Student directory → API client: loads students (evidence: `src/pages/Students.jsx`)
- At-risk view → API client: requests students (evidence: `src/pages/AtRisk.jsx`)
- Student comparison → API client: loads students (evidence: `src/pages/Compare.jsx`)
- Leaderboard → API client: loads students (evidence: `src/pages/Leaderboard.jsx`)
- Student profile → API client: loads students (evidence: `src/pages/StudentProfile.jsx`)
- Student profile → Flask API: loads and saves notes (evidence: `README.md`)
- API client → Flask API: calls Flask API (evidence: `README.md`)
- Faculty login → Auth state: sets session (evidence: `src/pages/Login.jsx`)
- API client → Student adapter: adapts student data (evidence: `src/services/api.js`)
- CSV upload → Notifications: reports upload status (evidence: `src/pages/UploadData.jsx`)
