# noah35802/edugen architecture

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

- Interactive diagram: https://gitdiagram.com/noah35802/edugen
- Repository: https://github.com/noah35802/edugen

## Overview

EduGen AI is a role-based learning platform: students, teachers, and administrators use the React app, which calls an Express API backed by PostgreSQL; AI tutoring delegates course-material ingestion and cited Q&A to a separate FastAPI RAG service. The README confirms these core technologies and tutoring capability. The tree and excerpts also show quiz generation, study planning, recommendations, and other AI features, but their internal service wiring is largely unsampled, so those branches are shown without speculative call chains.

Main entry points: [`src/routes/App.tsx`](https://github.com/noah35802/edugen/blob/main/src/routes/App.tsx) (Role-based pages), [`rag_service/app/api/routes.py`](https://github.com/noah35802/edugen/blob/main/rag_service/app/api/routes.py) (RAG API), [`rag_service/app/retrieval/vector_store.py`](https://github.com/noah35802/edugen/blob/main/rag_service/app/retrieval/vector_store.py) (Vector index), [`src/pages/student/AIFeaturePages.tsx`](https://github.com/noah35802/edugen/blob/main/src/pages/student/AIFeaturePages.tsx) (Quiz and study features)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_frontend["Learning application"]
  node_webapp["Role-based pages<br/>[App.tsx]"]
  node_authui["Authentication UI<br/>[AuthPages.tsx]"]
  node_authstate["Auth state<br/>[authSlice.ts]"]
  node_authclient["Auth requests<br/>[authService.ts]"]
  node_http["API client<br/>[axiosClient.ts]"]
  node_student["Student learning"]
  node_aitutorui["Tutor and materials<br/>[AITutorPage.tsx]"]
  node_materialmanager["Shared materials"]
  node_tutorclient["Tutor requests<br/>[aiTutorService.ts]"]
  node_quizui["Quiz and study features<br/>[AIFeaturePages.tsx]"]
end

subgraph group_backend["Platform API"]
  node_server["Express API<br/>[server.js]"]
  node_authroutes["Auth routes<br/>[auth.js]"]
  node_authcontroller["Auth controller<br/>[authController.js]"]
  node_tutorroutes["Tutor routes<br/>[aiTutor.js]"]
  node_tutorcontroller["Tutor controller"]
  node_ragadapter["RAG adapter<br/>[ragService.js]"]
end

subgraph group_rag["RAG tutoring"]
  node_ragapi["RAG API<br/>[routes.py]"]
  node_ingestion["Document ingestion<br/>[pipeline.py]"]
  node_loaders["File loaders<br/>[loaders.py]"]
  node_vectors[("Vector index<br/>[vector_store.py]")]
  node_answer["Question answering<br/>[chain.py]"]
  node_llm["Language model<br/>[llm.py]"]
  node_embedding["Embeddings<br/>[embeddings.py]"]
end

subgraph group_ai["AI learning services"]
  node_quizservice["Quiz generation API<br/>[main.py]"]
  node_quizgenerator["Quiz generator<br/>[generator.py]"]
  node_learningai["AI feature routes"]
end

subgraph group_data["Persistence and models"]
  node_platformdb[("PostgreSQL<br/>[db.js]")]
  node_userrecords["User records<br/>[userModel.js]"]
end

node_users(("Learners and staff"))

node_users -->|"uses"| node_webapp
node_webapp -->|"routes to"| node_authui
node_authui -->|"dispatches"| node_authstate
node_authstate -->|"calls"| node_authclient
node_authclient -->|"sends requests"| node_http
node_webapp -->|"routes to"| node_student
node_webapp -->|"routes to"| node_aitutorui
node_webapp -->|"routes to"| node_quizui
node_materialmanager -->|"calls"| node_tutorclient
node_aitutorui -.->|"uses"| node_tutorclient
node_tutorclient -->|"sends requests"| node_http
node_http -.->|"calls API"| node_server
node_server -->|"mounts"| node_authroutes
node_authroutes -->|"dispatches"| node_authcontroller
node_authcontroller -->|"uses"| node_userrecords
node_userrecords -->|"queries"| node_platformdb
node_server -.->|"mounts"| node_tutorroutes
node_tutorroutes -.->|"dispatches"| node_tutorcontroller
node_tutorcontroller -->|"calls"| node_ragadapter
node_ragadapter -->|"HTTP requests"| node_ragapi
node_ragapi -->|"calls"| node_ingestion
node_ingestion -->|"loads files"| node_loaders
node_ingestion -->|"stores chunks"| node_vectors
node_ragapi -->|"lists and deletes"| node_vectors
node_ragapi -->|"calls"| node_answer
node_answer -->|"retrieves context"| node_vectors
node_answer -->|"calls"| node_llm
node_vectors -->|"embeds queries"| node_embedding
node_quizui -.->|"uses service"| node_quizservice
node_quizservice -->|"calls"| node_quizgenerator
node_quizui -.->|"AI features"| node_learningai

click node_webapp "https://github.com/noah35802/edugen/blob/main/src/routes/App.tsx"
click node_authui "https://github.com/noah35802/edugen/blob/main/src/pages/auth/AuthPages.tsx"
click node_authstate "https://github.com/noah35802/edugen/blob/main/src/store/slices/authSlice.ts"
click node_authclient "https://github.com/noah35802/edugen/blob/main/src/services/authService.ts"
click node_http "https://github.com/noah35802/edugen/blob/main/src/api/axiosClient.ts"
click node_student "https://github.com/noah35802/edugen/blob/main/src/pages/student/StudentUtilityPages.tsx"
click node_aitutorui "https://github.com/noah35802/edugen/blob/main/src/pages/student/AITutorPage.tsx"
click node_materialmanager "https://github.com/noah35802/edugen/blob/main/src/components/courses/CourseMaterialsManager.tsx"
click node_tutorclient "https://github.com/noah35802/edugen/blob/main/src/services/aiTutorService.ts"
click node_server "https://github.com/noah35802/edugen/blob/main/backend/src/server.js"
click node_authroutes "https://github.com/noah35802/edugen/blob/main/backend/src/routes/auth.js"
click node_authcontroller "https://github.com/noah35802/edugen/blob/main/backend/src/controllers/authController.js"
click node_tutorroutes "https://github.com/noah35802/edugen/blob/main/backend/src/routes/aiTutor.js"
click node_tutorcontroller "https://github.com/noah35802/edugen/blob/main/backend/src/controllers/aiTutorController.js"
click node_ragadapter "https://github.com/noah35802/edugen/blob/main/backend/src/services/ragService.js"
click node_platformdb "https://github.com/noah35802/edugen/blob/main/backend/src/db.js"
click node_userrecords "https://github.com/noah35802/edugen/blob/main/backend/src/models/userModel.js"
click node_ragapi "https://github.com/noah35802/edugen/blob/main/rag_service/app/api/routes.py"
click node_ingestion "https://github.com/noah35802/edugen/blob/main/rag_service/app/ingestion/pipeline.py"
click node_loaders "https://github.com/noah35802/edugen/blob/main/rag_service/app/ingestion/loaders.py"
click node_vectors "https://github.com/noah35802/edugen/blob/main/rag_service/app/retrieval/vector_store.py"
click node_answer "https://github.com/noah35802/edugen/blob/main/rag_service/app/generation/chain.py"
click node_llm "https://github.com/noah35802/edugen/blob/main/rag_service/app/generation/llm.py"
click node_embedding "https://github.com/noah35802/edugen/blob/main/rag_service/app/retrieval/embeddings.py"
click node_quizui "https://github.com/noah35802/edugen/blob/main/src/pages/student/AIFeaturePages.tsx"
click node_quizservice "https://github.com/noah35802/edugen/blob/main/quiz-service/app/main.py"
click node_quizgenerator "https://github.com/noah35802/edugen/blob/main/quiz-service/app/generator.py"
click node_learningai "https://github.com/noah35802/edugen/tree/main/ai-service/routes"

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_webapp,node_authui,node_authstate,node_authclient,node_http,node_student,node_aitutorui,node_materialmanager,node_tutorclient,node_quizui toneBlue
class node_server,node_authroutes,node_authcontroller,node_tutorroutes,node_tutorcontroller,node_ragadapter toneAmber
class node_ragapi,node_ingestion,node_loaders,node_vectors,node_answer,node_llm,node_embedding toneMint
class node_quizservice,node_quizgenerator,node_learningai toneRose
class node_platformdb,node_userrecords,node_users toneIndigo
```

## Components

### Learning application

- [Role-based pages](https://github.com/noah35802/edugen/blob/main/src/routes/App.tsx): `src/routes/App.tsx`
- [Authentication UI](https://github.com/noah35802/edugen/blob/main/src/pages/auth/AuthPages.tsx): `src/pages/auth/AuthPages.tsx`
- [Auth state](https://github.com/noah35802/edugen/blob/main/src/store/slices/authSlice.ts): `src/store/slices/authSlice.ts`
- [Auth requests](https://github.com/noah35802/edugen/blob/main/src/services/authService.ts): `src/services/authService.ts`
- [API client](https://github.com/noah35802/edugen/blob/main/src/api/axiosClient.ts): `src/api/axiosClient.ts`
- [Student learning](https://github.com/noah35802/edugen/blob/main/src/pages/student/StudentUtilityPages.tsx): `src/pages/student/StudentUtilityPages.tsx`
- [Tutor and materials](https://github.com/noah35802/edugen/blob/main/src/pages/student/AITutorPage.tsx): `src/pages/student/AITutorPage.tsx`
- [Shared materials](https://github.com/noah35802/edugen/blob/main/src/components/courses/CourseMaterialsManager.tsx): `src/components/courses/CourseMaterialsManager.tsx`
- [Tutor requests](https://github.com/noah35802/edugen/blob/main/src/services/aiTutorService.ts): `src/services/aiTutorService.ts`
- [Quiz and study features](https://github.com/noah35802/edugen/blob/main/src/pages/student/AIFeaturePages.tsx): `src/pages/student/AIFeaturePages.tsx`

### Platform API

- [Express API](https://github.com/noah35802/edugen/blob/main/backend/src/server.js): `backend/src/server.js`
- [Auth routes](https://github.com/noah35802/edugen/blob/main/backend/src/routes/auth.js): `backend/src/routes/auth.js`
- [Auth controller](https://github.com/noah35802/edugen/blob/main/backend/src/controllers/authController.js): `backend/src/controllers/authController.js`
- [Tutor routes](https://github.com/noah35802/edugen/blob/main/backend/src/routes/aiTutor.js): `backend/src/routes/aiTutor.js`
- [Tutor controller](https://github.com/noah35802/edugen/blob/main/backend/src/controllers/aiTutorController.js): `backend/src/controllers/aiTutorController.js`
- [RAG adapter](https://github.com/noah35802/edugen/blob/main/backend/src/services/ragService.js): `backend/src/services/ragService.js`

### RAG tutoring

- [RAG API](https://github.com/noah35802/edugen/blob/main/rag_service/app/api/routes.py): `rag_service/app/api/routes.py`
- [Document ingestion](https://github.com/noah35802/edugen/blob/main/rag_service/app/ingestion/pipeline.py): `rag_service/app/ingestion/pipeline.py`
- [File loaders](https://github.com/noah35802/edugen/blob/main/rag_service/app/ingestion/loaders.py): `rag_service/app/ingestion/loaders.py`
- [Vector index](https://github.com/noah35802/edugen/blob/main/rag_service/app/retrieval/vector_store.py): `rag_service/app/retrieval/vector_store.py`
- [Question answering](https://github.com/noah35802/edugen/blob/main/rag_service/app/generation/chain.py): `rag_service/app/generation/chain.py`
- [Language model](https://github.com/noah35802/edugen/blob/main/rag_service/app/generation/llm.py): `rag_service/app/generation/llm.py`
- [Embeddings](https://github.com/noah35802/edugen/blob/main/rag_service/app/retrieval/embeddings.py): `rag_service/app/retrieval/embeddings.py`

### AI learning services

- [Quiz generation API](https://github.com/noah35802/edugen/blob/main/quiz-service/app/main.py): `quiz-service/app/main.py`
- [Quiz generator](https://github.com/noah35802/edugen/blob/main/quiz-service/app/generator.py): `quiz-service/app/generator.py`
- [AI feature routes](https://github.com/noah35802/edugen/tree/main/ai-service/routes): `ai-service/routes`

### Persistence and models

- [PostgreSQL](https://github.com/noah35802/edugen/blob/main/backend/src/db.js): `backend/src/db.js`
- [User records](https://github.com/noah35802/edugen/blob/main/backend/src/models/userModel.js): `backend/src/models/userModel.js`

### Other components

- **Learners and staff**

## Connections

- Learners and staff → Role-based pages: uses (evidence: `src/routes/App.tsx`)
- Role-based pages → Authentication UI: routes to (evidence: `src/routes/App.tsx`)
- Authentication UI → Auth state: dispatches (evidence: `src/pages/auth/AuthPages.tsx`)
- Auth state → Auth requests: calls (evidence: `src/store/slices/authSlice.ts`)
- Auth requests → API client: sends requests (evidence: `src/services/authService.ts`)
- Role-based pages → Student learning: routes to (evidence: `src/routes/App.tsx`)
- Role-based pages → Tutor and materials: routes to (evidence: `src/routes/App.tsx`)
- Role-based pages → Quiz and study features: routes to (evidence: `src/routes/App.tsx`)
- Shared materials → Tutor requests: calls (evidence: `src/components/courses/CourseMaterialsManager.tsx`)
- Tutor and materials → Tutor requests: uses
- Tutor requests → API client: sends requests (evidence: `src/services/aiTutorService.ts`)
- API client → Express API: calls API
- Express API → Auth routes: mounts (evidence: `backend/src/server.js`)
- Auth routes → Auth controller: dispatches (evidence: `backend/src/routes/auth.js`)
- Auth controller → User records: uses (evidence: `backend/src/controllers/authController.js`)
- User records → PostgreSQL: queries (evidence: `backend/src/models/userModel.js`)
- Express API → Tutor routes: mounts
- Tutor routes → Tutor controller: dispatches
- Tutor controller → RAG adapter: calls (evidence: `backend/src/controllers/aiTutorController.js`)
- RAG adapter → RAG API: HTTP requests (evidence: `backend/src/services/ragService.js`)
- RAG API → Document ingestion: calls (evidence: `rag_service/app/api/routes.py`)
- Document ingestion → File loaders: loads files (evidence: `rag_service/app/ingestion/pipeline.py`)
- Document ingestion → Vector index: stores chunks (evidence: `rag_service/app/ingestion/pipeline.py`)
- RAG API → Vector index: lists and deletes (evidence: `rag_service/app/api/routes.py`)
- RAG API → Question answering: calls (evidence: `rag_service/app/api/routes.py`)
- Question answering → Vector index: retrieves context (evidence: `rag_service/app/generation/chain.py`)
- Question answering → Language model: calls (evidence: `rag_service/app/generation/chain.py`)
- Vector index → Embeddings: embeds queries (evidence: `rag_service/app/retrieval/vector_store.py`)
- Quiz and study features → Quiz generation API: uses service
- Quiz generation API → Quiz generator: calls (evidence: `quiz-service/app/main.py`)
- Quiz and study features → AI feature routes: AI features
