# hfjddjksaj/tritonplan architecture

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

- Interactive diagram: https://gitdiagram.com/hfjddjksaj/tritonplan
- Repository: https://github.com/hfjddjksaj/tritonplan

## Overview

TritonPlan combines a passive TSS browser extension with a local-first course-planning website. The main workflow observes TSS schedule responses, converts captured schedule data into course offerings, and transfers them to the planner, where students arrange sections, check conflicts and view calendar or campus information. Plans and preferences stay in browser storage; sharing and JSON backup are separate capabilities. The README documents the product flow, while sampled source confirms key planner, storage, map-routing and extension-worker responsibilities; some unsampled subsystem connections are therefore left implicit.

Main entry points: [`web/src/App.tsx`](https://github.com/hfjddjksaj/tritonplan/blob/main/web/src/App.tsx) (Planner app), [`extension/src/background/service-worker.ts`](https://github.com/hfjddjksaj/tritonplan/blob/main/extension/src/background/service-worker.ts) (Extension worker), [`web/src/hooks/usePlan.ts`](https://github.com/hfjddjksaj/tritonplan/blob/main/web/src/hooks/usePlan.ts) (Plan controller), [`extension/src/content/planner-bridge.ts`](https://github.com/hfjddjksaj/tritonplan/blob/main/extension/src/content/planner-bridge.ts) (Planner bridge)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_capture["TSS capture"]
  node_interceptor["Response interceptor<br/>[interceptor.ts]"]
  node_relay["Capture relay<br/>[tss-relay.ts]"]
  node_worker["Extension worker<br/>[service-worker.ts]"]
  node_capture_store["Capture store"]
  node_parser["Schedule parser<br/>[index.ts]"]
  node_planner_bridge["Planner bridge<br/>[planner-bridge.ts]"]
end

subgraph group_planner["Planner workflow"]
  node_app["Planner app<br/>[App.tsx]"]
  node_plan_hook["Plan controller<br/>[usePlan.ts]"]
  node_shared_rules["Schedule rules<br/>[conflicts.ts]"]
  node_share["Share and export<br/>[share-v3.ts]"]
end

subgraph group_views["Planner views"]
  node_calendar["Weekly calendar<br/>[CalendarGrid.tsx]"]
  node_course_panel["Course sections<br/>[CoursePanel.tsx]"]
  node_finals["Finals views<br/>[FinalsView.tsx]"]
  node_campus_map["Campus map<br/>[CampusMap.tsx]"]
  node_walk_route["Walking routes<br/>[useWalkRoute.ts]"]
end

subgraph group_state["Local plan state"]
  node_storage[("Browser storage<br/>[storage.ts]")]
end

node_student(("Student"))
node_tss["TSS Schedule"]
node_website["Planner website<br/>[main.tsx]"]
node_localstorage[("Local storage")]

node_student -->|"browses schedule"| node_tss
node_tss -->|"sends responses"| node_interceptor
node_interceptor -->|"forwards captures"| node_relay
node_relay -->|"ingests bodies"| node_worker
node_worker -->|"stores and parses"| node_capture_store
node_capture_store -->|"parses schedules"| node_parser
node_worker -->|"syncs course data"| node_planner_bridge
node_student -->|"adds section"| node_planner_bridge
node_planner_bridge -->|"opens planner"| node_website
node_website -->|"renders"| node_app
node_app -->|"controls plan"| node_plan_hook
node_plan_hook -->|"loads and saves"| node_storage
node_storage -->|"persists locally"| node_localstorage
node_plan_hook -->|"checks conflicts"| node_shared_rules
node_app -->|"shows schedule"| node_calendar
node_app -->|"shows sections"| node_course_panel
node_app -->|"shows exams"| node_finals
node_app -->|"shows locations"| node_campus_map
node_campus_map -->|"requests directions"| node_walk_route
node_app -->|"shares or exports"| node_share
node_share -->|"reads plan"| node_storage

click node_interceptor "https://github.com/hfjddjksaj/tritonplan/blob/main/extension/src/content/interceptor.ts"
click node_relay "https://github.com/hfjddjksaj/tritonplan/blob/main/extension/src/content/tss-relay.ts"
click node_worker "https://github.com/hfjddjksaj/tritonplan/blob/main/extension/src/background/service-worker.ts"
click node_capture_store "https://github.com/hfjddjksaj/tritonplan/blob/main/extension/src/lib/capture-to-courses.ts"
click node_parser "https://github.com/hfjddjksaj/tritonplan/blob/main/extension/src/parser/index.ts"
click node_planner_bridge "https://github.com/hfjddjksaj/tritonplan/blob/main/extension/src/content/planner-bridge.ts"
click node_website "https://github.com/hfjddjksaj/tritonplan/blob/main/web/src/main.tsx"
click node_app "https://github.com/hfjddjksaj/tritonplan/blob/main/web/src/App.tsx"
click node_plan_hook "https://github.com/hfjddjksaj/tritonplan/blob/main/web/src/hooks/usePlan.ts"
click node_shared_rules "https://github.com/hfjddjksaj/tritonplan/blob/main/shared/src/conflicts.ts"
click node_calendar "https://github.com/hfjddjksaj/tritonplan/blob/main/web/src/components/CalendarGrid.tsx"
click node_course_panel "https://github.com/hfjddjksaj/tritonplan/blob/main/web/src/components/CoursePanel.tsx"
click node_finals "https://github.com/hfjddjksaj/tritonplan/blob/main/web/src/components/FinalsView.tsx"
click node_campus_map "https://github.com/hfjddjksaj/tritonplan/blob/main/web/src/components/CampusMap.tsx"
click node_walk_route "https://github.com/hfjddjksaj/tritonplan/blob/main/web/src/hooks/useWalkRoute.ts"
click node_share "https://github.com/hfjddjksaj/tritonplan/blob/main/web/src/lib/share-v3.ts"
click node_storage "https://github.com/hfjddjksaj/tritonplan/blob/main/web/src/lib/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_interceptor,node_relay,node_worker,node_capture_store,node_parser,node_planner_bridge toneBlue
class node_app,node_plan_hook,node_shared_rules,node_share,node_localstorage toneAmber
class node_calendar,node_course_panel,node_finals,node_campus_map,node_walk_route toneMint
class node_storage toneRose
class node_student,node_tss toneIndigo
class node_website toneTeal
```

## Components

### TSS capture

- [Response interceptor](https://github.com/hfjddjksaj/tritonplan/blob/main/extension/src/content/interceptor.ts): `extension/src/content/interceptor.ts`
- [Capture relay](https://github.com/hfjddjksaj/tritonplan/blob/main/extension/src/content/tss-relay.ts): `extension/src/content/tss-relay.ts`
- [Extension worker](https://github.com/hfjddjksaj/tritonplan/blob/main/extension/src/background/service-worker.ts): `extension/src/background/service-worker.ts`
- [Capture store](https://github.com/hfjddjksaj/tritonplan/blob/main/extension/src/lib/capture-to-courses.ts): `extension/src/lib/capture-to-courses.ts`
- [Schedule parser](https://github.com/hfjddjksaj/tritonplan/blob/main/extension/src/parser/index.ts): `extension/src/parser/index.ts`
- [Planner bridge](https://github.com/hfjddjksaj/tritonplan/blob/main/extension/src/content/planner-bridge.ts): `extension/src/content/planner-bridge.ts`

### Planner workflow

- [Planner app](https://github.com/hfjddjksaj/tritonplan/blob/main/web/src/App.tsx): `web/src/App.tsx`
- [Plan controller](https://github.com/hfjddjksaj/tritonplan/blob/main/web/src/hooks/usePlan.ts): `web/src/hooks/usePlan.ts`
- [Schedule rules](https://github.com/hfjddjksaj/tritonplan/blob/main/shared/src/conflicts.ts): `shared/src/conflicts.ts`
- [Share and export](https://github.com/hfjddjksaj/tritonplan/blob/main/web/src/lib/share-v3.ts): `web/src/lib/share-v3.ts`

### Planner views

- [Weekly calendar](https://github.com/hfjddjksaj/tritonplan/blob/main/web/src/components/CalendarGrid.tsx): `web/src/components/CalendarGrid.tsx`
- [Course sections](https://github.com/hfjddjksaj/tritonplan/blob/main/web/src/components/CoursePanel.tsx): `web/src/components/CoursePanel.tsx`
- [Finals views](https://github.com/hfjddjksaj/tritonplan/blob/main/web/src/components/FinalsView.tsx): `web/src/components/FinalsView.tsx`
- [Campus map](https://github.com/hfjddjksaj/tritonplan/blob/main/web/src/components/CampusMap.tsx): `web/src/components/CampusMap.tsx`
- [Walking routes](https://github.com/hfjddjksaj/tritonplan/blob/main/web/src/hooks/useWalkRoute.ts): `web/src/hooks/useWalkRoute.ts`

### Local plan state

- [Browser storage](https://github.com/hfjddjksaj/tritonplan/blob/main/web/src/lib/storage.ts): `web/src/lib/storage.ts`

### Other components

- **Student**
- **TSS Schedule**
- [Planner website](https://github.com/hfjddjksaj/tritonplan/blob/main/web/src/main.tsx): `web/src/main.tsx`
- **Local storage**

## Connections

- Student → TSS Schedule: browses schedule
- TSS Schedule → Response interceptor: sends responses
- Response interceptor → Capture relay: forwards captures
- Capture relay → Extension worker: ingests bodies
- Extension worker → Capture store: stores and parses
- Capture store → Schedule parser: parses schedules
- Extension worker → Planner bridge: syncs course data
- Student → Planner bridge: adds section
- Planner bridge → Planner website: opens planner
- Planner website → Planner app: renders
- Planner app → Plan controller: controls plan
- Plan controller → Browser storage: loads and saves
- Browser storage → Local storage: persists locally
- Plan controller → Schedule rules: checks conflicts
- Planner app → Weekly calendar: shows schedule
- Planner app → Course sections: shows sections
- Planner app → Finals views: shows exams
- Planner app → Campus map: shows locations
- Campus map → Walking routes: requests directions
- Planner app → Share and export: shares or exports
- Share and export → Browser storage: reads plan
