# prasanna-1166/loadlens architecture

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

- Interactive diagram: https://gitdiagram.com/prasanna-1166/loadlens
- Repository: https://github.com/prasanna-1166/loadlens

## Overview

LoadLens is a Streamlit workload-planning application: users edit or import ordered tasks, choose workers, and run an optimizer that minimizes the largest contiguous workload. Results can be inspected, exported, or saved and restored through local scenario history. The graph retains the separate algorithm demos and About page documented in the README. Edges are limited to relationships shown in excerpts or README; unsampled page behavior is not inferred.

Main entry points: [`streamlit_app.py`](https://github.com/prasanna-1166/loadlens/blob/main/streamlit_app.py) (Streamlit Navigation), [`loadlens/ui/planner_page.py`](https://github.com/prasanna-1166/loadlens/blob/main/loadlens/ui/planner_page.py) (Planner), [`loadlens/services/csv_service.py`](https://github.com/prasanna-1166/loadlens/blob/main/loadlens/services/csv_service.py) (CSV Import Export), [`loadlens/ui/algorithm_lab_page.py`](https://github.com/prasanna-1166/loadlens/blob/main/loadlens/ui/algorithm_lab_page.py) (Algorithm Lab)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_app["Application UI"]
  node_entry["Streamlit Navigation<br/>[streamlit_app.py]"]
  node_planner["Planner<br/>[planner_page.py]"]
  node_history["Scenario History<br/>[history_page.py]"]
  node_about["About Help<br/>[about_page.py]"]
end

subgraph group_domain["Planning Domain"]
  node_validation["Input Validation<br/>[validation.py]"]
  node_csv["CSV Import Export<br/>[csv_service.py]"]
  node_solver["Allocation Solver<br/>[allocation.py]"]
  node_models["Domain Models<br/>[models.py]"]
end

subgraph group_persistence["Local History"]
  node_repo["Scenario Repository"]
  node_sqlite[("Local SQLite")]
end

subgraph group_education["Algorithm Learning"]
  node_lab["Algorithm Lab"]
  node_rotated["Rotated Search Demo<br/>[rotated_search.py]"]
end

node_user(("Planner User"))
node_download["CSV Results"]

node_user -->|"navigates"| node_entry
node_entry -->|"routes to"| node_planner
node_entry -->|"routes to"| node_history
node_entry -->|"routes to"| node_lab
node_entry -->|"routes to"| node_about
node_planner -->|"validates inputs"| node_validation
node_planner -->|"imports and exports"| node_csv
node_planner -->|"runs optimization"| node_solver
node_solver -->|"validates tasks"| node_validation
node_solver -->|"returns allocation"| node_models
node_csv -->|"parses durations"| node_validation
node_csv -->|"creates tasks"| node_models
node_csv -->|"generates export"| node_download
node_planner -->|"saves scenarios"| node_repo
node_history -->|"lists and deletes"| node_repo
node_repo -->|"reads and writes"| node_sqlite
node_lab -->|"traces allocation"| node_solver
node_lab -->|"demonstrates search"| node_rotated
node_lab -->|"handles input errors"| node_validation

click node_entry "https://github.com/prasanna-1166/loadlens/blob/main/streamlit_app.py"
click node_planner "https://github.com/prasanna-1166/loadlens/blob/main/loadlens/ui/planner_page.py"
click node_history "https://github.com/prasanna-1166/loadlens/blob/main/loadlens/ui/history_page.py"
click node_about "https://github.com/prasanna-1166/loadlens/blob/main/loadlens/ui/about_page.py"
click node_validation "https://github.com/prasanna-1166/loadlens/blob/main/loadlens/validation.py"
click node_csv "https://github.com/prasanna-1166/loadlens/blob/main/loadlens/services/csv_service.py"
click node_solver "https://github.com/prasanna-1166/loadlens/blob/main/loadlens/algorithms/allocation.py"
click node_models "https://github.com/prasanna-1166/loadlens/blob/main/loadlens/models.py"
click node_repo "https://github.com/prasanna-1166/loadlens/blob/main/loadlens/persistence/scenario_repository.py"
click node_lab "https://github.com/prasanna-1166/loadlens/blob/main/loadlens/ui/algorithm_lab_page.py"
click node_rotated "https://github.com/prasanna-1166/loadlens/blob/main/loadlens/algorithms/rotated_search.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_entry,node_planner,node_history,node_about,node_user toneBlue
class node_validation,node_csv,node_solver,node_models toneAmber
class node_repo,node_sqlite toneMint
class node_lab,node_rotated toneRose
class node_download toneIndigo
```

## Components

### Application UI

- [Streamlit Navigation](https://github.com/prasanna-1166/loadlens/blob/main/streamlit_app.py): `streamlit_app.py`
- [Planner](https://github.com/prasanna-1166/loadlens/blob/main/loadlens/ui/planner_page.py): `loadlens/ui/planner_page.py`
- [Scenario History](https://github.com/prasanna-1166/loadlens/blob/main/loadlens/ui/history_page.py): `loadlens/ui/history_page.py`
- [About Help](https://github.com/prasanna-1166/loadlens/blob/main/loadlens/ui/about_page.py): `loadlens/ui/about_page.py`

### Planning Domain

- [Input Validation](https://github.com/prasanna-1166/loadlens/blob/main/loadlens/validation.py): `loadlens/validation.py`
- [CSV Import Export](https://github.com/prasanna-1166/loadlens/blob/main/loadlens/services/csv_service.py): `loadlens/services/csv_service.py`
- [Allocation Solver](https://github.com/prasanna-1166/loadlens/blob/main/loadlens/algorithms/allocation.py): `loadlens/algorithms/allocation.py`
- [Domain Models](https://github.com/prasanna-1166/loadlens/blob/main/loadlens/models.py): `loadlens/models.py`

### Local History

- [Scenario Repository](https://github.com/prasanna-1166/loadlens/blob/main/loadlens/persistence/scenario_repository.py): `loadlens/persistence/scenario_repository.py`
- **Local SQLite**

### Algorithm Learning

- [Algorithm Lab](https://github.com/prasanna-1166/loadlens/blob/main/loadlens/ui/algorithm_lab_page.py): `loadlens/ui/algorithm_lab_page.py`
- [Rotated Search Demo](https://github.com/prasanna-1166/loadlens/blob/main/loadlens/algorithms/rotated_search.py): `loadlens/algorithms/rotated_search.py`

### Other components

- **Planner User**
- **CSV Results**

## Connections

- Planner User → Streamlit Navigation: navigates (evidence: `README.md`)
- Streamlit Navigation → Planner: routes to (evidence: `streamlit_app.py`)
- Streamlit Navigation → Scenario History: routes to (evidence: `streamlit_app.py`)
- Streamlit Navigation → Algorithm Lab: routes to (evidence: `streamlit_app.py`)
- Streamlit Navigation → About Help: routes to (evidence: `streamlit_app.py`)
- Planner → Input Validation: validates inputs (evidence: `loadlens/ui/planner_page.py`)
- Planner → CSV Import Export: imports and exports (evidence: `loadlens/ui/planner_page.py`)
- Planner → Allocation Solver: runs optimization (evidence: `loadlens/ui/planner_page.py`)
- Allocation Solver → Input Validation: validates tasks (evidence: `loadlens/algorithms/allocation.py`)
- Allocation Solver → Domain Models: returns allocation (evidence: `loadlens/algorithms/allocation.py`)
- CSV Import Export → Input Validation: parses durations (evidence: `loadlens/services/csv_service.py`)
- CSV Import Export → Domain Models: creates tasks (evidence: `loadlens/services/csv_service.py`)
- CSV Import Export → CSV Results: generates export (evidence: `README.md`)
- Planner → Scenario Repository: saves scenarios (evidence: `README.md`)
- Scenario History → Scenario Repository: lists and deletes (evidence: `loadlens/ui/history_page.py`)
- Scenario Repository → Local SQLite: reads and writes (evidence: `loadlens/persistence/scenario_repository.py`)
- Algorithm Lab → Allocation Solver: traces allocation (evidence: `loadlens/ui/algorithm_lab_page.py`)
- Algorithm Lab → Rotated Search Demo: demonstrates search (evidence: `loadlens/ui/algorithm_lab_page.py`)
- Algorithm Lab → Input Validation: handles input errors (evidence: `loadlens/ui/algorithm_lab_page.py`)
