# tejaswii27/gyan_guru architecture

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

- Interactive diagram: https://gitdiagram.com/tejaswii27/gyan_guru
- Repository: https://github.com/tejaswii27/gyan_guru

## Overview

GyanGuru is an AI-assisted machine-learning learning platform. A learner signs in, requests a topic and difficulty, receives a generated lesson, then uses its quiz, flashcards, and Python sandbox or exports it as a notebook. The app also tracks lesson history. The graph separates the interface, learning features, server-side persistence, and AI services. Source excerpts show the main client calls and selected server routes; some documented capabilities, including audio generation, have incomplete implementation excerpts, so their internal wiring is not expanded.

Main entry points: [`src/App.tsx`](https://github.com/tejaswii27/gyan_guru/blob/main/src/App.tsx) (App workflow), [`src/components/LessonView.tsx`](https://github.com/tejaswii27/gyan_guru/blob/main/src/components/LessonView.tsx) (Lesson presentation), [`src/services/gemini.ts`](https://github.com/tejaswii27/gyan_guru/blob/main/src/services/gemini.ts) (Lesson and media generation), [`server.ts`](https://github.com/tejaswii27/gyan_guru/blob/main/server.ts) (API and auth)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_interface["Learning interface"]
  node_app["App workflow<br/>[App.tsx]"]
  node_auth["Authentication UI<br/>[Auth.tsx]"]
  node_sidebar["History navigation<br/>[Sidebar.tsx]"]
end

subgraph group_learning["Lesson experience"]
  node_lessonview["Lesson presentation<br/>[LessonView.tsx]"]
  node_quiz["Interactive quiz<br/>[Quiz.tsx]"]
  node_flashcards["Flashcards<br/>[Flashcards.tsx]"]
  node_sandbox["Python sandbox<br/>[CodeSandbox.tsx]"]
  node_notebook["Notebook export<br/>[notebook.ts]"]
end

subgraph group_backend["Application backend"]
  node_server["API and auth<br/>[server.ts]"]
  node_database[("SQLite data<br/>[gyanguru.db]")]
end

subgraph group_ai["AI and content services"]
  node_lessonservice["Lesson and media generation<br/>[gemini.ts]"]
end

node_learner(("Learner"))
node_gemini{{"Google Gemini"}}
node_pyodide{{"Pyodide runtime"}}

node_learner -->|"requests lesson"| node_app
node_app -->|"shows sign-in"| node_auth
node_auth -->|"submits credentials"| node_server
node_app -->|"generates lesson"| node_lessonservice
node_app -->|"loads and saves history"| node_server
node_app -->|"renders navigation"| node_sidebar
node_app -->|"renders lesson"| node_lessonview
node_sidebar -.->|"selects history item"| node_app
node_lessonview -->|"renders quiz"| node_quiz
node_lessonview -->|"renders cards"| node_flashcards
node_lessonview -->|"renders code sandbox"| node_sandbox
node_lessonview -->|"builds notebook export"| node_notebook
node_lessonview -->|"requests media"| node_lessonservice
node_lessonservice -->|"generates content"| node_gemini
node_lessonservice -->|"requests audio"| node_server
node_sandbox -->|"runs Python"| node_pyodide
node_server -->|"reads and writes"| node_database

click node_app "https://github.com/tejaswii27/gyan_guru/blob/main/src/App.tsx"
click node_auth "https://github.com/tejaswii27/gyan_guru/blob/main/src/components/Auth.tsx"
click node_sidebar "https://github.com/tejaswii27/gyan_guru/blob/main/src/components/Sidebar.tsx"
click node_lessonview "https://github.com/tejaswii27/gyan_guru/blob/main/src/components/LessonView.tsx"
click node_quiz "https://github.com/tejaswii27/gyan_guru/blob/main/src/components/Quiz.tsx"
click node_flashcards "https://github.com/tejaswii27/gyan_guru/blob/main/src/components/Flashcards.tsx"
click node_sandbox "https://github.com/tejaswii27/gyan_guru/blob/main/src/components/CodeSandbox.tsx"
click node_notebook "https://github.com/tejaswii27/gyan_guru/blob/main/src/services/notebook.ts"
click node_server "https://github.com/tejaswii27/gyan_guru/blob/main/server.ts"
click node_database "https://github.com/tejaswii27/gyan_guru/blob/main/gyanguru.db"
click node_lessonservice "https://github.com/tejaswii27/gyan_guru/blob/main/src/services/gemini.ts"

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_auth,node_sidebar toneBlue
class node_lessonview,node_quiz,node_flashcards,node_sandbox,node_notebook toneAmber
class node_server,node_database toneMint
class node_lessonservice toneRose
class node_learner,node_gemini,node_pyodide toneIndigo
```

## Components

### Learning interface

- [App workflow](https://github.com/tejaswii27/gyan_guru/blob/main/src/App.tsx): `src/App.tsx`
- [Authentication UI](https://github.com/tejaswii27/gyan_guru/blob/main/src/components/Auth.tsx): `src/components/Auth.tsx`
- [History navigation](https://github.com/tejaswii27/gyan_guru/blob/main/src/components/Sidebar.tsx): `src/components/Sidebar.tsx`

### Lesson experience

- [Lesson presentation](https://github.com/tejaswii27/gyan_guru/blob/main/src/components/LessonView.tsx): `src/components/LessonView.tsx`
- [Interactive quiz](https://github.com/tejaswii27/gyan_guru/blob/main/src/components/Quiz.tsx): `src/components/Quiz.tsx`
- [Flashcards](https://github.com/tejaswii27/gyan_guru/blob/main/src/components/Flashcards.tsx): `src/components/Flashcards.tsx`
- [Python sandbox](https://github.com/tejaswii27/gyan_guru/blob/main/src/components/CodeSandbox.tsx): `src/components/CodeSandbox.tsx`
- [Notebook export](https://github.com/tejaswii27/gyan_guru/blob/main/src/services/notebook.ts): `src/services/notebook.ts`

### Application backend

- [API and auth](https://github.com/tejaswii27/gyan_guru/blob/main/server.ts): `server.ts`
- [SQLite data](https://github.com/tejaswii27/gyan_guru/blob/main/gyanguru.db): `gyanguru.db`

### AI and content services

- [Lesson and media generation](https://github.com/tejaswii27/gyan_guru/blob/main/src/services/gemini.ts): `src/services/gemini.ts`

### Other components

- **Learner**
- **Google Gemini**
- **Pyodide runtime**

## Connections

- Learner → App workflow: requests lesson (evidence: `README.md`)
- App workflow → Authentication UI: shows sign-in (evidence: `src/App.tsx`)
- Authentication UI → API and auth: submits credentials (evidence: `src/components/Auth.tsx`)
- App workflow → Lesson and media generation: generates lesson (evidence: `src/App.tsx`)
- App workflow → API and auth: loads and saves history (evidence: `src/App.tsx`)
- App workflow → History navigation: renders navigation (evidence: `src/App.tsx`)
- App workflow → Lesson presentation: renders lesson (evidence: `src/App.tsx`)
- History navigation → App workflow: selects history item (evidence: `src/App.tsx`)
- Lesson presentation → Interactive quiz: renders quiz (evidence: `src/components/LessonView.tsx`)
- Lesson presentation → Flashcards: renders cards (evidence: `src/components/LessonView.tsx`)
- Lesson presentation → Python sandbox: renders code sandbox (evidence: `src/components/LessonView.tsx`)
- Lesson presentation → Notebook export: builds notebook export (evidence: `src/components/LessonView.tsx`)
- Lesson presentation → Lesson and media generation: requests media (evidence: `src/components/LessonView.tsx`)
- Lesson and media generation → Google Gemini: generates content (evidence: `src/services/gemini.ts`)
- Lesson and media generation → API and auth: requests audio (evidence: `src/services/gemini.ts`)
- Python sandbox → Pyodide runtime: runs Python (evidence: `src/components/CodeSandbox.tsx`)
- API and auth → SQLite data: reads and writes (evidence: `server.ts`)
