# gt-scheduler/website architecture

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

- Interactive diagram: https://gitdiagram.com/gt-scheduler/website
- Repository: https://github.com/gt-scheduler/website

## Overview

#### Purpose and Runtime
GT Scheduler is a TypeScript/React single-page application for building and comparing Georgia Tech course schedules. It is a create-react-app frontend, styled with SCSS and served as a static site. Browser entry is `src/index.tsx`; the application shell is `src/components/App/index.tsx`; static HTML/manifest are under `public/index.html` and `public/manifest.json`.

#### Application Shell and Navigation
`App` selects main, maintenance, and content views and composes global navigation and overlays. Routing is isolated behind `src/components/RouterComponent/index.tsx`, while navigation UI is implemented in `src/components/App/navigation.tsx`, `src/components/NavDrawer/index.tsx`, and `src/components/NavMenu/index.tsx`. Error containment is a top-level boundary at `src/components/ErrorBoundary/index.tsx`.

#### Bootstrapping and Data Readiness
`src/components/AppDataLoader/index.tsx` orchestrates startup loading; `src/components/AppDataLoader/stages.tsx` represents loading stages. Term metadata and crawler data are downloaded through `src/data/hooks/useDownloadTerms.ts` and `src/data/hooks/useDownloadOscarData.ts`, then term validity is enforced by `src/data/hooks/useEnsureValidTerm.ts`. This separates remote academic data acquisition from the interactive UI.

#### State, Persistence, and Migration
React contexts provide cross-cutting state domains: account, schedules, friends/shared schedules, selected terms, theme, and overlay CRNs in `src/contexts/account.ts`, `src/contexts/schedule.ts`, and `src/contexts/friend.ts`. Schedule/UI/theme data is restored from browser storage via `src/data/hooks/useRawScheduleDataFromStorage.ts`, `src/data/hooks/useUIStateFromStorage.ts`, and `src/data/hooks/useThemeFromStorage.ts`. Historical client data is versioned and migrated through `src/data/migrations/index.ts`, `src/data/migrations/1to2.ts`, and `src/data/hooks/useMigrateScheduleData.ts`.

#### Scheduling and Course Exploration
Course and section domain models live in `src/data/beans/Course.ts`, `src/data/beans/Section.ts`, and `src/data/beans/Oscar.ts`. The schedule-building flow centers on course selection and schedule presentation: `src/components/CourseContainer/index.tsx`, `src/components/Scheduler/index.tsx`, and `src/components/Calendar/index.tsx`. Time/section rendering and conflict-oriented visual blocks are separated into `src/components/TimeBlocks/index.tsx`, `src/components/SectionBlocks/index.tsx`, and `src/components/EventBlocks/index.tsx`.

#### Comparison, Sharing, and Accounts
Alternative schedules can be compared through `src/components/ComparisonContainer/index.tsx`, `src/components/ComparisonPanel/index.tsx`, and `src/data/hooks/useCompareStateFromStorage.ts`. Account authentication and cloud-backed friend schedule workflows are mediated by Firebase: `src/data/firebase.ts`, `src/data/hooks/useFirebaseAuth.ts`, `src/data/hooks/useRawScheduleDataFromFirebase.ts`, and `src/data/hooks/useRawFriendScheduleDataFromFirebaseFunction.ts`. Invitation UI is bounded in `src/components/InvitationModal/index.tsx` and `src/components/InvitationAcceptModal/InvitationAcceptModal.tsx`.

#### External Boundaries and Delivery
The browser fetches term/course data from the GT Scheduler crawler, requests live section seating through the backend CORS proxy to Georgia Tech Oscar, and requests course/instructor GPA data from Course Critique. Firebase supports authentication and shared schedule data. Google Analytics provides aggregate usage tracking; Sentry reports client errors. GitHub Actions CI/deployment are defined in `.github/workflows/ci.yaml` and `.github/workflows/deploy.yaml`; deployment publishes the static SPA to GitHub Pages for `gt-scheduler.org`.

Main entry points: [`src/components/App/index.tsx`](https://github.com/gt-scheduler/website/blob/main/src/components/App/index.tsx) (App shell), [`src/components/Scheduler/index.tsx`](https://github.com/gt-scheduler/website/blob/main/src/components/Scheduler/index.tsx) (Schedule builder), [`src/components/AppDataLoader/index.tsx`](https://github.com/gt-scheduler/website/blob/main/src/components/AppDataLoader/index.tsx) (Startup data loader), [`src/contexts/schedule.ts`](https://github.com/gt-scheduler/website/blob/main/src/contexts/schedule.ts) (App contexts)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_ui["Browser UI"]
  node_entry["Browser entry<br/>React bootstrap<br/>[index.tsx]"]
  node_app["App shell<br/>view composition<br/>[index.tsx]"]
  node_router["Router<br/>routing boundary<br/>[index.tsx]"]
  node_navigation["Navigation UI<br/>[navigation.tsx]"]
  node_error_boundary["Error boundary<br/>error containment<br/>[index.tsx]"]
  node_scheduler["Schedule builder<br/>course scheduling UI<br/>[index.tsx]"]
  node_calendar["Calendar renderer<br/>schedule visualization<br/>[index.tsx]"]
  node_comparison["Schedule comparison<br/>comparison UI<br/>[index.tsx]"]
  node_invitations["Schedule invitations<br/>sharing UI<br/>[index.tsx]"]
end

subgraph group_data["Client Data"]
  node_data_loader["Startup data loader<br/>boot orchestration<br/>[index.tsx]"]
  node_academic_downloads["Academic data downloads<br/>data hooks"]
  node_term_validation["Valid term enforcement<br/>data hook"]
  node_client_state["App contexts<br/>React state domains<br/>[schedule.ts]"]
  node_persistence[("Browser persistence<br/>storage hooks")]
  node_migration["Schedule migrations<br/>client migration<br/>[index.ts]"]
  node_firebase_integration["Firebase integration<br/>auth and shared schedules<br/>[firebase.ts]"]
end

subgraph group_external["External Services"]
  node_crawler{{"GT Scheduler crawler<br/>course data API"}}
  node_oscar_proxy{{"Oscar CORS proxy<br/>backend proxy"}}
  node_course_critique{{"Course Critique<br/>GPA data API"}}
  node_firebase[("Firebase<br/>cloud platform")]
  node_observability["Analytics and error reporting<br/>telemetry"]
end

subgraph group_delivery["Delivery"]
  node_ci_deploy["GitHub Actions<br/>CI and deployment<br/>[deploy.yaml]"]
  node_github_pages{{"GitHub Pages<br/>static hosting"}}
end

node_entry -->|"mounts"| node_app
node_app -->|"selects views"| node_router
node_app -->|"composes"| node_navigation
node_app -->|"contains"| node_error_boundary
node_app -->|"initializes"| node_data_loader
node_data_loader -->|"loads"| node_academic_downloads
node_data_loader -->|"validates"| node_term_validation
node_academic_downloads -->|"downloads terms and courses"| node_crawler
node_client_state -->|"restores from"| node_persistence
node_persistence -->|"upgrades via"| node_migration
node_data_loader -->|"hydrates"| node_client_state
node_app -->|"hosts"| node_scheduler
node_scheduler -->|"renders schedule"| node_calendar
node_scheduler -->|"requests live seating"| node_oscar_proxy
node_scheduler -->|"requests GPA data"| node_course_critique
node_app -->|"hosts"| node_comparison
node_client_state -->|"supplies schedules"| node_comparison
node_client_state -->|"syncs account and sharing"| node_firebase_integration
node_firebase_integration -->|"uses"| node_firebase
node_invitations -->|"shares schedules"| node_firebase_integration
node_app -.->|"reports usage and errors"| node_observability
node_ci_deploy -->|"publishes SPA"| node_github_pages
node_github_pages -.->|"serves"| node_entry

click node_entry "https://github.com/gt-scheduler/website/blob/main/src/index.tsx"
click node_app "https://github.com/gt-scheduler/website/blob/main/src/components/App/index.tsx"
click node_router "https://github.com/gt-scheduler/website/blob/main/src/components/RouterComponent/index.tsx"
click node_navigation "https://github.com/gt-scheduler/website/blob/main/src/components/App/navigation.tsx"
click node_error_boundary "https://github.com/gt-scheduler/website/blob/main/src/components/ErrorBoundary/index.tsx"
click node_data_loader "https://github.com/gt-scheduler/website/blob/main/src/components/AppDataLoader/index.tsx"
click node_academic_downloads "https://github.com/gt-scheduler/website/blob/main/src/data/hooks/useDownloadTerms.ts"
click node_term_validation "https://github.com/gt-scheduler/website/blob/main/src/data/hooks/useEnsureValidTerm.ts"
click node_client_state "https://github.com/gt-scheduler/website/blob/main/src/contexts/schedule.ts"
click node_persistence "https://github.com/gt-scheduler/website/blob/main/src/data/hooks/useRawScheduleDataFromStorage.ts"
click node_migration "https://github.com/gt-scheduler/website/blob/main/src/data/migrations/index.ts"
click node_scheduler "https://github.com/gt-scheduler/website/blob/main/src/components/Scheduler/index.tsx"
click node_calendar "https://github.com/gt-scheduler/website/blob/main/src/components/Calendar/index.tsx"
click node_comparison "https://github.com/gt-scheduler/website/blob/main/src/components/ComparisonContainer/index.tsx"
click node_firebase_integration "https://github.com/gt-scheduler/website/blob/main/src/data/firebase.ts"
click node_invitations "https://github.com/gt-scheduler/website/blob/main/src/components/InvitationModal/index.tsx"
click node_ci_deploy "https://github.com/gt-scheduler/website/blob/main/.github/workflows/deploy.yaml"

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_entry,node_app,node_router,node_navigation,node_error_boundary,node_scheduler,node_calendar,node_comparison,node_invitations toneBlue
class node_data_loader,node_academic_downloads,node_term_validation,node_client_state,node_persistence,node_migration,node_firebase_integration toneAmber
class node_crawler,node_oscar_proxy,node_course_critique,node_firebase,node_observability toneMint
class node_ci_deploy,node_github_pages toneRose
```

## Components

### Browser UI

- [Browser entry](https://github.com/gt-scheduler/website/blob/main/src/index.tsx): React bootstrap · `src/index.tsx`
- [App shell](https://github.com/gt-scheduler/website/blob/main/src/components/App/index.tsx): view composition · Selects application views, navigation, and overlays. · `src/components/App/index.tsx`
- [Router](https://github.com/gt-scheduler/website/blob/main/src/components/RouterComponent/index.tsx): routing boundary · `src/components/RouterComponent/index.tsx`
- [Navigation UI](https://github.com/gt-scheduler/website/blob/main/src/components/App/navigation.tsx): navigation · Global navigation, drawer, and menu. · `src/components/App/navigation.tsx`
- [Error boundary](https://github.com/gt-scheduler/website/blob/main/src/components/ErrorBoundary/index.tsx): error containment · `src/components/ErrorBoundary/index.tsx`
- [Schedule builder](https://github.com/gt-scheduler/website/blob/main/src/components/Scheduler/index.tsx): course scheduling UI · Course selection and schedule presentation. · `src/components/Scheduler/index.tsx`
- [Calendar renderer](https://github.com/gt-scheduler/website/blob/main/src/components/Calendar/index.tsx): schedule visualization · Renders time, section, and event blocks. · `src/components/Calendar/index.tsx`
- [Schedule comparison](https://github.com/gt-scheduler/website/blob/main/src/components/ComparisonContainer/index.tsx): comparison UI · Compares alternative schedules with persisted compare state. · `src/components/ComparisonContainer/index.tsx`
- [Schedule invitations](https://github.com/gt-scheduler/website/blob/main/src/components/InvitationModal/index.tsx): sharing UI · `src/components/InvitationModal/index.tsx`

### Client Data

- [Startup data loader](https://github.com/gt-scheduler/website/blob/main/src/components/AppDataLoader/index.tsx): boot orchestration · Coordinates loading stages before interactive use. · `src/components/AppDataLoader/index.tsx`
- [Academic data downloads](https://github.com/gt-scheduler/website/blob/main/src/data/hooks/useDownloadTerms.ts): data hooks · Downloads terms and crawler course data. · `src/data/hooks/useDownloadTerms.ts`
- [Valid term enforcement](https://github.com/gt-scheduler/website/blob/main/src/data/hooks/useEnsureValidTerm.ts): data hook · `src/data/hooks/useEnsureValidTerm.ts`
- [App contexts](https://github.com/gt-scheduler/website/blob/main/src/contexts/schedule.ts): React state domains · Account, schedule, friend, term, theme, and overlay state. · `src/contexts/schedule.ts`
- [Browser persistence](https://github.com/gt-scheduler/website/blob/main/src/data/hooks/useRawScheduleDataFromStorage.ts): storage hooks · Restores schedule, UI, and theme state. · `src/data/hooks/useRawScheduleDataFromStorage.ts`
- [Schedule migrations](https://github.com/gt-scheduler/website/blob/main/src/data/migrations/index.ts): client migration · Versions and upgrades historical schedule data. · `src/data/migrations/index.ts`
- [Firebase integration](https://github.com/gt-scheduler/website/blob/main/src/data/firebase.ts): auth and shared schedules · Authenticates accounts and loads cloud-backed schedules. · `src/data/firebase.ts`

### External Services

- **GT Scheduler crawler**: course data API
- **Oscar CORS proxy**: backend proxy · Obtains live Georgia Tech Oscar seating.
- **Course Critique**: GPA data API
- **Firebase**: cloud platform · Authentication and shared schedule storage.
- **Analytics and error reporting**: telemetry · Google Analytics and Sentry.

### Delivery

- [GitHub Actions](https://github.com/gt-scheduler/website/blob/main/.github/workflows/deploy.yaml): CI and deployment · Builds and deploys the static SPA. · `.github/workflows/deploy.yaml`
- **GitHub Pages**: static hosting · Hosts gt-scheduler.org.

## Connections

- Browser entry → App shell: mounts
- App shell → Router: selects views
- App shell → Navigation UI: composes
- App shell → Error boundary: contains
- App shell → Startup data loader: initializes
- Startup data loader → Academic data downloads: loads
- Startup data loader → Valid term enforcement: validates
- Academic data downloads → GT Scheduler crawler: downloads terms and courses
- App contexts → Browser persistence: restores from
- Browser persistence → Schedule migrations: upgrades via
- Startup data loader → App contexts: hydrates
- App shell → Schedule builder: hosts
- Schedule builder → Calendar renderer: renders schedule
- Schedule builder → Oscar CORS proxy: requests live seating
- Schedule builder → Course Critique: requests GPA data
- App shell → Schedule comparison: hosts
- App contexts → Schedule comparison: supplies schedules
- App contexts → Firebase integration: syncs account and sharing
- Firebase integration → Firebase: uses
- Schedule invitations → Firebase integration: shares schedules
- App shell → Analytics and error reporting: reports usage and errors
- GitHub Actions → GitHub Pages: publishes SPA
- GitHub Pages → Browser entry: serves
