# sifat192/ai-studybuddy architecture

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

- Interactive diagram: https://gitdiagram.com/sifat192/ai-studybuddy
- Repository: https://github.com/sifat192/ai-studybuddy

## Overview

AI Study Buddy is a small Streamlit app for generating study material. A student enters a topic, chooses one of three modes, and clicks Generate; the app builds a mode-specific prompt, requests content from Gemini, and displays the response. The workflow is implemented in one source file, so the interface, prompt construction, and rendering are shown as distinct responsibilities sharing that path. No persistent storage is documented. Edges reflect the README and the sampled source; no other runtime modules appear in the source index.

Main entry points: [`product.py`](https://github.com/sifat192/ai-studybuddy/blob/main/product.py) (Study Interface)

## Diagram (Mermaid)

```mermaid
flowchart TD

node_student(("Student"))
node_interface["Study Interface<br/>[product.py]"]
node_prompt["Prompt Builder<br/>[product.py]"]
node_gemini["Gemini API"]
node_display["Response Display<br/>[product.py]"]

node_student -->|"enters topic, selects mode"| node_interface
node_interface -->|"builds prompt"| node_prompt
node_prompt -->|"requests generation"| node_gemini
node_gemini -->|"returns content"| node_display

click node_interface "https://github.com/sifat192/ai-studybuddy/blob/main/product.py"
click node_prompt "https://github.com/sifat192/ai-studybuddy/blob/main/product.py"
click node_display "https://github.com/sifat192/ai-studybuddy/blob/main/product.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_student toneIndigo
class node_interface,node_prompt,node_display toneTeal
class node_gemini toneMint
```

## Components

### Other components

- **Student**
- [Study Interface](https://github.com/sifat192/ai-studybuddy/blob/main/product.py): `product.py`
- [Prompt Builder](https://github.com/sifat192/ai-studybuddy/blob/main/product.py): `product.py`
- **Gemini API**
- [Response Display](https://github.com/sifat192/ai-studybuddy/blob/main/product.py): `product.py`

## Connections

- Student → Study Interface: enters topic, selects mode (evidence: `product.py`)
- Study Interface → Prompt Builder: builds prompt (evidence: `product.py`)
- Prompt Builder → Gemini API: requests generation (evidence: `product.py`)
- Gemini API → Response Display: returns content (evidence: `product.py`)
