# eduai-lab/eduai architecture

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

- Interactive diagram: https://gitdiagram.com/eduai-lab/eduai
- Repository: https://github.com/eduai-lab/eduai

## Overview

EduAI is a UBC course-delivery platform whose central Core app provides course-aware AI chat and APIs, alongside AI Tutor and Question Maker extensions. A learner selects a course, submits a chat request, and receives an AI response grounded in course materials; staff also manage courses, integrations, and platform settings. The README documents the product capabilities and extension integrations; sampled implementation excerpts are limited, so internal call paths are not inferred beyond those documented relationships.

Main entry points: [`apps/core/app/routes/api/chat.ts`](https://github.com/eduai-lab/eduai/blob/main/apps/core/app/routes/api/chat.ts) (Core API), [`apps/core/app/lib/chat/chat-route.server.ts`](https://github.com/eduai-lab/eduai/blob/main/apps/core/app/lib/chat/chat-route.server.ts) (Chat and RAG), [`apps/core/app/lib/courses/server.ts`](https://github.com/eduai-lab/eduai/blob/main/apps/core/app/lib/courses/server.ts) (Courses and materials), [`apps/core/app/components/courses/course-detail-manager-view.tsx`](https://github.com/eduai-lab/eduai/blob/main/apps/core/app/components/courses/course-detail-manager-view.tsx) (Course management)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_core["Core learning platform"]
  node_core_ui["Core web app<br/>[chat-screen.tsx]"]
  node_course_admin["Course management"]
  node_core_api["Core API<br/>[chat.ts]"]
  node_auth["Authentication<br/>[server.ts]"]
  node_course_data[("Courses and materials<br/>[server.ts]")]
end

subgraph group_ai["AI and retrieval"]
  node_chat_pipeline["Chat and RAG"]
  node_material_ingest["Material processing"]
  node_embeddings["Embeddings<br/>[embedding.ts]"]
  node_model_routing["Model routing<br/>[router.ts]"]
  node_providers["AI providers"]
end

subgraph group_extensions["Educational extensions"]
  node_ai_tutor["AI Tutor<br/>[app.js]"]
  node_question_maker["Question Maker<br/>[App.tsx]"]
  node_qm_backend["Question Maker API<br/>[authService.js]"]
end

subgraph group_shared["Shared services"]
  node_shared_ui["Shared UI library"]
  node_shared_types["Shared types<br/>[errors.ts]"]
end

node_learner(("Learner or staff"))
node_canvas["Canvas LMS"]
node_database[("PostgreSQL")]
node_ai_services["AI service providers"]

node_learner -->|"uses"| node_core_ui
node_core_ui -->|"submits chat"| node_core_api
node_core_api -.->|"authenticates"| node_auth
node_core_api -->|"handles chat"| node_chat_pipeline
node_chat_pipeline -->|"retrieves course context"| node_course_data
node_course_admin -.->|"manages courses"| node_course_data
node_course_admin -->|"syncs materials"| node_canvas
node_material_ingest -.->|"creates embeddings"| node_embeddings
node_embeddings -.->|"indexes materials"| node_course_data
node_chat_pipeline -->|"selects model"| node_model_routing
node_model_routing -.->|"routes inference"| node_providers
node_providers -.->|"requests completion"| node_ai_services
node_ai_tutor -->|"integrates with"| node_core_api
node_qm_backend -->|"integrates with"| node_core_api
node_question_maker -.->|"uses API"| node_qm_backend
node_ai_tutor -.->|"uses shared components"| node_shared_ui
node_question_maker -->|"uses shared components"| node_shared_ui
node_core_api -.->|"persists platform data"| node_database

click node_core_ui "https://github.com/eduai-lab/eduai/blob/main/apps/core/app/components/chat/chat-screen.tsx"
click node_course_admin "https://github.com/eduai-lab/eduai/blob/main/apps/core/app/components/courses/course-detail-manager-view.tsx"
click node_core_api "https://github.com/eduai-lab/eduai/blob/main/apps/core/app/routes/api/chat.ts"
click node_auth "https://github.com/eduai-lab/eduai/blob/main/apps/core/app/lib/auth/server.ts"
click node_course_data "https://github.com/eduai-lab/eduai/blob/main/apps/core/app/lib/courses/server.ts"
click node_chat_pipeline "https://github.com/eduai-lab/eduai/blob/main/apps/core/app/lib/chat/chat-route.server.ts"
click node_material_ingest "https://github.com/eduai-lab/eduai/blob/main/apps/core/app/lib/materials/extraction-job.server.ts"
click node_embeddings "https://github.com/eduai-lab/eduai/blob/main/apps/core/app/lib/ai/embedding.ts"
click node_model_routing "https://github.com/eduai-lab/eduai/blob/main/apps/core/app/lib/ai/routing/router.ts"
click node_providers "https://github.com/eduai-lab/eduai/blob/main/apps/core/app/lib/ai/providers.server.ts"
click node_ai_tutor "https://github.com/eduai-lab/eduai/blob/main/apps/extensions/ai-tutor/server/src/app.js"
click node_question_maker "https://github.com/eduai-lab/eduai/blob/main/apps/extensions/question-maker/app/frontend/src/App.tsx"
click node_qm_backend "https://github.com/eduai-lab/eduai/blob/main/apps/extensions/question-maker/app/backend/src/services/authService.js"
click node_shared_ui "https://github.com/eduai-lab/eduai/blob/main/packages/ui/src/ai-service-indicators.tsx"
click node_shared_types "https://github.com/eduai-lab/eduai/blob/main/packages/types/src/errors.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_core_ui,node_course_admin,node_core_api,node_auth,node_course_data toneBlue
class node_chat_pipeline,node_material_ingest,node_embeddings,node_model_routing,node_providers,node_database toneAmber
class node_ai_tutor,node_question_maker,node_qm_backend toneMint
class node_shared_ui,node_shared_types toneRose
class node_learner,node_canvas,node_ai_services toneIndigo
```

## Components

### Core learning platform

- [Core web app](https://github.com/eduai-lab/eduai/blob/main/apps/core/app/components/chat/chat-screen.tsx): `apps/core/app/components/chat/chat-screen.tsx`
- [Course management](https://github.com/eduai-lab/eduai/blob/main/apps/core/app/components/courses/course-detail-manager-view.tsx): `apps/core/app/components/courses/course-detail-manager-view.tsx`
- [Core API](https://github.com/eduai-lab/eduai/blob/main/apps/core/app/routes/api/chat.ts): `apps/core/app/routes/api/chat.ts`
- [Authentication](https://github.com/eduai-lab/eduai/blob/main/apps/core/app/lib/auth/server.ts): `apps/core/app/lib/auth/server.ts`
- [Courses and materials](https://github.com/eduai-lab/eduai/blob/main/apps/core/app/lib/courses/server.ts): `apps/core/app/lib/courses/server.ts`

### AI and retrieval

- [Chat and RAG](https://github.com/eduai-lab/eduai/blob/main/apps/core/app/lib/chat/chat-route.server.ts): `apps/core/app/lib/chat/chat-route.server.ts`
- [Material processing](https://github.com/eduai-lab/eduai/blob/main/apps/core/app/lib/materials/extraction-job.server.ts): `apps/core/app/lib/materials/extraction-job.server.ts`
- [Embeddings](https://github.com/eduai-lab/eduai/blob/main/apps/core/app/lib/ai/embedding.ts): `apps/core/app/lib/ai/embedding.ts`
- [Model routing](https://github.com/eduai-lab/eduai/blob/main/apps/core/app/lib/ai/routing/router.ts): `apps/core/app/lib/ai/routing/router.ts`
- [AI providers](https://github.com/eduai-lab/eduai/blob/main/apps/core/app/lib/ai/providers.server.ts): `apps/core/app/lib/ai/providers.server.ts`

### Educational extensions

- [AI Tutor](https://github.com/eduai-lab/eduai/blob/main/apps/extensions/ai-tutor/server/src/app.js): `apps/extensions/ai-tutor/server/src/app.js`
- [Question Maker](https://github.com/eduai-lab/eduai/blob/main/apps/extensions/question-maker/app/frontend/src/App.tsx): `apps/extensions/question-maker/app/frontend/src/App.tsx`
- [Question Maker API](https://github.com/eduai-lab/eduai/blob/main/apps/extensions/question-maker/app/backend/src/services/authService.js): `apps/extensions/question-maker/app/backend/src/services/authService.js`

### Shared services

- [Shared UI library](https://github.com/eduai-lab/eduai/blob/main/packages/ui/src/ai-service-indicators.tsx): `packages/ui/src/ai-service-indicators.tsx`
- [Shared types](https://github.com/eduai-lab/eduai/blob/main/packages/types/src/errors.ts): `packages/types/src/errors.ts`

### Other components

- **Learner or staff**
- **Canvas LMS**
- **PostgreSQL**
- **AI service providers**

## Connections

- Learner or staff → Core web app: uses
- Core web app → Core API: submits chat
- Core API → Authentication: authenticates
- Core API → Chat and RAG: handles chat
- Chat and RAG → Courses and materials: retrieves course context
- Course management → Courses and materials: manages courses
- Course management → Canvas LMS: syncs materials
- Material processing → Embeddings: creates embeddings
- Embeddings → Courses and materials: indexes materials
- Chat and RAG → Model routing: selects model
- Model routing → AI providers: routes inference
- AI providers → AI service providers: requests completion
- AI Tutor → Core API: integrates with
- Question Maker API → Core API: integrates with
- Question Maker → Question Maker API: uses API
- AI Tutor → Shared UI library: uses shared components
- Question Maker → Shared UI library: uses shared components
- Core API → PostgreSQL: persists platform data
