# dwytmcl/pathwise architecture

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

- Interactive diagram: https://gitdiagram.com/dwytmcl/pathwise
- Repository: https://github.com/dwytmcl/pathwise
- Video tour (about a minute): https://gitdiagram.com/dwytmcl/pathwise/video

## Overview

PathWise is a browser-based curriculum planner. A student opens a curriculum export or saved plan; the app parses and reviews it, then plans course dates around requirements, offerings, and workload assumptions. Students can inspect the route, test moves, compare scenarios, and download a plan or optionally save it on the device. The graph preserves the companion extension and the documented planning capabilities. Several implementation links are based on the README or SOURCE INDEX; unsampled details are not inferred as direct calls.

Main entry points: [`components/PathWiseApp.tsx`](https://github.com/dwytmcl/pathwise/blob/main/components/PathWiseApp.tsx) (Planner app), [`components/ScenarioManager.tsx`](https://github.com/dwytmcl/pathwise/blob/main/components/ScenarioManager.tsx) (Scenario manager), [`lib/planner.ts`](https://github.com/dwytmcl/pathwise/blob/main/lib/planner.ts) (Route scheduler), [`app/page.tsx`](https://github.com/dwytmcl/pathwise/blob/main/app/page.tsx) (Web app entry)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_entry["Entry and import"]
  node_web_entry["Web app entry<br/>[page.tsx]"]
  node_planner_app["Planner app<br/>[PathWiseApp.tsx]"]
end

subgraph group_planning["Planning engine"]
  node_curriculum_parser["Curriculum parser<br/>[curriculum.ts]"]
  node_planning_engine["Route scheduler<br/>[planner.ts]"]
  node_route_insights["Route insights"]
end

subgraph group_workspace["Workspace and persistence"]
  node_workspace_model["Workspace model<br/>[workspace.ts]"]
  node_plan_file["Plan file handling<br/>[plan-file.ts]"]
  node_device_plan_hook["Device autosave<br/>[useDevicePlan.ts]"]
  node_device_storage[("Device storage<br/>[device-plan.ts]")]
end

subgraph group_experience["Planning experience"]
  node_setup_review["Setup review<br/>[SetupReview.tsx]"]
  node_course_graph["Curriculum graph"]
  node_earliest_path["Earliest path<br/>[EarliestPath.tsx]"]
  node_offering_editor["Offering editor<br/>[OfferingEditor.tsx]"]
  node_move_review["Move review<br/>[MoveReview.tsx]"]
  node_course_priority["Course priority<br/>[CoursePriority.tsx]"]
  node_scenario_manager["Scenario manager"]
  node_landing["Product landing<br/>[Landing.tsx]"]
end

subgraph group_companion["Companion extension"]
  node_extension["Export extension<br/>[parser.js]"]
  node_extension_popup["Extension popup<br/>[popup.js]"]
end

node_student(("Student"))
node_curriculum_file["Curriculum file"]

node_student -->|"opens"| node_web_entry
node_web_entry -->|"renders"| node_planner_app
node_student -->|"selects"| node_curriculum_file
node_curriculum_file -->|"imports"| node_planner_app
node_extension -->|"exports JSON"| node_curriculum_file
node_extension_popup -.->|"uses parser"| node_extension
node_planner_app -->|"parses curriculum"| node_curriculum_parser
node_planner_app -->|"reads and writes"| node_plan_file
node_planner_app -->|"initializes settings"| node_workspace_model
node_planner_app -->|"reviews progress"| node_setup_review
node_planner_app -->|"generates route"| node_planning_engine
node_planning_engine -->|"uses course rules"| node_curriculum_parser
node_planner_app -->|"shows dependencies"| node_course_graph
node_planner_app -->|"shows schedule"| node_earliest_path
node_planner_app -->|"edits offerings"| node_offering_editor
node_planner_app -->|"previews moves"| node_move_review
node_move_review -->|"displays consequences"| node_route_insights
node_planner_app -->|"explains dependencies"| node_course_priority
node_course_priority -->|"requests explanation"| node_route_insights
node_planner_app -->|"manages scenarios"| node_scenario_manager
node_scenario_manager -->|"compares routes"| node_planning_engine
node_scenario_manager -->|"stores snapshots"| node_workspace_model
node_planner_app -->|"controls autosave"| node_device_plan_hook
node_device_plan_hook -->|"loads and saves"| node_device_storage
node_planner_app -->|"shows landing"| node_landing
node_student -->|"downloads plan"| node_plan_file

click node_web_entry "https://github.com/dwytmcl/pathwise/blob/main/app/page.tsx"
click node_planner_app "https://github.com/dwytmcl/pathwise/blob/main/components/PathWiseApp.tsx"
click node_curriculum_parser "https://github.com/dwytmcl/pathwise/blob/main/lib/curriculum.ts"
click node_planning_engine "https://github.com/dwytmcl/pathwise/blob/main/lib/planner.ts"
click node_route_insights "https://github.com/dwytmcl/pathwise/blob/main/lib/planning-insights.ts"
click node_setup_review "https://github.com/dwytmcl/pathwise/blob/main/components/SetupReview.tsx"
click node_course_graph "https://github.com/dwytmcl/pathwise/blob/main/components/CurriculumGraph.tsx"
click node_earliest_path "https://github.com/dwytmcl/pathwise/blob/main/components/EarliestPath.tsx"
click node_offering_editor "https://github.com/dwytmcl/pathwise/blob/main/components/OfferingEditor.tsx"
click node_move_review "https://github.com/dwytmcl/pathwise/blob/main/components/MoveReview.tsx"
click node_course_priority "https://github.com/dwytmcl/pathwise/blob/main/components/CoursePriority.tsx"
click node_scenario_manager "https://github.com/dwytmcl/pathwise/blob/main/components/ScenarioManager.tsx"
click node_workspace_model "https://github.com/dwytmcl/pathwise/blob/main/lib/workspace.ts"
click node_plan_file "https://github.com/dwytmcl/pathwise/blob/main/lib/plan-file.ts"
click node_device_plan_hook "https://github.com/dwytmcl/pathwise/blob/main/components/useDevicePlan.ts"
click node_device_storage "https://github.com/dwytmcl/pathwise/blob/main/lib/device-plan.ts"
click node_landing "https://github.com/dwytmcl/pathwise/blob/main/components/landing/Landing.tsx"
click node_extension "https://github.com/dwytmcl/pathwise/blob/main/extension/parser.js"
click node_extension_popup "https://github.com/dwytmcl/pathwise/blob/main/extension/popup.js"

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_web_entry,node_planner_app toneBlue
class node_curriculum_parser,node_planning_engine,node_route_insights toneAmber
class node_workspace_model,node_plan_file,node_device_plan_hook,node_device_storage toneMint
class node_setup_review,node_course_graph,node_earliest_path,node_offering_editor,node_move_review,node_course_priority,node_scenario_manager,node_landing toneRose
class node_extension,node_extension_popup,node_student,node_curriculum_file toneIndigo
```

## Components

### Entry and import

- [Web app entry](https://github.com/dwytmcl/pathwise/blob/main/app/page.tsx): `app/page.tsx`
- [Planner app](https://github.com/dwytmcl/pathwise/blob/main/components/PathWiseApp.tsx): `components/PathWiseApp.tsx`

### Planning engine

- [Curriculum parser](https://github.com/dwytmcl/pathwise/blob/main/lib/curriculum.ts): `lib/curriculum.ts`
- [Route scheduler](https://github.com/dwytmcl/pathwise/blob/main/lib/planner.ts): `lib/planner.ts`
- [Route insights](https://github.com/dwytmcl/pathwise/blob/main/lib/planning-insights.ts): `lib/planning-insights.ts`

### Workspace and persistence

- [Workspace model](https://github.com/dwytmcl/pathwise/blob/main/lib/workspace.ts): `lib/workspace.ts`
- [Plan file handling](https://github.com/dwytmcl/pathwise/blob/main/lib/plan-file.ts): `lib/plan-file.ts`
- [Device autosave](https://github.com/dwytmcl/pathwise/blob/main/components/useDevicePlan.ts): `components/useDevicePlan.ts`
- [Device storage](https://github.com/dwytmcl/pathwise/blob/main/lib/device-plan.ts): `lib/device-plan.ts`

### Planning experience

- [Setup review](https://github.com/dwytmcl/pathwise/blob/main/components/SetupReview.tsx): `components/SetupReview.tsx`
- [Curriculum graph](https://github.com/dwytmcl/pathwise/blob/main/components/CurriculumGraph.tsx): `components/CurriculumGraph.tsx`
- [Earliest path](https://github.com/dwytmcl/pathwise/blob/main/components/EarliestPath.tsx): `components/EarliestPath.tsx`
- [Offering editor](https://github.com/dwytmcl/pathwise/blob/main/components/OfferingEditor.tsx): `components/OfferingEditor.tsx`
- [Move review](https://github.com/dwytmcl/pathwise/blob/main/components/MoveReview.tsx): `components/MoveReview.tsx`
- [Course priority](https://github.com/dwytmcl/pathwise/blob/main/components/CoursePriority.tsx): `components/CoursePriority.tsx`
- [Scenario manager](https://github.com/dwytmcl/pathwise/blob/main/components/ScenarioManager.tsx): `components/ScenarioManager.tsx`
- [Product landing](https://github.com/dwytmcl/pathwise/blob/main/components/landing/Landing.tsx): `components/landing/Landing.tsx`

### Companion extension

- [Export extension](https://github.com/dwytmcl/pathwise/blob/main/extension/parser.js): `extension/parser.js`
- [Extension popup](https://github.com/dwytmcl/pathwise/blob/main/extension/popup.js): `extension/popup.js`

### Other components

- **Student**
- **Curriculum file**

## Connections

- Student → Web app entry: opens (evidence: `README.md`)
- Web app entry → Planner app: renders (evidence: `app/page.tsx`)
- Student → Curriculum file: selects (evidence: `README.md`)
- Curriculum file → Planner app: imports (evidence: `README.md`)
- Export extension → Curriculum file: exports JSON (evidence: `README.md`)
- Extension popup → Export extension: uses parser
- Planner app → Curriculum parser: parses curriculum (evidence: `components/PathWiseApp.tsx`)
- Planner app → Plan file handling: reads and writes (evidence: `components/PathWiseApp.tsx`)
- Planner app → Workspace model: initializes settings (evidence: `components/PathWiseApp.tsx`)
- Planner app → Setup review: reviews progress (evidence: `README.md`)
- Planner app → Route scheduler: generates route (evidence: `README.md`)
- Route scheduler → Curriculum parser: uses course rules (evidence: `lib/planner.ts`)
- Planner app → Curriculum graph: shows dependencies (evidence: `README.md`)
- Planner app → Earliest path: shows schedule (evidence: `components/PathWiseApp.tsx`)
- Planner app → Offering editor: edits offerings (evidence: `components/PathWiseApp.tsx`)
- Planner app → Move review: previews moves (evidence: `README.md`)
- Move review → Route insights: displays consequences (evidence: `components/MoveReview.tsx`)
- Planner app → Course priority: explains dependencies (evidence: `README.md`)
- Course priority → Route insights: requests explanation (evidence: `components/CoursePriority.tsx`)
- Planner app → Scenario manager: manages scenarios (evidence: `README.md`)
- Scenario manager → Route scheduler: compares routes (evidence: `components/ScenarioManager.tsx`)
- Scenario manager → Workspace model: stores snapshots (evidence: `components/ScenarioManager.tsx`)
- Planner app → Device autosave: controls autosave (evidence: `components/PathWiseApp.tsx`)
- Device autosave → Device storage: loads and saves (evidence: `components/useDevicePlan.ts`)
- Planner app → Product landing: shows landing (evidence: `components/PathWiseApp.tsx`)
- Student → Plan file handling: downloads plan (evidence: `README.md`)
