# niaefeup/tts-fe architecture

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

- Interactive diagram: https://gitdiagram.com/niaefeup/tts-fe
- Repository: https://github.com/niaefeup/tts-fe

## Overview

Time Table Selector is a student-facing schedule planner with a separate class-exchange workflow. Students choose courses and class options, compare schedules, and can save planner state locally. The exchange page brings together schedule viewing, request creation and browsing, and course-unit enrollment; authenticated administration provides request and settings views. The graph reflects documented routes and sampled/indexed references. Several subsystems are represented by their exact source directories because their implementation was not sampled; their internal connections are omitted where evidence is unavailable.

Main entry points: [`src/pages/Exchange.tsx`](https://github.com/niaefeup/tts-fe/blob/develop/src/pages/Exchange.tsx) (Exchange page), [`src/api/backend.ts`](https://github.com/niaefeup/tts-fe/blob/develop/src/api/backend.ts) (Backend API), [`src/App.tsx`](https://github.com/niaefeup/tts-fe/blob/develop/src/App.tsx) (Routed application), [`src/components/exchange/enrollments/Enrollments.tsx`](https://github.com/niaefeup/tts-fe/blob/develop/src/components/exchange/enrollments/Enrollments.tsx) (Course enrollment)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_app["Application shell"]
  node_app["Routed application<br/>[App.tsx]"]
end

subgraph group_planner["Schedule planner"]
  node_plannerpage["Planner page"]
  node_courses["Course selection"]
  node_optionstate["Schedule options"]
  node_grid["Schedule display"]
end

subgraph group_exchange["Class exchange"]
  node_exchange["Exchange page<br/>[Exchange.tsx]"]
  node_enrollments["Course enrollment<br/>[Enrollments.tsx]"]
  node_create["Create exchange request<br/>[CreateRequest.tsx]"]
  node_browse["Browse requests<br/>[ViewRequests.tsx]"]
  node_auth["Sign-in<br/>[authService.ts]"]
end

subgraph group_admin["Administration"]
  node_admin["Admin console<br/>[Admin.tsx]"]
  node_adminrequests["Admin exchange requests"]
end

subgraph group_services["API and persistence"]
  node_enrollmentservice["Enrollment submission"]
  node_requestservice["Exchange request API"]
  node_backend["Backend API<br/>[backend.ts]"]
  node_localstorage["Browser storage<br/>[storage.ts]"]
end

node_student(("Student"))
node_service[("Backend service")]

node_student -->|"opens"| node_app
node_app -->|"routes to"| node_exchange
node_app -->|"routes to"| node_plannerpage
node_student -.->|"selects courses"| node_plannerpage
node_courses -->|"updates options"| node_optionstate
node_optionstate -.->|"supplies options"| node_grid
node_courses -->|"reads saved data"| node_localstorage
node_exchange -->|"renders"| node_enrollments
node_exchange -->|"renders"| node_create
node_exchange -->|"renders"| node_browse
node_enrollments -->|"loads majors"| node_backend
node_enrollments -->|"submits choices"| node_enrollmentservice
node_enrollmentservice -->|"uses configuration"| node_backend
node_backend -->|"requests data"| node_service
node_requestservice -->|"uses API"| node_backend
node_browse -.->|"loads related exchanges"| node_requestservice
node_exchange -.->|"offers sign-in"| node_auth
node_app -->|"routes to"| node_admin
node_admin -.->|"renders requests"| node_adminrequests
node_adminrequests -.->|"loads exchange data"| node_backend

click node_app "https://github.com/niaefeup/tts-fe/blob/develop/src/App.tsx"
click node_plannerpage "https://github.com/niaefeup/tts-fe/blob/develop/src/pages/TimeTableSelector.tsx"
click node_courses "https://github.com/niaefeup/tts-fe/blob/develop/src/components/planner/sidebar/CoursesController/ClassSelectorDropdownController.tsx"
click node_optionstate "https://github.com/niaefeup/tts-fe/blob/develop/src/contexts/MultipleOptionsContext.tsx"
click node_grid "https://github.com/niaefeup/tts-fe/blob/develop/src/components/planner/schedule/PlannerSchedule.tsx"
click node_exchange "https://github.com/niaefeup/tts-fe/blob/develop/src/pages/Exchange.tsx"
click node_enrollments "https://github.com/niaefeup/tts-fe/blob/develop/src/components/exchange/enrollments/Enrollments.tsx"
click node_enrollmentservice "https://github.com/niaefeup/tts-fe/blob/develop/src/api/services/courseUnitEnrollmentService.ts"
click node_create "https://github.com/niaefeup/tts-fe/blob/develop/src/components/exchange/requests/issue/CreateRequest.tsx"
click node_browse "https://github.com/niaefeup/tts-fe/blob/develop/src/components/exchange/requests/view/ViewRequests.tsx"
click node_requestservice "https://github.com/niaefeup/tts-fe/blob/develop/src/api/services/exchangeRequestService.ts"
click node_auth "https://github.com/niaefeup/tts-fe/blob/develop/src/api/services/authService.ts"
click node_admin "https://github.com/niaefeup/tts-fe/blob/develop/src/pages/Admin.tsx"
click node_adminrequests "https://github.com/niaefeup/tts-fe/blob/develop/src/components/admin/requests/AdminMarketplaceExchanges.tsx"
click node_backend "https://github.com/niaefeup/tts-fe/blob/develop/src/api/backend.ts"
click node_localstorage "https://github.com/niaefeup/tts-fe/blob/develop/src/api/storage.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_app toneBlue
class node_plannerpage,node_courses,node_optionstate,node_grid,node_service toneAmber
class node_exchange,node_enrollments,node_create,node_browse,node_auth toneMint
class node_admin,node_adminrequests toneRose
class node_enrollmentservice,node_requestservice,node_backend,node_localstorage,node_student toneIndigo
```

## Components

### Application shell

- [Routed application](https://github.com/niaefeup/tts-fe/blob/develop/src/App.tsx): `src/App.tsx`

### Schedule planner

- [Planner page](https://github.com/niaefeup/tts-fe/blob/develop/src/pages/TimeTableSelector.tsx): `src/pages/TimeTableSelector.tsx`
- [Course selection](https://github.com/niaefeup/tts-fe/blob/develop/src/components/planner/sidebar/CoursesController/ClassSelectorDropdownController.tsx): `src/components/planner/sidebar/CoursesController/ClassSelectorDropdownController.tsx`
- [Schedule options](https://github.com/niaefeup/tts-fe/blob/develop/src/contexts/MultipleOptionsContext.tsx): `src/contexts/MultipleOptionsContext.tsx`
- [Schedule display](https://github.com/niaefeup/tts-fe/blob/develop/src/components/planner/schedule/PlannerSchedule.tsx): `src/components/planner/schedule/PlannerSchedule.tsx`

### Class exchange

- [Exchange page](https://github.com/niaefeup/tts-fe/blob/develop/src/pages/Exchange.tsx): `src/pages/Exchange.tsx`
- [Course enrollment](https://github.com/niaefeup/tts-fe/blob/develop/src/components/exchange/enrollments/Enrollments.tsx): `src/components/exchange/enrollments/Enrollments.tsx`
- [Create exchange request](https://github.com/niaefeup/tts-fe/blob/develop/src/components/exchange/requests/issue/CreateRequest.tsx): `src/components/exchange/requests/issue/CreateRequest.tsx`
- [Browse requests](https://github.com/niaefeup/tts-fe/blob/develop/src/components/exchange/requests/view/ViewRequests.tsx): `src/components/exchange/requests/view/ViewRequests.tsx`
- [Sign-in](https://github.com/niaefeup/tts-fe/blob/develop/src/api/services/authService.ts): `src/api/services/authService.ts`

### Administration

- [Admin console](https://github.com/niaefeup/tts-fe/blob/develop/src/pages/Admin.tsx): `src/pages/Admin.tsx`
- [Admin exchange requests](https://github.com/niaefeup/tts-fe/blob/develop/src/components/admin/requests/AdminMarketplaceExchanges.tsx): `src/components/admin/requests/AdminMarketplaceExchanges.tsx`

### API and persistence

- [Enrollment submission](https://github.com/niaefeup/tts-fe/blob/develop/src/api/services/courseUnitEnrollmentService.ts): `src/api/services/courseUnitEnrollmentService.ts`
- [Exchange request API](https://github.com/niaefeup/tts-fe/blob/develop/src/api/services/exchangeRequestService.ts): `src/api/services/exchangeRequestService.ts`
- [Backend API](https://github.com/niaefeup/tts-fe/blob/develop/src/api/backend.ts): `src/api/backend.ts`
- [Browser storage](https://github.com/niaefeup/tts-fe/blob/develop/src/api/storage.ts): `src/api/storage.ts`

### Other components

- **Student**
- **Backend service**

## Connections

- Student → Routed application: opens (evidence: `README.md`)
- Routed application → Exchange page: routes to (evidence: `src/App.tsx`)
- Routed application → Planner page: routes to (evidence: `src/App.tsx`)
- Student → Planner page: selects courses
- Course selection → Schedule options: updates options (evidence: `src/components/planner/sidebar/CoursesController/ClassSelectorDropdownController.tsx`)
- Schedule options → Schedule display: supplies options
- Course selection → Browser storage: reads saved data (evidence: `src/components/planner/sidebar/CoursesController/ClassSelectorDropdownController.tsx`)
- Exchange page → Course enrollment: renders (evidence: `src/pages/Exchange.tsx`)
- Exchange page → Create exchange request: renders (evidence: `src/pages/Exchange.tsx`)
- Exchange page → Browse requests: renders (evidence: `src/pages/Exchange.tsx`)
- Course enrollment → Backend API: loads majors (evidence: `src/components/exchange/enrollments/Enrollments.tsx`)
- Course enrollment → Enrollment submission: submits choices (evidence: `src/components/exchange/enrollments/Enrollments.tsx`)
- Enrollment submission → Backend API: uses configuration (evidence: `src/api/services/courseUnitEnrollmentService.ts`)
- Backend API → Backend service: requests data (evidence: `src/api/backend.ts`)
- Exchange request API → Backend API: uses API (evidence: `src/api/services/exchangeRequestService.ts`)
- Browse requests → Exchange request API: loads related exchanges
- Exchange page → Sign-in: offers sign-in
- Routed application → Admin console: routes to (evidence: `src/App.tsx`)
- Admin console → Admin exchange requests: renders requests
- Admin exchange requests → Backend API: loads exchange data
