# yatish-balu/roll_call architecture

> Architecture diagram of the GitHub repository yatish-balu/roll_call, 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/yatish-balu/roll_call
- Repository: https://github.com/yatish-balu/roll_call

## Overview

RollCall AI turns attendance spreadsheets and sheet photos into validated, four-state attendance records, summaries, and downloadable reports; it also supports safe database queries. The main user path runs through the dashboard and agent, which coordinates extraction, validation, confidence checks, summarization, and optional export. SQLite persists institutional and attendance data. The README documents these stages and capabilities; sampled source confirms several calls and storage behaviors, while some unsampled implementation links are omitted.

Main entry points: [`app/agent.py`](https://github.com/yatish-balu/roll_call/blob/main/app/agent.py) (Attendance agent), [`app/ui.py`](https://github.com/yatish-balu/roll_call/blob/main/app/ui.py) (Streamlit dashboard), [`tools/read_photo_tool.py`](https://github.com/yatish-balu/roll_call/blob/main/tools/read_photo_tool.py) (Photo extraction), [`tools/summary_tool.py`](https://github.com/yatish-balu/roll_call/blob/main/tools/summary_tool.py) (Attendance summaries)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_interaction["User interaction"]
  node_dashboard["Streamlit dashboard<br/>[ui.py]"]
  node_api["FastAPI entrypoint<br/>[main.py]"]
end

subgraph group_orchestration["Agent orchestration"]
  node_agent["Attendance agent<br/>[agent.py]"]
  node_demo["Agent demo<br/>[demo_agent.py]"]
end

subgraph group_processing["Attendance processing"]
  node_csv["CSV ingestion<br/>[read_csv_tool.py]"]
  node_photo["Photo extraction<br/>[read_photo_tool.py]"]
  node_validation["Record validation<br/>[validate_tool.py]"]
  node_summary["Attendance summaries<br/>[summary_tool.py]"]
end

subgraph group_persistence["Persistence and queries"]
  node_query["Safe query tools<br/>[query_tool.py]"]
  node_dbcli["Database utility<br/>[database.py]"]
  node_crud["Attendance CRUD<br/>[crud.py]"]
  node_connection["SQLite connections<br/>[connection.py]"]
  node_schema["Database schema<br/>[schema.py]"]
  node_sqlite[("Attendance database")]
end

subgraph group_reporting["Reporting"]
  node_exports["Excel and PDF export<br/>[export_tool.py]"]
end

node_user(("Institutional user"))
node_vision{{"Gemini vision"}}
node_ocr{{"EasyOCR fallback"}}

node_user -->|"uploads and queries"| node_dashboard
node_user -->|"uses REST API"| node_api
node_dashboard -->|"submits requests"| node_agent
node_dashboard -->|"loads sessions"| node_crud
node_agent -->|"dispatches reads"| node_csv
node_agent -->|"dispatches extraction"| node_photo
node_agent -->|"validates records"| node_validation
node_agent -->|"computes summaries"| node_summary
node_agent -->|"dispatches queries"| node_query
node_agent -->|"requests exports"| node_exports
node_photo -.->|"tries vision backend"| node_vision
node_photo -->|"falls back to OCR"| node_ocr
node_validation -->|"gates summarization"| node_summary
node_summary -->|"provides summary data"| node_exports
node_query -->|"reads records"| node_sqlite
node_crud -->|"opens connections"| node_connection
node_connection -->|"connects to"| node_sqlite
node_schema -->|"initializes through"| node_connection
node_schema -->|"defines tables"| node_sqlite
node_dbcli -.->|"manages database"| node_sqlite
node_demo -->|"demonstrates usage"| node_agent
node_demo -->|"uses database helpers"| node_crud

click node_dashboard "https://github.com/yatish-balu/roll_call/blob/main/app/ui.py"
click node_api "https://github.com/yatish-balu/roll_call/blob/main/app/main.py"
click node_agent "https://github.com/yatish-balu/roll_call/blob/main/app/agent.py"
click node_demo "https://github.com/yatish-balu/roll_call/blob/main/demo_agent.py"
click node_csv "https://github.com/yatish-balu/roll_call/blob/main/tools/read_csv_tool.py"
click node_photo "https://github.com/yatish-balu/roll_call/blob/main/tools/read_photo_tool.py"
click node_validation "https://github.com/yatish-balu/roll_call/blob/main/tools/validate_tool.py"
click node_summary "https://github.com/yatish-balu/roll_call/blob/main/tools/summary_tool.py"
click node_exports "https://github.com/yatish-balu/roll_call/blob/main/tools/export_tool.py"
click node_query "https://github.com/yatish-balu/roll_call/blob/main/tools/query_tool.py"
click node_dbcli "https://github.com/yatish-balu/roll_call/blob/main/tools/database.py"
click node_crud "https://github.com/yatish-balu/roll_call/blob/main/app/db/crud.py"
click node_connection "https://github.com/yatish-balu/roll_call/blob/main/app/db/connection.py"
click node_schema "https://github.com/yatish-balu/roll_call/blob/main/app/db/schema.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_dashboard,node_api,node_user toneBlue
class node_agent,node_demo toneAmber
class node_csv,node_photo,node_validation,node_summary toneMint
class node_query,node_dbcli,node_crud,node_connection,node_schema,node_sqlite toneRose
class node_exports,node_vision,node_ocr toneIndigo
```

## Components

### User interaction

- [Streamlit dashboard](https://github.com/yatish-balu/roll_call/blob/main/app/ui.py): `app/ui.py`
- [FastAPI entrypoint](https://github.com/yatish-balu/roll_call/blob/main/app/main.py): `app/main.py`

### Agent orchestration

- [Attendance agent](https://github.com/yatish-balu/roll_call/blob/main/app/agent.py): `app/agent.py`
- [Agent demo](https://github.com/yatish-balu/roll_call/blob/main/demo_agent.py): `demo_agent.py`

### Attendance processing

- [CSV ingestion](https://github.com/yatish-balu/roll_call/blob/main/tools/read_csv_tool.py): `tools/read_csv_tool.py`
- [Photo extraction](https://github.com/yatish-balu/roll_call/blob/main/tools/read_photo_tool.py): `tools/read_photo_tool.py`
- [Record validation](https://github.com/yatish-balu/roll_call/blob/main/tools/validate_tool.py): `tools/validate_tool.py`
- [Attendance summaries](https://github.com/yatish-balu/roll_call/blob/main/tools/summary_tool.py): `tools/summary_tool.py`

### Persistence and queries

- [Safe query tools](https://github.com/yatish-balu/roll_call/blob/main/tools/query_tool.py): `tools/query_tool.py`
- [Database utility](https://github.com/yatish-balu/roll_call/blob/main/tools/database.py): `tools/database.py`
- [Attendance CRUD](https://github.com/yatish-balu/roll_call/blob/main/app/db/crud.py): `app/db/crud.py`
- [SQLite connections](https://github.com/yatish-balu/roll_call/blob/main/app/db/connection.py): `app/db/connection.py`
- [Database schema](https://github.com/yatish-balu/roll_call/blob/main/app/db/schema.py): `app/db/schema.py`
- **Attendance database**

### Reporting

- [Excel and PDF export](https://github.com/yatish-balu/roll_call/blob/main/tools/export_tool.py): `tools/export_tool.py`

### Other components

- **Institutional user**
- **Gemini vision**
- **EasyOCR fallback**

## Connections

- Institutional user → Streamlit dashboard: uploads and queries (evidence: `README.md`)
- Institutional user → FastAPI entrypoint: uses REST API (evidence: `README.md`)
- Streamlit dashboard → Attendance agent: submits requests (evidence: `app/ui.py`)
- Streamlit dashboard → Attendance CRUD: loads sessions (evidence: `app/ui.py`)
- Attendance agent → CSV ingestion: dispatches reads (evidence: `app/agent.py`)
- Attendance agent → Photo extraction: dispatches extraction (evidence: `app/agent.py`)
- Attendance agent → Record validation: validates records (evidence: `app/agent.py`)
- Attendance agent → Attendance summaries: computes summaries (evidence: `app/agent.py`)
- Attendance agent → Safe query tools: dispatches queries (evidence: `app/agent.py`)
- Attendance agent → Excel and PDF export: requests exports (evidence: `app/agent.py`)
- Photo extraction → Gemini vision: tries vision backend (evidence: `tools/read_photo_tool.py`)
- Photo extraction → EasyOCR fallback: falls back to OCR (evidence: `tools/read_photo_tool.py`)
- Record validation → Attendance summaries: gates summarization (evidence: `README.md`)
- Attendance summaries → Excel and PDF export: provides summary data (evidence: `tools/export_tool.py`)
- Safe query tools → Attendance database: reads records (evidence: `tools/query_tool.py`)
- Attendance CRUD → SQLite connections: opens connections (evidence: `app/db/crud.py`)
- SQLite connections → Attendance database: connects to (evidence: `app/db/connection.py`)
- Database schema → SQLite connections: initializes through (evidence: `app/db/schema.py`)
- Database schema → Attendance database: defines tables (evidence: `app/db/schema.py`)
- Database utility → Attendance database: manages database
- Agent demo → Attendance agent: demonstrates usage (evidence: `demo_agent.py`)
- Agent demo → Attendance CRUD: uses database helpers (evidence: `demo_agent.py`)
