# developedbymarc/csc263-openacademyfrontend architecture

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

- Interactive diagram: https://gitdiagram.com/developedbymarc/csc263-openacademyfrontend
- Repository: https://github.com/developedbymarc/csc263-openacademyfrontend

## Overview

OpenAcademy is a SvelteKit learning platform for discovering courses, enrolling in and viewing lessons, managing accounts, and creating courses. Its principal user journey runs from course exploration into a course and lesson view; authentication and staff dashboards are distinct branches. The repository contains server-side route handlers, a server API layer, and a generated API client. README-documented media handling and Markdown sanitization are included, but their exact implementation call sites were not sampled, so those relationships are shown as unverified.

Main entry points: [`src/routes/(private)`](https://github.com/developedbymarc/csc263-openacademyfrontend/tree/main/src/routes/(private)) (Private routes), [`src/lib/api/apis`](https://github.com/developedbymarc/csc263-openacademyfrontend/tree/main/src/lib/api/apis) (Generated API operations), [`src/lib/pages/Course`](https://github.com/developedbymarc/csc263-openacademyfrontend/tree/main/src/lib/pages/Course) (Course and lessons), [`src/lib/server/api.ts`](https://github.com/developedbymarc/csc263-openacademyfrontend/blob/main/src/lib/server/api.ts) (Server API facade)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_routes["SvelteKit routes"]
  node_public_routes["Public routes"]
  node_auth_routes["Authentication routes"]
  node_private_routes["Private routes"]
end

subgraph group_experience["Learning experience"]
  node_explore_ui["Course exploration<br/>[Explore.svelte]"]
  node_course_ui["Course and lessons"]
  node_create_ui["Course authoring"]
  node_dashboard_ui["Staff dashboard"]
  node_auth_ui["Sign-in forms"]
end

subgraph group_server["Server and domain"]
  node_form_validation["Form validation<br/>[forms.ts]"]
  node_server_api["Server API facade<br/>[api.ts]"]
  node_server_auth["Auth utilities<br/>[auth-utils.ts]"]
  node_course_types["Course domain types<br/>[course.ts]"]
  node_user_types["User and enrollment types<br/>[user.ts]"]
  node_markdown["Markdown rendering<br/>[markdown.ts]"]
end

subgraph group_client["API client"]
  node_generated_apis["Generated API operations"]
  node_api_runtime["HTTP client runtime<br/>[runtime.ts]"]
  node_api_models["API data models"]
  node_lesson_media["Lesson asset service<br/>[LessonAssetsApi.ts]"]
end

node_visitor(("Learner or staff"))
node_backend{{"OpenAcademy API"}}

node_visitor -.->|"visits"| node_public_routes
node_visitor -.->|"authenticates"| node_auth_routes
node_visitor -.->|"uses"| node_private_routes
node_public_routes -.->|"renders"| node_explore_ui
node_private_routes -.->|"renders"| node_course_ui
node_private_routes -.->|"renders"| node_create_ui
node_private_routes -.->|"renders"| node_dashboard_ui
node_auth_routes -.->|"renders"| node_auth_ui
node_auth_ui -.->|"validates with"| node_form_validation
node_create_ui -.->|"validates with"| node_form_validation
node_server_api -.->|"loads identity"| node_server_auth
node_server_api -.->|"calls"| node_generated_apis
node_generated_apis -->|"uses"| node_api_runtime
node_generated_apis -->|"converts responses"| node_api_models
node_generated_apis -.->|"sends requests"| node_backend
node_lesson_media -.->|"uploads assets"| node_backend
node_course_ui -.->|"renders sanitized"| node_markdown
node_course_ui -.->|"loads assets"| node_lesson_media
node_course_types -->|"referenced by"| node_user_types

click node_public_routes "https://github.com/developedbymarc/csc263-openacademyfrontend/tree/main/src/routes"
click node_auth_routes "https://github.com/developedbymarc/csc263-openacademyfrontend/tree/main/src/routes/auth"
click node_private_routes "https://github.com/developedbymarc/csc263-openacademyfrontend/tree/main/src/routes/(private)"
click node_explore_ui "https://github.com/developedbymarc/csc263-openacademyfrontend/blob/main/src/lib/pages/Explore/Explore.svelte"
click node_course_ui "https://github.com/developedbymarc/csc263-openacademyfrontend/tree/main/src/lib/pages/Course"
click node_create_ui "https://github.com/developedbymarc/csc263-openacademyfrontend/tree/main/src/lib/pages/CourseCreation"
click node_dashboard_ui "https://github.com/developedbymarc/csc263-openacademyfrontend/tree/main/src/lib/pages/Dashboard"
click node_auth_ui "https://github.com/developedbymarc/csc263-openacademyfrontend/tree/main/src/lib/pages/Auth"
click node_form_validation "https://github.com/developedbymarc/csc263-openacademyfrontend/blob/main/src/lib/forms.ts"
click node_server_api "https://github.com/developedbymarc/csc263-openacademyfrontend/blob/main/src/lib/server/api.ts"
click node_server_auth "https://github.com/developedbymarc/csc263-openacademyfrontend/blob/main/src/lib/server/auth-utils.ts"
click node_course_types "https://github.com/developedbymarc/csc263-openacademyfrontend/blob/main/src/lib/types/entities/course.ts"
click node_user_types "https://github.com/developedbymarc/csc263-openacademyfrontend/blob/main/src/lib/types/entities/user.ts"
click node_markdown "https://github.com/developedbymarc/csc263-openacademyfrontend/blob/main/src/lib/utils/markdown.ts"
click node_generated_apis "https://github.com/developedbymarc/csc263-openacademyfrontend/tree/main/src/lib/api/apis"
click node_api_runtime "https://github.com/developedbymarc/csc263-openacademyfrontend/blob/main/src/lib/api/runtime.ts"
click node_api_models "https://github.com/developedbymarc/csc263-openacademyfrontend/tree/main/src/lib/api/models"
click node_lesson_media "https://github.com/developedbymarc/csc263-openacademyfrontend/blob/main/src/lib/api/apis/LessonAssetsApi.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_public_routes,node_auth_routes,node_private_routes toneBlue
class node_explore_ui,node_course_ui,node_create_ui,node_dashboard_ui,node_auth_ui toneAmber
class node_form_validation,node_server_api,node_server_auth,node_course_types,node_user_types,node_markdown,node_backend toneMint
class node_generated_apis,node_api_runtime,node_api_models,node_lesson_media toneRose
class node_visitor toneIndigo
```

## Components

### SvelteKit routes

- [Public routes](https://github.com/developedbymarc/csc263-openacademyfrontend/tree/main/src/routes): `src/routes`
- [Authentication routes](https://github.com/developedbymarc/csc263-openacademyfrontend/tree/main/src/routes/auth): `src/routes/auth`
- [Private routes](https://github.com/developedbymarc/csc263-openacademyfrontend/tree/main/src/routes/(private)): `src/routes/(private)`

### Learning experience

- [Course exploration](https://github.com/developedbymarc/csc263-openacademyfrontend/blob/main/src/lib/pages/Explore/Explore.svelte): `src/lib/pages/Explore/Explore.svelte`
- [Course and lessons](https://github.com/developedbymarc/csc263-openacademyfrontend/tree/main/src/lib/pages/Course): `src/lib/pages/Course`
- [Course authoring](https://github.com/developedbymarc/csc263-openacademyfrontend/tree/main/src/lib/pages/CourseCreation): `src/lib/pages/CourseCreation`
- [Staff dashboard](https://github.com/developedbymarc/csc263-openacademyfrontend/tree/main/src/lib/pages/Dashboard): `src/lib/pages/Dashboard`
- [Sign-in forms](https://github.com/developedbymarc/csc263-openacademyfrontend/tree/main/src/lib/pages/Auth): `src/lib/pages/Auth`

### Server and domain

- [Form validation](https://github.com/developedbymarc/csc263-openacademyfrontend/blob/main/src/lib/forms.ts): `src/lib/forms.ts`
- [Server API facade](https://github.com/developedbymarc/csc263-openacademyfrontend/blob/main/src/lib/server/api.ts): `src/lib/server/api.ts`
- [Auth utilities](https://github.com/developedbymarc/csc263-openacademyfrontend/blob/main/src/lib/server/auth-utils.ts): `src/lib/server/auth-utils.ts`
- [Course domain types](https://github.com/developedbymarc/csc263-openacademyfrontend/blob/main/src/lib/types/entities/course.ts): `src/lib/types/entities/course.ts`
- [User and enrollment types](https://github.com/developedbymarc/csc263-openacademyfrontend/blob/main/src/lib/types/entities/user.ts): `src/lib/types/entities/user.ts`
- [Markdown rendering](https://github.com/developedbymarc/csc263-openacademyfrontend/blob/main/src/lib/utils/markdown.ts): `src/lib/utils/markdown.ts`

### API client

- [Generated API operations](https://github.com/developedbymarc/csc263-openacademyfrontend/tree/main/src/lib/api/apis): `src/lib/api/apis`
- [HTTP client runtime](https://github.com/developedbymarc/csc263-openacademyfrontend/blob/main/src/lib/api/runtime.ts): `src/lib/api/runtime.ts`
- [API data models](https://github.com/developedbymarc/csc263-openacademyfrontend/tree/main/src/lib/api/models): `src/lib/api/models`
- [Lesson asset service](https://github.com/developedbymarc/csc263-openacademyfrontend/blob/main/src/lib/api/apis/LessonAssetsApi.ts): `src/lib/api/apis/LessonAssetsApi.ts`

### Other components

- **Learner or staff**
- **OpenAcademy API**

## Connections

- Learner or staff → Public routes: visits
- Learner or staff → Authentication routes: authenticates
- Learner or staff → Private routes: uses
- Public routes → Course exploration: renders
- Private routes → Course and lessons: renders
- Private routes → Course authoring: renders
- Private routes → Staff dashboard: renders
- Authentication routes → Sign-in forms: renders
- Sign-in forms → Form validation: validates with
- Course authoring → Form validation: validates with
- Server API facade → Auth utilities: loads identity (evidence: `README.md`)
- Server API facade → Generated API operations: calls
- Generated API operations → HTTP client runtime: uses (evidence: `src/lib/api/apis/AuthApi.ts`)
- Generated API operations → API data models: converts responses (evidence: `src/lib/api/apis/AuthApi.ts`)
- Generated API operations → OpenAcademy API: sends requests
- Lesson asset service → OpenAcademy API: uploads assets (evidence: `README.md`)
- Course and lessons → Markdown rendering: renders sanitized (evidence: `README.md`)
- Course and lessons → Lesson asset service: loads assets (evidence: `README.md`)
- Course domain types → User and enrollment types: referenced by (evidence: `src/lib/types/entities/user.ts`)
