# mihir1707/teaching-content-generator architecture

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

- Interactive diagram: https://gitdiagram.com/mihir1707/teaching-content-generator
- Repository: https://github.com/mihir1707/teaching-content-generator

## Overview

EduSlide AI is a teaching-material generator with a React interface and Flask API. Users choose topic-only, YouTube, article, document, or combined sources; the documented flow extracts and preprocesses material, chunks and indexes it, creates a plan for review, retrieves relevant context, then generates notes, summaries, MCQs, and PowerPoint slides. The combined pipeline’s excerpt and source index support its main service calls; several standalone source pipelines and frontend/API wiring are represented only at subsystem level where their implementations were not sampled.

Main entry points: [`app/main/main_combined.py`](https://github.com/mihir1707/teaching-content-generator/blob/main/app/main/main_combined.py) (Combined pipeline), [`frontend/src/App.tsx`](https://github.com/mihir1707/teaching-content-generator/blob/main/frontend/src/App.tsx) (Web application), [`app/services/retriever.py`](https://github.com/mihir1707/teaching-content-generator/blob/main/app/services/retriever.py) (Context retrieval), [`app/services/ppt_builder.py`](https://github.com/mihir1707/teaching-content-generator/blob/main/app/services/ppt_builder.py) (PowerPoint builder)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_frontend["User interface"]
  node_web_app["Web application<br/>[App.tsx]"]
  node_landing["Landing and selection<br/>[Landing.tsx]"]
  node_source_forms["Source workflows"]
  node_plan_view["Plan review<br/>[PlanViewer.tsx]"]
  node_api_service["API client<br/>[api.ts]"]
end

subgraph group_api["Flask API"]
  node_flask["Flask server<br/>[server.py]"]
  node_source_routes["Source routes"]
  node_source_controllers["Source controllers"]
end

subgraph group_ingest["Source ingestion"]
  node_combined_flow["Combined pipeline<br/>[main_combined.py]"]
  node_youtube_extract["YouTube transcripts<br/>[youtube.py]"]
  node_article_extract["Article extraction<br/>[web_article.py]"]
  node_file_extract["Document extraction<br/>[file_extractor.py]"]
  node_translation["Translation<br/>[translate.py]"]
end

subgraph group_rag["Retrieval pipeline"]
  node_chunking["Text chunking<br/>[chunker.py]"]
  node_embedding["Embeddings<br/>[embeddings.py]"]
  node_vector_index[("Pinecone index<br/>[pinecone_index.py]")]
  node_query_generation["Query generation"]
  node_retrieval["Context retrieval<br/>[retriever.py]"]
end

subgraph group_outputs["Planning and outputs"]
  node_plan_generation["Plan generation<br/>[generate_plan.py]"]
  node_content_generation["Teaching content<br/>[generator.py]"]
  node_topic_generation["Topic-only generation<br/>[main_topic_name.py]"]
  node_ppt["PowerPoint builder<br/>[ppt_builder.py]"]
  node_download["Presentation download<br/>[download_helper.py]"]
end

node_teacher(("Teacher or learner"))

node_teacher -->|"uses"| node_web_app
node_web_app -->|"routes to"| node_landing
node_web_app -->|"routes to"| node_source_forms
node_teacher -->|"reviews plan"| node_plan_view
node_source_forms -.->|"submits requests"| node_api_service
node_api_service -.->|"calls API"| node_flask
node_flask -->|"registers"| node_source_routes
node_source_routes -->|"dispatches"| node_source_controllers
node_source_controllers -->|"runs pipeline"| node_combined_flow
node_combined_flow -->|"gets transcript"| node_youtube_extract
node_combined_flow -->|"gets article"| node_article_extract
node_combined_flow -->|"extracts files"| node_file_extract
node_combined_flow -->|"chunks text"| node_chunking
node_combined_flow -->|"embeds text"| node_embedding
node_combined_flow -->|"indexes chunks"| node_vector_index
node_combined_flow -->|"generates queries"| node_query_generation
node_combined_flow -->|"retrieves context"| node_retrieval
node_retrieval -->|"embeds queries"| node_embedding
node_retrieval -->|"searches index"| node_vector_index
node_combined_flow -->|"generates materials"| node_content_generation
node_combined_flow -->|"builds slides"| node_ppt
node_topic_generation -->|"builds slides"| node_ppt
node_plan_generation -.->|"provides plan"| node_plan_view
node_ppt -.->|"serves output"| node_download
node_combined_flow -.->|"may translate"| node_translation

click node_web_app "https://github.com/mihir1707/teaching-content-generator/blob/main/frontend/src/App.tsx"
click node_landing "https://github.com/mihir1707/teaching-content-generator/blob/main/frontend/src/pages/Landing.tsx"
click node_source_forms "https://github.com/mihir1707/teaching-content-generator/tree/main/frontend/src/pages/generate"
click node_plan_view "https://github.com/mihir1707/teaching-content-generator/blob/main/frontend/src/components/PlanViewer.tsx"
click node_api_service "https://github.com/mihir1707/teaching-content-generator/blob/main/frontend/src/services/api.ts"
click node_flask "https://github.com/mihir1707/teaching-content-generator/blob/main/app/server.py"
click node_source_routes "https://github.com/mihir1707/teaching-content-generator/tree/main/app/routes"
click node_source_controllers "https://github.com/mihir1707/teaching-content-generator/tree/main/app/controllers"
click node_combined_flow "https://github.com/mihir1707/teaching-content-generator/blob/main/app/main/main_combined.py"
click node_youtube_extract "https://github.com/mihir1707/teaching-content-generator/blob/main/app/services/youtube.py"
click node_article_extract "https://github.com/mihir1707/teaching-content-generator/blob/main/app/services/web_article.py"
click node_file_extract "https://github.com/mihir1707/teaching-content-generator/blob/main/app/services/file_extractor.py"
click node_translation "https://github.com/mihir1707/teaching-content-generator/blob/main/app/services/translate.py"
click node_chunking "https://github.com/mihir1707/teaching-content-generator/blob/main/app/services/chunker.py"
click node_embedding "https://github.com/mihir1707/teaching-content-generator/blob/main/app/services/embeddings.py"
click node_vector_index "https://github.com/mihir1707/teaching-content-generator/blob/main/app/services/pinecone_index.py"
click node_query_generation "https://github.com/mihir1707/teaching-content-generator/blob/main/app/services/generate_queries.py"
click node_retrieval "https://github.com/mihir1707/teaching-content-generator/blob/main/app/services/retriever.py"
click node_plan_generation "https://github.com/mihir1707/teaching-content-generator/blob/main/app/services/generate_plan.py"
click node_content_generation "https://github.com/mihir1707/teaching-content-generator/blob/main/app/services/generator.py"
click node_topic_generation "https://github.com/mihir1707/teaching-content-generator/blob/main/app/main/main_topic_name.py"
click node_ppt "https://github.com/mihir1707/teaching-content-generator/blob/main/app/services/ppt_builder.py"
click node_download "https://github.com/mihir1707/teaching-content-generator/blob/main/app/routes/download_helper.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_web_app,node_landing,node_source_forms,node_plan_view,node_api_service toneBlue
class node_flask,node_source_routes,node_source_controllers toneAmber
class node_combined_flow,node_youtube_extract,node_article_extract,node_file_extract,node_translation toneMint
class node_chunking,node_embedding,node_vector_index,node_query_generation,node_retrieval toneRose
class node_plan_generation,node_content_generation,node_topic_generation,node_ppt,node_download,node_teacher toneIndigo
```

## Components

### User interface

- [Web application](https://github.com/mihir1707/teaching-content-generator/blob/main/frontend/src/App.tsx): `frontend/src/App.tsx`
- [Landing and selection](https://github.com/mihir1707/teaching-content-generator/blob/main/frontend/src/pages/Landing.tsx): `frontend/src/pages/Landing.tsx`
- [Source workflows](https://github.com/mihir1707/teaching-content-generator/tree/main/frontend/src/pages/generate): `frontend/src/pages/generate`
- [Plan review](https://github.com/mihir1707/teaching-content-generator/blob/main/frontend/src/components/PlanViewer.tsx): `frontend/src/components/PlanViewer.tsx`
- [API client](https://github.com/mihir1707/teaching-content-generator/blob/main/frontend/src/services/api.ts): `frontend/src/services/api.ts`

### Flask API

- [Flask server](https://github.com/mihir1707/teaching-content-generator/blob/main/app/server.py): `app/server.py`
- [Source routes](https://github.com/mihir1707/teaching-content-generator/tree/main/app/routes): `app/routes`
- [Source controllers](https://github.com/mihir1707/teaching-content-generator/tree/main/app/controllers): `app/controllers`

### Source ingestion

- [Combined pipeline](https://github.com/mihir1707/teaching-content-generator/blob/main/app/main/main_combined.py): `app/main/main_combined.py`
- [YouTube transcripts](https://github.com/mihir1707/teaching-content-generator/blob/main/app/services/youtube.py): `app/services/youtube.py`
- [Article extraction](https://github.com/mihir1707/teaching-content-generator/blob/main/app/services/web_article.py): `app/services/web_article.py`
- [Document extraction](https://github.com/mihir1707/teaching-content-generator/blob/main/app/services/file_extractor.py): `app/services/file_extractor.py`
- [Translation](https://github.com/mihir1707/teaching-content-generator/blob/main/app/services/translate.py): `app/services/translate.py`

### Retrieval pipeline

- [Text chunking](https://github.com/mihir1707/teaching-content-generator/blob/main/app/services/chunker.py): `app/services/chunker.py`
- [Embeddings](https://github.com/mihir1707/teaching-content-generator/blob/main/app/services/embeddings.py): `app/services/embeddings.py`
- [Pinecone index](https://github.com/mihir1707/teaching-content-generator/blob/main/app/services/pinecone_index.py): `app/services/pinecone_index.py`
- [Query generation](https://github.com/mihir1707/teaching-content-generator/blob/main/app/services/generate_queries.py): `app/services/generate_queries.py`
- [Context retrieval](https://github.com/mihir1707/teaching-content-generator/blob/main/app/services/retriever.py): `app/services/retriever.py`

### Planning and outputs

- [Plan generation](https://github.com/mihir1707/teaching-content-generator/blob/main/app/services/generate_plan.py): `app/services/generate_plan.py`
- [Teaching content](https://github.com/mihir1707/teaching-content-generator/blob/main/app/services/generator.py): `app/services/generator.py`
- [Topic-only generation](https://github.com/mihir1707/teaching-content-generator/blob/main/app/main/main_topic_name.py): `app/main/main_topic_name.py`
- [PowerPoint builder](https://github.com/mihir1707/teaching-content-generator/blob/main/app/services/ppt_builder.py): `app/services/ppt_builder.py`
- [Presentation download](https://github.com/mihir1707/teaching-content-generator/blob/main/app/routes/download_helper.py): `app/routes/download_helper.py`

### Other components

- **Teacher or learner**

## Connections

- Teacher or learner → Web application: uses
- Web application → Landing and selection: routes to (evidence: `frontend/src/App.tsx`)
- Web application → Source workflows: routes to (evidence: `frontend/src/App.tsx`)
- Teacher or learner → Plan review: reviews plan
- Source workflows → API client: submits requests
- API client → Flask server: calls API
- Flask server → Source routes: registers (evidence: `app/server.py`)
- Source routes → Source controllers: dispatches (evidence: `app/routes/combined_routes.py`)
- Source controllers → Combined pipeline: runs pipeline (evidence: `app/controllers/combined_controller.py`)
- Combined pipeline → YouTube transcripts: gets transcript (evidence: `app/main/main_combined.py`)
- Combined pipeline → Article extraction: gets article (evidence: `app/main/main_combined.py`)
- Combined pipeline → Document extraction: extracts files (evidence: `app/main/main_combined.py`)
- Combined pipeline → Text chunking: chunks text (evidence: `app/main/main_combined.py`)
- Combined pipeline → Embeddings: embeds text (evidence: `app/main/main_combined.py`)
- Combined pipeline → Pinecone index: indexes chunks (evidence: `app/main/main_combined.py`)
- Combined pipeline → Query generation: generates queries (evidence: `app/main/main_combined.py`)
- Combined pipeline → Context retrieval: retrieves context (evidence: `app/main/main_combined.py`)
- Context retrieval → Embeddings: embeds queries (evidence: `app/services/retriever.py`)
- Context retrieval → Pinecone index: searches index (evidence: `app/services/retriever.py`)
- Combined pipeline → Teaching content: generates materials (evidence: `app/main/main_combined.py`)
- Combined pipeline → PowerPoint builder: builds slides (evidence: `app/main/main_combined.py`)
- Topic-only generation → PowerPoint builder: builds slides (evidence: `app/main/main_topic_name.py`)
- Plan generation → Plan review: provides plan
- PowerPoint builder → Presentation download: serves output
- Combined pipeline → Translation: may translate
