# muhaadnasir/study-fold architecture

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

- Interactive diagram: https://gitdiagram.com/muhaadnasir/study-fold
- Repository: https://github.com/muhaadnasir/study-fold

## Overview

StudyFold is a lightweight Flet flashcard app. Users can load saved cards, add question-and-answer cards with course and topic fields, and review cards in collapsible Q&A tiles; card changes are saved to JSON. The deck also supports course/topic queries and rating updates. The README describes flip-card quizzes and recall ratings, but the sampled UI does not show a quiz flow, so that capability is shown as documented but unverified. The graph reflects the sampled source and README, not unsampled implementation details.

Main entry points: [`src/main.py`](https://github.com/muhaadnasir/study-fold/blob/main/src/main.py) (Flet App), [`src/storage.py`](https://github.com/muhaadnasir/study-fold/blob/main/src/storage.py) (JSON Storage), [`src/deck.py`](https://github.com/muhaadnasir/study-fold/blob/main/src/deck.py) (Deck), [`src/card.py`](https://github.com/muhaadnasir/study-fold/blob/main/src/card.py) (Flashcard)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_app["App UI"]
  node_application["Flet App<br/>[main.py]"]
  node_card_entry["Card Entry<br/>[main.py]"]
  node_study_view["Study View<br/>[main.py]"]
  node_qa_tile["Collapsible Q&amp;A<br/>[custom_widgets.py]"]
  node_quiz["Flip-Card Quiz"]
end

subgraph group_domain["Card Domain"]
  node_deck["Deck<br/>[deck.py]"]
  node_card["Flashcard<br/>[card.py]"]
end

subgraph group_persistence["Persistence"]
  node_json_storage["JSON Storage<br/>[storage.py]"]
  node_json_file[("Card Data<br/>[data.json]")]
end

node_learner(("Learner"))

node_learner -->|"uses"| node_application
node_application -->|"loads cards"| node_json_storage
node_application -->|"displays"| node_study_view
node_application -->|"opens"| node_card_entry
node_card_entry -->|"adds card"| node_deck
node_card_entry -->|"saves cards"| node_json_storage
node_study_view -->|"reads cards"| node_deck
node_study_view -->|"renders"| node_qa_tile
node_json_storage -->|"reads and writes"| node_json_file
node_json_storage -->|"loads into"| node_deck
node_json_storage -->|"deserializes"| node_card
node_deck -->|"holds"| node_card
node_application -.->|"documented capability"| node_quiz

click node_application "https://github.com/muhaadnasir/study-fold/blob/main/src/main.py"
click node_card_entry "https://github.com/muhaadnasir/study-fold/blob/main/src/main.py"
click node_study_view "https://github.com/muhaadnasir/study-fold/blob/main/src/main.py"
click node_qa_tile "https://github.com/muhaadnasir/study-fold/blob/main/src/custom_widgets.py"
click node_quiz "https://github.com/muhaadnasir/study-fold/tree/main/src"
click node_deck "https://github.com/muhaadnasir/study-fold/blob/main/src/deck.py"
click node_card "https://github.com/muhaadnasir/study-fold/blob/main/src/card.py"
click node_json_storage "https://github.com/muhaadnasir/study-fold/blob/main/src/storage.py"
click node_json_file "https://github.com/muhaadnasir/study-fold/blob/main/data.json"

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_application,node_card_entry,node_study_view,node_qa_tile,node_quiz toneBlue
class node_deck,node_card toneAmber
class node_json_storage,node_json_file toneMint
class node_learner toneIndigo
```

## Components

### App UI

- [Flet App](https://github.com/muhaadnasir/study-fold/blob/main/src/main.py): `src/main.py`
- [Card Entry](https://github.com/muhaadnasir/study-fold/blob/main/src/main.py): `src/main.py`
- [Study View](https://github.com/muhaadnasir/study-fold/blob/main/src/main.py): `src/main.py`
- [Collapsible Q&A](https://github.com/muhaadnasir/study-fold/blob/main/src/custom_widgets.py): `src/custom_widgets.py`
- [Flip-Card Quiz](https://github.com/muhaadnasir/study-fold/tree/main/src): `src`

### Card Domain

- [Deck](https://github.com/muhaadnasir/study-fold/blob/main/src/deck.py): `src/deck.py`
- [Flashcard](https://github.com/muhaadnasir/study-fold/blob/main/src/card.py): `src/card.py`

### Persistence

- [JSON Storage](https://github.com/muhaadnasir/study-fold/blob/main/src/storage.py): `src/storage.py`
- [Card Data](https://github.com/muhaadnasir/study-fold/blob/main/data.json): `data.json`

### Other components

- **Learner**

## Connections

- Learner → Flet App: uses (evidence: `README.md`)
- Flet App → JSON Storage: loads cards (evidence: `src/main.py`)
- Flet App → Study View: displays (evidence: `src/main.py`)
- Flet App → Card Entry: opens (evidence: `src/main.py`)
- Card Entry → Deck: adds card (evidence: `src/main.py`)
- Card Entry → JSON Storage: saves cards (evidence: `src/main.py`)
- Study View → Deck: reads cards (evidence: `src/main.py`)
- Study View → Collapsible Q&A: renders (evidence: `src/main.py`)
- JSON Storage → Card Data: reads and writes (evidence: `src/storage.py`)
- JSON Storage → Deck: loads into (evidence: `src/storage.py`)
- JSON Storage → Flashcard: deserializes (evidence: `src/storage.py`)
- Deck → Flashcard: holds (evidence: `src/deck.py`)
- Flet App → Flip-Card Quiz: documented capability (evidence: `README.md`)
