# kotaroison/studymate architecture

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

- Interactive diagram: https://gitdiagram.com/kotaroison/studymate
- Repository: https://github.com/kotaroison/studymate

## Overview

StudyMate is a Streamlit study assistant whose main workflow is a student choosing a learning tool, providing text or a question, and receiving Gemini-generated study help. Separate tabs also support planning and exporting a study pack. The app keeps planner entries and recent chat in Streamlit session state; export reads those values to prepare a downloadable text file. All identified product behavior is implemented in main.py; the README documents the same capabilities. Evidence is limited to the supplied tree and sampled source.

Main entry points: [`main.py`](https://github.com/kotaroison/studymate/blob/main/main.py) (Streamlit interface)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_learning["Learning tools"]
  node_summary["Text summary<br/>[main.py]"]
  node_questions["Practice questions<br/>[main.py]"]
  node_tutor["Chat tutor<br/>[main.py]"]
end

subgraph group_planning["Planning and export"]
  node_planner["Study planner<br/>[main.py]"]
  node_export["Study pack export<br/>[main.py]"]
  node_download["Text download<br/>[main.py]"]
end

subgraph group_runtime["App runtime"]
  node_ui["Streamlit interface<br/>[main.py]"]
  node_session["Session state<br/>[main.py]"]
  node_gemini["Google Gemini API"]
end

node_student(("Student"))

node_student -->|"uses"| node_ui
node_ui -->|"renders tab"| node_summary
node_ui -->|"renders tab"| node_questions
node_ui -->|"renders tab"| node_tutor
node_ui -->|"renders tab"| node_planner
node_ui -->|"renders tab"| node_export
node_summary -->|"requests summary"| node_gemini
node_questions -->|"requests questions"| node_gemini
node_tutor -->|"requests answer"| node_gemini
node_tutor -->|"updates history"| node_session
node_planner -->|"stores plan"| node_session
node_export -->|"reads plan and chat"| node_session
node_export -->|"prepares text"| node_download
node_download -->|"downloads"| node_student
node_summary -->|"shows summary"| node_student
node_questions -->|"shows questions"| node_student
node_tutor -->|"shows answer"| node_student
node_planner -->|"shows plan"| node_student

click node_ui "https://github.com/kotaroison/studymate/blob/main/main.py"
click node_summary "https://github.com/kotaroison/studymate/blob/main/main.py"
click node_questions "https://github.com/kotaroison/studymate/blob/main/main.py"
click node_tutor "https://github.com/kotaroison/studymate/blob/main/main.py"
click node_planner "https://github.com/kotaroison/studymate/blob/main/main.py"
click node_export "https://github.com/kotaroison/studymate/blob/main/main.py"
click node_session "https://github.com/kotaroison/studymate/blob/main/main.py"
click node_download "https://github.com/kotaroison/studymate/blob/main/main.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_summary,node_questions,node_tutor toneBlue
class node_planner,node_export,node_download toneAmber
class node_ui,node_session,node_gemini toneMint
class node_student toneIndigo
```

## Components

### Learning tools

- [Text summary](https://github.com/kotaroison/studymate/blob/main/main.py): `main.py`
- [Practice questions](https://github.com/kotaroison/studymate/blob/main/main.py): `main.py`
- [Chat tutor](https://github.com/kotaroison/studymate/blob/main/main.py): `main.py`

### Planning and export

- [Study planner](https://github.com/kotaroison/studymate/blob/main/main.py): `main.py`
- [Study pack export](https://github.com/kotaroison/studymate/blob/main/main.py): `main.py`
- [Text download](https://github.com/kotaroison/studymate/blob/main/main.py): `main.py`

### App runtime

- [Streamlit interface](https://github.com/kotaroison/studymate/blob/main/main.py): `main.py`
- [Session state](https://github.com/kotaroison/studymate/blob/main/main.py): `main.py`
- **Google Gemini API**

### Other components

- **Student**

## Connections

- Student → Streamlit interface: uses
- Streamlit interface → Text summary: renders tab
- Streamlit interface → Practice questions: renders tab
- Streamlit interface → Chat tutor: renders tab
- Streamlit interface → Study planner: renders tab
- Streamlit interface → Study pack export: renders tab
- Text summary → Google Gemini API: requests summary
- Practice questions → Google Gemini API: requests questions
- Chat tutor → Google Gemini API: requests answer
- Chat tutor → Session state: updates history
- Study planner → Session state: stores plan
- Study pack export → Session state: reads plan and chat
- Study pack export → Text download: prepares text
- Text download → Student: downloads
- Text summary → Student: shows summary
- Practice questions → Student: shows questions
- Chat tutor → Student: shows answer
- Study planner → Student: shows plan
