# quitlightfe/code-school architecture

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

- Interactive diagram: https://gitdiagram.com/quitlightfe/code-school
- Repository: https://github.com/quitlightfe/code-school

## Overview

This is a localized Next.js learning frontend for authentication, course browsing, task work, and submission review. The main learner flow is login/register, browse courses, open course tasks, edit and save or submit code, then view submission status; task and course pages call dedicated API services. Separate UI covers dashboard, profile, and settings, while shared auth/token and API layers support requests. The README only describes the default Next.js setup; several page implementations were not sampled, so their internal links are omitted unless the source index documents them.

Main entry points: [`src/lib/api.ts`](https://github.com/quitlightfe/code-school/blob/admin/src/lib/api.ts) (HTTP API client), [`src/providers/AuthProvider.tsx`](https://github.com/quitlightfe/code-school/blob/admin/src/providers/AuthProvider.tsx) (Auth provider), [`src/app/[locale]/courses/[courseId]/page.tsx`](https://github.com/quitlightfe/code-school/blob/admin/src/app/%5Blocale%5D/courses/%5BcourseId%5D/page.tsx) (Course detail), [`src/app/[locale]/tasks/page.tsx`](https://github.com/quitlightfe/code-school/blob/admin/src/app/%5Blocale%5D/tasks/page.tsx) (Task list)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_experience["Learner experience"]
  node_landing["Landing experience<br/>[page.tsx]"]
  node_course_catalog["Course catalog<br/>[page.tsx]"]
  node_course_detail["Course detail<br/>[page.tsx]"]
  node_task_catalog["Task list<br/>[page.tsx]"]
  node_task_detail["Task workspace<br/>[page.tsx]"]
  node_dashboard["Dashboard<br/>[page.tsx]"]
  node_profile["Profile<br/>[page.tsx]"]
  node_settings["Settings<br/>[page.tsx]"]
end

subgraph group_identity["Identity and navigation"]
  node_auth_pages["Login and registration<br/>[page.tsx]"]
  node_auth_state["Auth provider<br/>[AuthProvider.tsx]"]
  node_auth_service["Authentication service<br/>[auth.service.ts]"]
  node_token_store[("Token storage<br/>[tokens.ts]")]
  node_localized_routing["Localized routing<br/>[routing.ts]"]
end

subgraph group_domain["Learning domain"]
  node_course_service["Course service<br/>[courses.service.ts]"]
  node_task_service["Task service<br/>[tasks.service.ts]"]
  node_submission_service["Submission service"]
end

subgraph group_platform["Client platform"]
  node_query_hook["API query hook<br/>[useApiQuery.ts]"]
  node_api_client["HTTP API client<br/>[api.ts]"]
  node_interceptors["Request interceptors<br/>[interceptors.ts]"]
end

node_visitor(("Visitor / learner"))
node_backend[("Learning API backend")]

node_visitor -->|"opens"| node_landing
node_visitor -->|"authenticates"| node_auth_pages
node_auth_pages -->|"uses auth"| node_auth_state
node_auth_state -->|"calls"| node_auth_service
node_auth_state -->|"stores tokens"| node_token_store
node_auth_service -->|"sends requests"| node_api_client
node_api_client -.->|"calls API"| node_backend
node_visitor -->|"browses"| node_course_catalog
node_course_catalog -->|"loads courses"| node_course_service
node_course_detail -->|"loads course"| node_course_service
node_course_detail -->|"loads tasks"| node_task_service
node_course_detail -->|"loads submissions"| node_submission_service
node_visitor -->|"opens tasks"| node_task_catalog
node_task_catalog -->|"loads tasks"| node_task_service
node_task_catalog -->|"loads submissions"| node_submission_service
node_task_catalog -->|"loads user"| node_auth_service
node_visitor -->|"opens workspace"| node_task_detail
node_task_detail -->|"loads task"| node_task_service
node_task_detail -->|"saves or submits"| node_submission_service
node_course_service -->|"sends requests"| node_api_client
node_task_service -->|"sends requests"| node_api_client
node_submission_service -->|"sends requests"| node_api_client
node_interceptors -->|"configures"| node_api_client
node_interceptors -->|"reads tokens"| node_token_store
node_course_catalog -->|"queries with"| node_query_hook
node_course_detail -->|"queries with"| node_query_hook
node_visitor -->|"opens"| node_dashboard
node_visitor -->|"opens"| node_profile
node_profile -->|"reads account"| node_auth_state
node_visitor -->|"opens"| node_settings
node_settings -->|"reads account"| node_auth_state
node_localized_routing -.->|"localizes pages"| node_landing

click node_landing "https://github.com/quitlightfe/code-school/blob/admin/src/app/%5Blocale%5D/page.tsx"
click node_course_catalog "https://github.com/quitlightfe/code-school/blob/admin/src/app/%5Blocale%5D/courses/page.tsx"
click node_course_detail "https://github.com/quitlightfe/code-school/blob/admin/src/app/%5Blocale%5D/courses/%5BcourseId%5D/page.tsx"
click node_task_catalog "https://github.com/quitlightfe/code-school/blob/admin/src/app/%5Blocale%5D/tasks/page.tsx"
click node_task_detail "https://github.com/quitlightfe/code-school/blob/admin/src/app/%5Blocale%5D/tasks/%5BtaskId%5D/page.tsx"
click node_dashboard "https://github.com/quitlightfe/code-school/blob/admin/src/app/%5Blocale%5D/dashboard/page.tsx"
click node_profile "https://github.com/quitlightfe/code-school/blob/admin/src/app/%5Blocale%5D/profile/page.tsx"
click node_settings "https://github.com/quitlightfe/code-school/blob/admin/src/app/%5Blocale%5D/settings/page.tsx"
click node_auth_pages "https://github.com/quitlightfe/code-school/blob/admin/src/app/%5Blocale%5D/(auth)/login/page.tsx"
click node_auth_state "https://github.com/quitlightfe/code-school/blob/admin/src/providers/AuthProvider.tsx"
click node_auth_service "https://github.com/quitlightfe/code-school/blob/admin/src/services/auth.service.ts"
click node_token_store "https://github.com/quitlightfe/code-school/blob/admin/src/lib/tokens.ts"
click node_localized_routing "https://github.com/quitlightfe/code-school/blob/admin/src/i18n/routing.ts"
click node_course_service "https://github.com/quitlightfe/code-school/blob/admin/src/services/courses.service.ts"
click node_task_service "https://github.com/quitlightfe/code-school/blob/admin/src/services/tasks.service.ts"
click node_submission_service "https://github.com/quitlightfe/code-school/blob/admin/src/services/submissions.service.ts"
click node_query_hook "https://github.com/quitlightfe/code-school/blob/admin/src/hooks/useApiQuery.ts"
click node_api_client "https://github.com/quitlightfe/code-school/blob/admin/src/lib/api.ts"
click node_interceptors "https://github.com/quitlightfe/code-school/blob/admin/src/lib/interceptors.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_landing,node_course_catalog,node_course_detail,node_task_catalog,node_task_detail,node_dashboard,node_profile,node_settings toneBlue
class node_auth_pages,node_auth_state,node_auth_service,node_token_store,node_localized_routing,node_backend toneAmber
class node_course_service,node_task_service,node_submission_service toneMint
class node_query_hook,node_api_client,node_interceptors toneRose
class node_visitor toneIndigo
```

## Components

### Learner experience

- [Landing experience](https://github.com/quitlightfe/code-school/blob/admin/src/app/%5Blocale%5D/page.tsx): `src/app/[locale]/page.tsx`
- [Course catalog](https://github.com/quitlightfe/code-school/blob/admin/src/app/%5Blocale%5D/courses/page.tsx): `src/app/[locale]/courses/page.tsx`
- [Course detail](https://github.com/quitlightfe/code-school/blob/admin/src/app/%5Blocale%5D/courses/%5BcourseId%5D/page.tsx): `src/app/[locale]/courses/[courseId]/page.tsx`
- [Task list](https://github.com/quitlightfe/code-school/blob/admin/src/app/%5Blocale%5D/tasks/page.tsx): `src/app/[locale]/tasks/page.tsx`
- [Task workspace](https://github.com/quitlightfe/code-school/blob/admin/src/app/%5Blocale%5D/tasks/%5BtaskId%5D/page.tsx): `src/app/[locale]/tasks/[taskId]/page.tsx`
- [Dashboard](https://github.com/quitlightfe/code-school/blob/admin/src/app/%5Blocale%5D/dashboard/page.tsx): `src/app/[locale]/dashboard/page.tsx`
- [Profile](https://github.com/quitlightfe/code-school/blob/admin/src/app/%5Blocale%5D/profile/page.tsx): `src/app/[locale]/profile/page.tsx`
- [Settings](https://github.com/quitlightfe/code-school/blob/admin/src/app/%5Blocale%5D/settings/page.tsx): `src/app/[locale]/settings/page.tsx`

### Identity and navigation

- [Login and registration](https://github.com/quitlightfe/code-school/blob/admin/src/app/%5Blocale%5D/(auth)/login/page.tsx): `src/app/[locale]/(auth)/login/page.tsx`
- [Auth provider](https://github.com/quitlightfe/code-school/blob/admin/src/providers/AuthProvider.tsx): `src/providers/AuthProvider.tsx`
- [Authentication service](https://github.com/quitlightfe/code-school/blob/admin/src/services/auth.service.ts): `src/services/auth.service.ts`
- [Token storage](https://github.com/quitlightfe/code-school/blob/admin/src/lib/tokens.ts): `src/lib/tokens.ts`
- [Localized routing](https://github.com/quitlightfe/code-school/blob/admin/src/i18n/routing.ts): `src/i18n/routing.ts`

### Learning domain

- [Course service](https://github.com/quitlightfe/code-school/blob/admin/src/services/courses.service.ts): `src/services/courses.service.ts`
- [Task service](https://github.com/quitlightfe/code-school/blob/admin/src/services/tasks.service.ts): `src/services/tasks.service.ts`
- [Submission service](https://github.com/quitlightfe/code-school/blob/admin/src/services/submissions.service.ts): `src/services/submissions.service.ts`

### Client platform

- [API query hook](https://github.com/quitlightfe/code-school/blob/admin/src/hooks/useApiQuery.ts): `src/hooks/useApiQuery.ts`
- [HTTP API client](https://github.com/quitlightfe/code-school/blob/admin/src/lib/api.ts): `src/lib/api.ts`
- [Request interceptors](https://github.com/quitlightfe/code-school/blob/admin/src/lib/interceptors.ts): `src/lib/interceptors.ts`

### Other components

- **Visitor / learner**
- **Learning API backend**

## Connections

- Visitor / learner → Landing experience: opens (evidence: `src/app/[locale]/page.tsx`)
- Visitor / learner → Login and registration: authenticates (evidence: `src/app/[locale]/(auth)/login/page.tsx`)
- Login and registration → Auth provider: uses auth (evidence: `src/app/[locale]/(auth)/login/page.tsx`)
- Auth provider → Authentication service: calls (evidence: `src/providers/AuthProvider.tsx`)
- Auth provider → Token storage: stores tokens (evidence: `src/providers/AuthProvider.tsx`)
- Authentication service → HTTP API client: sends requests (evidence: `src/services/auth.service.ts`)
- HTTP API client → Learning API backend: calls API
- Visitor / learner → Course catalog: browses (evidence: `src/app/[locale]/courses/page.tsx`)
- Course catalog → Course service: loads courses (evidence: `src/app/[locale]/courses/page.tsx`)
- Course detail → Course service: loads course (evidence: `src/app/[locale]/courses/[courseId]/page.tsx`)
- Course detail → Task service: loads tasks (evidence: `src/app/[locale]/courses/[courseId]/page.tsx`)
- Course detail → Submission service: loads submissions (evidence: `src/app/[locale]/courses/[courseId]/page.tsx`)
- Visitor / learner → Task list: opens tasks (evidence: `src/app/[locale]/tasks/page.tsx`)
- Task list → Task service: loads tasks (evidence: `src/app/[locale]/tasks/page.tsx`)
- Task list → Submission service: loads submissions (evidence: `src/app/[locale]/tasks/page.tsx`)
- Task list → Authentication service: loads user (evidence: `src/app/[locale]/tasks/page.tsx`)
- Visitor / learner → Task workspace: opens workspace (evidence: `src/app/[locale]/tasks/[taskId]/page.tsx`)
- Task workspace → Task service: loads task (evidence: `src/app/[locale]/tasks/[taskId]/page.tsx`)
- Task workspace → Submission service: saves or submits (evidence: `src/app/[locale]/tasks/[taskId]/page.tsx`)
- Course service → HTTP API client: sends requests (evidence: `src/services/courses.service.ts`)
- Task service → HTTP API client: sends requests (evidence: `src/services/tasks.service.ts`)
- Submission service → HTTP API client: sends requests (evidence: `src/services/submissions.service.ts`)
- Request interceptors → HTTP API client: configures (evidence: `src/lib/interceptors.ts`)
- Request interceptors → Token storage: reads tokens (evidence: `src/lib/interceptors.ts`)
- Course catalog → API query hook: queries with (evidence: `src/app/[locale]/courses/page.tsx`)
- Course detail → API query hook: queries with (evidence: `src/app/[locale]/courses/[courseId]/page.tsx`)
- Visitor / learner → Dashboard: opens (evidence: `src/app/[locale]/dashboard/page.tsx`)
- Visitor / learner → Profile: opens (evidence: `src/app/[locale]/profile/page.tsx`)
- Profile → Auth provider: reads account (evidence: `src/app/[locale]/profile/page.tsx`)
- Visitor / learner → Settings: opens (evidence: `src/app/[locale]/settings/page.tsx`)
- Settings → Auth provider: reads account (evidence: `src/app/[locale]/settings/page.tsx`)
- Localized routing → Landing experience: localizes pages
