# 4leena/note-it architecture

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

- Interactive diagram: https://gitdiagram.com/4leena/note-it
- Repository: https://github.com/4leena/note-it

## Overview

NOTE-IT is a local study app: a student submits rough psychology notes, gets structured study material and a diagram, then studies through quizzes or a notes-grounded chat. The Streamlit application also presents saved sessions and study history. The app is concentrated in app.py, while Gemma request handling and prompt/schema definitions live in the backend. Several app responsibilities are represented separately but share that source path. Persistence and some UI-to-backend details are documented in the README; unsampled implementation specifics are not inferred.

Main entry points: [`app.py`](https://github.com/4leena/note-it/blob/main/app.py) (Streamlit interface), [`src/backend/gemma.py`](https://github.com/4leena/note-it/blob/main/src/backend/gemma.py) (Notes rewriting), [`src/backend/templates.py`](https://github.com/4leena/note-it/blob/main/src/backend/templates.py) (Prompts and schema)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_app["Study app"]
  node_streamlit["Streamlit interface<br/>[app.py]"]
  node_input["Note submission<br/>[app.py]"]
end

subgraph group_learning["Study materials"]
  node_notes["Structured notes<br/>[app.py]"]
  node_diagram["Concept diagram<br/>[app.py]"]
  node_quiz["Flashcard quiz<br/>[app.py]"]
  node_buddy["Study Buddy<br/>[app.py]"]
end

subgraph group_backend["AI backend"]
  node_rewrite["Notes rewriting<br/>[gemma.py]"]
  node_diagram_gen["Diagram generation<br/>[gemma.py]"]
  node_chat_gen["Mode-based chat<br/>[gemma.py]"]
  node_prompt_schema["Prompts and schema<br/>[templates.py]"]
end

subgraph group_history["Study history"]
  node_history_view["Calendar and streak<br/>[app.py]"]
  node_session_store[("Saved sessions<br/>[app.py]")]
end

node_student(("Student"))
node_ollama["Ollama / Gemma"]

node_student -->|"uses"| node_streamlit
node_streamlit -->|"submits notes"| node_input
node_input -->|"requests rewrite"| node_rewrite
node_rewrite -->|"uses prompts"| node_prompt_schema
node_rewrite -->|"sends prompts"| node_ollama
node_rewrite -->|"returns sections"| node_notes
node_streamlit -->|"requests diagram"| node_diagram_gen
node_diagram_gen -->|"uses prompts"| node_prompt_schema
node_diagram_gen -->|"sends prompts"| node_ollama
node_diagram_gen -->|"returns Mermaid"| node_diagram
node_streamlit -->|"presents quiz"| node_quiz
node_notes -->|"provides questions"| node_quiz
node_student -->|"asks questions"| node_buddy
node_buddy -->|"requests reply"| node_chat_gen
node_chat_gen -->|"uses modes"| node_prompt_schema
node_chat_gen -->|"sends prompts"| node_ollama
node_streamlit -->|"saves sessions"| node_session_store
node_history_view -->|"reads sessions"| node_session_store
node_student -->|"views progress"| node_history_view

click node_streamlit "https://github.com/4leena/note-it/blob/main/app.py"
click node_input "https://github.com/4leena/note-it/blob/main/app.py"
click node_notes "https://github.com/4leena/note-it/blob/main/app.py"
click node_diagram "https://github.com/4leena/note-it/blob/main/app.py"
click node_quiz "https://github.com/4leena/note-it/blob/main/app.py"
click node_buddy "https://github.com/4leena/note-it/blob/main/app.py"
click node_history_view "https://github.com/4leena/note-it/blob/main/app.py"
click node_session_store "https://github.com/4leena/note-it/blob/main/app.py"
click node_rewrite "https://github.com/4leena/note-it/blob/main/src/backend/gemma.py"
click node_diagram_gen "https://github.com/4leena/note-it/blob/main/src/backend/gemma.py"
click node_chat_gen "https://github.com/4leena/note-it/blob/main/src/backend/gemma.py"
click node_prompt_schema "https://github.com/4leena/note-it/blob/main/src/backend/templates.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_streamlit,node_input toneBlue
class node_notes,node_diagram,node_quiz,node_buddy toneAmber
class node_rewrite,node_diagram_gen,node_chat_gen,node_prompt_schema toneMint
class node_history_view,node_session_store toneRose
class node_student,node_ollama toneIndigo
```

## Components

### Study app

- [Streamlit interface](https://github.com/4leena/note-it/blob/main/app.py): `app.py`
- [Note submission](https://github.com/4leena/note-it/blob/main/app.py): `app.py`

### Study materials

- [Structured notes](https://github.com/4leena/note-it/blob/main/app.py): `app.py`
- [Concept diagram](https://github.com/4leena/note-it/blob/main/app.py): `app.py`
- [Flashcard quiz](https://github.com/4leena/note-it/blob/main/app.py): `app.py`
- [Study Buddy](https://github.com/4leena/note-it/blob/main/app.py): `app.py`

### AI backend

- [Notes rewriting](https://github.com/4leena/note-it/blob/main/src/backend/gemma.py): `src/backend/gemma.py`
- [Diagram generation](https://github.com/4leena/note-it/blob/main/src/backend/gemma.py): `src/backend/gemma.py`
- [Mode-based chat](https://github.com/4leena/note-it/blob/main/src/backend/gemma.py): `src/backend/gemma.py`
- [Prompts and schema](https://github.com/4leena/note-it/blob/main/src/backend/templates.py): `src/backend/templates.py`

### Study history

- [Calendar and streak](https://github.com/4leena/note-it/blob/main/app.py): `app.py`
- [Saved sessions](https://github.com/4leena/note-it/blob/main/app.py): `app.py`

### Other components

- **Student**
- **Ollama / Gemma**

## Connections

- Student → Streamlit interface: uses (evidence: `README.md`)
- Streamlit interface → Note submission: submits notes (evidence: `README.md`)
- Note submission → Notes rewriting: requests rewrite (evidence: `README.md`)
- Notes rewriting → Prompts and schema: uses prompts (evidence: `src/backend/gemma.py`)
- Notes rewriting → Ollama / Gemma: sends prompts (evidence: `src/backend/gemma.py`)
- Notes rewriting → Structured notes: returns sections (evidence: `README.md`)
- Streamlit interface → Diagram generation: requests diagram (evidence: `app.py`)
- Diagram generation → Prompts and schema: uses prompts (evidence: `src/backend/gemma.py`)
- Diagram generation → Ollama / Gemma: sends prompts (evidence: `src/backend/gemma.py`)
- Diagram generation → Concept diagram: returns Mermaid (evidence: `README.md`)
- Streamlit interface → Flashcard quiz: presents quiz (evidence: `app.py`)
- Structured notes → Flashcard quiz: provides questions (evidence: `app.py`)
- Student → Study Buddy: asks questions (evidence: `README.md`)
- Study Buddy → Mode-based chat: requests reply (evidence: `README.md`)
- Mode-based chat → Prompts and schema: uses modes (evidence: `src/backend/gemma.py`)
- Mode-based chat → Ollama / Gemma: sends prompts (evidence: `src/backend/gemma.py`)
- Streamlit interface → Saved sessions: saves sessions (evidence: `README.md`)
- Calendar and streak → Saved sessions: reads sessions (evidence: `README.md`)
- Student → Calendar and streak: views progress (evidence: `README.md`)
