# jashwanthk7/calc-flow architecture

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

- Interactive diagram: https://gitdiagram.com/jashwanthk7/calc-flow
- Repository: https://github.com/jashwanthk7/calc-flow

## Overview

CalcFlow is a Streamlit Calculus I tutor: users can chat with a local model, take adaptive quizzes checked with symbolic math, and review calculus material. The sampled source shows these responsibilities concentrated in app.py, including model discovery and database access; the excerpts do not expose all event handlers, so uncertain internal calls are omitted. PostgreSQL persistence and Ollama inference are documented, and the README also describes dashboard/history capabilities.

Main entry points: [`app.py`](https://github.com/jashwanthk7/calc-flow/blob/main/app.py) (Streamlit application)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_experience["Learning experience"]
  node_app["Streamlit application<br/>[app.py]"]
  node_handbook["Calculus handbook<br/>[app.py]"]
  node_dashboard["Learning dashboard<br/>[app.py]"]
  node_history["Chat history<br/>[app.py]"]
end

subgraph group_tutoring["Tutoring and assessment"]
  node_chat["AI chat tutor<br/>[app.py]"]
  node_quiz["Adaptive quizzes<br/>[app.py]"]
  node_grading["Symbolic grading<br/>[app.py]"]
end

subgraph group_services["Runtime services"]
  node_postgres[("PostgreSQL")]
  node_model_discovery["Model discovery<br/>[app.py]"]
  node_persistence["Persistence access<br/>[app.py]"]
end

node_learner(("Learner"))
node_ollama["Ollama model server"]

node_learner -->|"uses"| node_app
node_app -->|"offers"| node_chat
node_app -->|"offers"| node_quiz
node_app -->|"offers"| node_handbook
node_app -->|"offers"| node_dashboard
node_app -->|"offers"| node_history
node_chat -->|"queries models"| node_model_discovery
node_model_discovery -->|"lists models"| node_ollama
node_chat -->|"requests completion"| node_ollama
node_quiz -->|"verifies answers"| node_grading
node_app -->|"stores and reads"| node_persistence
node_persistence -->|"queries"| node_postgres

click node_app "https://github.com/jashwanthk7/calc-flow/blob/main/app.py"
click node_chat "https://github.com/jashwanthk7/calc-flow/blob/main/app.py"
click node_quiz "https://github.com/jashwanthk7/calc-flow/blob/main/app.py"
click node_grading "https://github.com/jashwanthk7/calc-flow/blob/main/app.py"
click node_handbook "https://github.com/jashwanthk7/calc-flow/blob/main/app.py"
click node_dashboard "https://github.com/jashwanthk7/calc-flow/blob/main/app.py"
click node_history "https://github.com/jashwanthk7/calc-flow/blob/main/app.py"
click node_model_discovery "https://github.com/jashwanthk7/calc-flow/blob/main/app.py"
click node_persistence "https://github.com/jashwanthk7/calc-flow/blob/main/app.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,node_handbook,node_dashboard,node_history toneBlue
class node_chat,node_quiz,node_grading toneAmber
class node_postgres,node_model_discovery,node_persistence,node_ollama toneMint
class node_learner toneIndigo
```

## Components

### Learning experience

- [Streamlit application](https://github.com/jashwanthk7/calc-flow/blob/main/app.py): `app.py`
- [Calculus handbook](https://github.com/jashwanthk7/calc-flow/blob/main/app.py): `app.py`
- [Learning dashboard](https://github.com/jashwanthk7/calc-flow/blob/main/app.py): `app.py`
- [Chat history](https://github.com/jashwanthk7/calc-flow/blob/main/app.py): `app.py`

### Tutoring and assessment

- [AI chat tutor](https://github.com/jashwanthk7/calc-flow/blob/main/app.py): `app.py`
- [Adaptive quizzes](https://github.com/jashwanthk7/calc-flow/blob/main/app.py): `app.py`
- [Symbolic grading](https://github.com/jashwanthk7/calc-flow/blob/main/app.py): `app.py`

### Runtime services

- **PostgreSQL**
- [Model discovery](https://github.com/jashwanthk7/calc-flow/blob/main/app.py): `app.py`
- [Persistence access](https://github.com/jashwanthk7/calc-flow/blob/main/app.py): `app.py`

### Other components

- **Learner**
- **Ollama model server**

## Connections

- Learner → Streamlit application: uses
- Streamlit application → AI chat tutor: offers
- Streamlit application → Adaptive quizzes: offers
- Streamlit application → Calculus handbook: offers
- Streamlit application → Learning dashboard: offers
- Streamlit application → Chat history: offers
- AI chat tutor → Model discovery: queries models
- Model discovery → Ollama model server: lists models
- AI chat tutor → Ollama model server: requests completion
- Adaptive quizzes → Symbolic grading: verifies answers
- Streamlit application → Persistence access: stores and reads
- Persistence access → PostgreSQL: queries
