# antho-ni/study-kit-generator architecture

> Architecture diagram of the GitHub repository antho-ni/study-kit-generator, 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/antho-ni/study-kit-generator
- Repository: https://github.com/antho-ni/study-kit-generator

## Overview

Study Kit Generator accepts study documents and returns AI-generated notes, flashcards, and quizzes. The main workflow runs from a user upload through the React client to FastAPI, where the generate route validates and extracts document text, optionally chunks and summarizes it, then requests structured study materials from Groq. The client displays the results and saves kits in browser history. The README also documents PDF, DOCX, PPTX, and TXT support and a 15 MB limit. Some frontend views and extraction details were not sampled, so their internal behavior is represented only at the documented level.

Main entry points: [`frontend/src/components/StudyKitContainer.jsx`](https://github.com/antho-ni/study-kit-generator/blob/main/frontend/src/components/StudyKitContainer.jsx) (Study Kit Flow), [`backend/app/routers/generate.py`](https://github.com/antho-ni/study-kit-generator/blob/main/backend/app/routers/generate.py) (Generate Routes), [`frontend/src/components/api/client.js`](https://github.com/antho-ni/study-kit-generator/blob/main/frontend/src/components/api/client.js) (API Client), [`backend/app/services/ai_generator.py`](https://github.com/antho-ni/study-kit-generator/blob/main/backend/app/services/ai_generator.py) (AI Generation)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_client["Study Kit Client"]
  node_app["React App<br/>[App.jsx]"]
  node_container["Study Kit Flow"]
  node_upload["Document Upload<br/>[UploadZone.jsx]"]
  node_api_client["API Client<br/>[client.js]"]
  node_history["Kit History<br/>[history.js]"]
end

subgraph group_api["API Orchestration"]
  node_main["FastAPI App<br/>[main.py]"]
  node_generate["Generate Routes<br/>[generate.py]"]
  node_schemas["Result Schemas<br/>[schemas.py]"]
end

subgraph group_processing["Document and AI Processing"]
  node_extract["Text Extraction<br/>[extraction.py]"]
  node_chunk["Text Chunking<br/>[chunking.py]"]
  node_generator["AI Generation<br/>[ai_generator.py]"]
end

subgraph group_results["Study Materials"]
  node_notes["Notes View<br/>[NotesView.jsx]"]
  node_flashcards["Flashcards View<br/>[FlashcardsView.jsx]"]
  node_quiz["Quiz View<br/>[QuizView.jsx]"]
end

node_learner(("Learner"))
node_browser[("Browser Storage")]
node_groq{{"Groq AI"}}

node_learner -->|"selects document"| node_upload
node_app -->|"renders"| node_container
node_container -->|"renders"| node_upload
node_upload -->|"provides file"| node_container
node_container -->|"requests generation"| node_api_client
node_api_client -->|"sends upload"| node_main
node_main -->|"mounts routes"| node_generate
node_generate -->|"extracts text"| node_extract
node_generate -->|"chunks long text"| node_chunk
node_generate -->|"generates kit"| node_generator
node_generator -->|"requests completion"| node_groq
node_groq -->|"returns generated content"| node_generator
node_generator -->|"validates output"| node_schemas
node_generate -->|"declares response"| node_schemas
node_main -->|"returns kit"| node_container
node_container -->|"supplies notes"| node_notes
node_container -->|"supplies cards"| node_flashcards
node_container -->|"supplies questions"| node_quiz
node_container -->|"loads and saves kits"| node_history
node_history -->|"reads and writes"| node_browser
node_flashcards -->|"requests regeneration"| node_api_client
node_quiz -.->|"requests regeneration"| node_api_client
node_api_client -.->|"posts regeneration"| node_generate
node_generate -.->|"regenerates item"| node_generator

click node_app "https://github.com/antho-ni/study-kit-generator/blob/main/frontend/src/App.jsx"
click node_container "https://github.com/antho-ni/study-kit-generator/blob/main/frontend/src/components/StudyKitContainer.jsx"
click node_upload "https://github.com/antho-ni/study-kit-generator/blob/main/frontend/src/components/UploadZone.jsx"
click node_api_client "https://github.com/antho-ni/study-kit-generator/blob/main/frontend/src/components/api/client.js"
click node_history "https://github.com/antho-ni/study-kit-generator/blob/main/frontend/src/utils/history.js"
click node_main "https://github.com/antho-ni/study-kit-generator/blob/main/backend/app/main.py"
click node_generate "https://github.com/antho-ni/study-kit-generator/blob/main/backend/app/routers/generate.py"
click node_schemas "https://github.com/antho-ni/study-kit-generator/blob/main/backend/app/models/schemas.py"
click node_extract "https://github.com/antho-ni/study-kit-generator/blob/main/backend/app/services/extraction.py"
click node_chunk "https://github.com/antho-ni/study-kit-generator/blob/main/backend/app/services/chunking.py"
click node_generator "https://github.com/antho-ni/study-kit-generator/blob/main/backend/app/services/ai_generator.py"
click node_notes "https://github.com/antho-ni/study-kit-generator/blob/main/frontend/src/components/tabs/NotesView.jsx"
click node_flashcards "https://github.com/antho-ni/study-kit-generator/blob/main/frontend/src/components/tabs/FlashcardsView.jsx"
click node_quiz "https://github.com/antho-ni/study-kit-generator/blob/main/frontend/src/components/tabs/QuizView.jsx"

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_container,node_upload,node_api_client,node_history toneBlue
class node_main,node_generate,node_schemas,node_browser toneAmber
class node_extract,node_chunk,node_generator toneMint
class node_notes,node_flashcards,node_quiz toneRose
class node_learner,node_groq toneIndigo
```

## Components

### Study Kit Client

- [React App](https://github.com/antho-ni/study-kit-generator/blob/main/frontend/src/App.jsx): `frontend/src/App.jsx`
- [Study Kit Flow](https://github.com/antho-ni/study-kit-generator/blob/main/frontend/src/components/StudyKitContainer.jsx): `frontend/src/components/StudyKitContainer.jsx`
- [Document Upload](https://github.com/antho-ni/study-kit-generator/blob/main/frontend/src/components/UploadZone.jsx): `frontend/src/components/UploadZone.jsx`
- [API Client](https://github.com/antho-ni/study-kit-generator/blob/main/frontend/src/components/api/client.js): `frontend/src/components/api/client.js`
- [Kit History](https://github.com/antho-ni/study-kit-generator/blob/main/frontend/src/utils/history.js): `frontend/src/utils/history.js`

### API Orchestration

- [FastAPI App](https://github.com/antho-ni/study-kit-generator/blob/main/backend/app/main.py): `backend/app/main.py`
- [Generate Routes](https://github.com/antho-ni/study-kit-generator/blob/main/backend/app/routers/generate.py): `backend/app/routers/generate.py`
- [Result Schemas](https://github.com/antho-ni/study-kit-generator/blob/main/backend/app/models/schemas.py): `backend/app/models/schemas.py`

### Document and AI Processing

- [Text Extraction](https://github.com/antho-ni/study-kit-generator/blob/main/backend/app/services/extraction.py): `backend/app/services/extraction.py`
- [Text Chunking](https://github.com/antho-ni/study-kit-generator/blob/main/backend/app/services/chunking.py): `backend/app/services/chunking.py`
- [AI Generation](https://github.com/antho-ni/study-kit-generator/blob/main/backend/app/services/ai_generator.py): `backend/app/services/ai_generator.py`

### Study Materials

- [Notes View](https://github.com/antho-ni/study-kit-generator/blob/main/frontend/src/components/tabs/NotesView.jsx): `frontend/src/components/tabs/NotesView.jsx`
- [Flashcards View](https://github.com/antho-ni/study-kit-generator/blob/main/frontend/src/components/tabs/FlashcardsView.jsx): `frontend/src/components/tabs/FlashcardsView.jsx`
- [Quiz View](https://github.com/antho-ni/study-kit-generator/blob/main/frontend/src/components/tabs/QuizView.jsx): `frontend/src/components/tabs/QuizView.jsx`

### Other components

- **Learner**
- **Browser Storage**
- **Groq AI**

## Connections

- Learner → Document Upload: selects document
- React App → Study Kit Flow: renders
- Study Kit Flow → Document Upload: renders
- Document Upload → Study Kit Flow: provides file
- Study Kit Flow → API Client: requests generation
- API Client → FastAPI App: sends upload
- FastAPI App → Generate Routes: mounts routes
- Generate Routes → Text Extraction: extracts text
- Generate Routes → Text Chunking: chunks long text
- Generate Routes → AI Generation: generates kit
- AI Generation → Groq AI: requests completion
- Groq AI → AI Generation: returns generated content
- AI Generation → Result Schemas: validates output
- Generate Routes → Result Schemas: declares response
- FastAPI App → Study Kit Flow: returns kit
- Study Kit Flow → Notes View: supplies notes
- Study Kit Flow → Flashcards View: supplies cards
- Study Kit Flow → Quiz View: supplies questions
- Study Kit Flow → Kit History: loads and saves kits
- Kit History → Browser Storage: reads and writes
- Flashcards View → API Client: requests regeneration
- Quiz View → API Client: requests regeneration
- API Client → Generate Routes: posts regeneration
- Generate Routes → AI Generation: regenerates item
