# jung028/leetcode-spaced-repetition-tool architecture

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

- Interactive diagram: https://gitdiagram.com/jung028/leetcode-spaced-repetition-tool
- Repository: https://github.com/jung028/leetcode-spaced-repetition-tool

## Overview

LeetCode Review Board is a Bun/React app centered on capturing coding solutions, scheduling spaced reviews, and presenting due work. Its documented workflow runs from manual or LeetCode-page capture through review scheduling to a hidden-solution review and pass/fail rescheduling; the calendar mirrors that schedule on request. The app also has independent Todo, Exam, Jobs, and Home workflows, plus study and planning areas visible in the tree. Edges use README statements or shown imports/registrations; several unsampled subsystems are represented without guessing their internal calls.

Main entry points: [`index.ts`](https://github.com/jung028/leetcode-spaced-repetition-tool/blob/main/index.ts) (Bun server), [`exam/api.ts`](https://github.com/jung028/leetcode-spaced-repetition-tool/blob/main/exam/api.ts) (Exam API), [`leetcode/leetcode.ts`](https://github.com/jung028/leetcode-spaced-repetition-tool/blob/main/leetcode/leetcode.ts) (LeetCode reviews), [`HomeApp.tsx`](https://github.com/jung028/leetcode-spaced-repetition-tool/blob/main/HomeApp.tsx) (Home board)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_shell["App shell"]
  node_server["Bun server<br/>[index.ts]"]
  node_home["Home board<br/>[HomeApp.tsx]"]
end

subgraph group_review["Review and due work"]
  node_leetcode_review["LeetCode reviews<br/>[leetcode.ts]"]
  node_review_store[("Review data<br/>[db.ts]")]
  node_review_api["Review API<br/>[api.ts]"]
  node_scheduler["Review scheduling<br/>[scheduling.ts]"]
  node_capture_script["Page capture"]
  node_todo["Todo list<br/>[App.tsx]"]
  node_todo_store[("Todo data<br/>[db.ts]")]
  node_jobs["Job pipeline<br/>[App.tsx]"]
  node_jobs_store[("Job data<br/>[db.ts]")]
  node_calendar_ui["Calendar view<br/>[UniCalendar.tsx]"]
end

subgraph group_exam["Exam practice"]
  node_exam_ui["Exam practice<br/>[App.tsx]"]
  node_exam_api["Exam API<br/>[api.ts]"]
  node_exam_store[("Exam progress<br/>[db.ts]")]
  node_exam_content["Course papers"]
  node_exam_catalog["Paper schedule<br/>[content.ts]"]
  node_exam_generation["Paper generation<br/>[generate.ts]"]
end

subgraph group_planning["Planning and notes"]
  node_weekly_plan["Weekly planner<br/>[WeeklyPlanView.tsx]"]
  node_study_notes["Notes<br/>[App.tsx]"]
  node_module_planner["Module planner<br/>[ModulePlanner.tsx]"]
  node_training["Training plan<br/>[plan.ts]"]
end

subgraph group_extra["Other study tools"]
  node_announcements["Announcements"]
  node_interview["Interview practice<br/>[App.tsx]"]
  node_leetcode150["LeetCode 150<br/>[content.ts]"]
end

node_learner(("Learner"))
node_leetcode["LeetCode page"]
node_calendar["Google Calendar"]

node_learner -->|"uses app"| node_server
node_server -->|"registers routes"| node_review_api
node_server -.->|"serves app"| node_todo
node_server -->|"registers routes"| node_exam_api
node_server -.->|"serves app"| node_jobs
node_learner -->|"adds solution"| node_leetcode_review
node_leetcode -->|"provides solution"| node_capture_script
node_capture_script -->|"captures problem"| node_review_api
node_review_api -->|"reads and writes"| node_review_store
node_review_store -->|"uses ladder"| node_scheduler
node_learner -->|"reviews due items"| node_leetcode_review
node_leetcode_review -.->|"loads and updates"| node_review_api
node_leetcode_review -->|"shows schedule"| node_calendar_ui
node_calendar_ui -->|"embeds calendar"| node_calendar
node_home -->|"merges due items"| node_leetcode_review
node_home -->|"merges due items"| node_todo
node_home -->|"merges due items"| node_exam_ui
node_home -->|"merges next actions"| node_jobs
node_todo -.->|"manages tasks"| node_todo_store
node_jobs -->|"manages roles"| node_jobs_store
node_exam_ui -.->|"requests papers"| node_exam_api
node_exam_api -->|"reads and writes"| node_exam_store
node_exam_api -->|"builds schedule"| node_exam_catalog
node_exam_catalog -->|"aggregates papers"| node_exam_content
node_exam_api -->|"starts generation"| node_exam_generation
node_learner -->|"practices papers"| node_exam_ui
node_study_notes -->|"renders training"| node_weekly_plan
node_training -->|"supplies plan"| node_weekly_plan
node_learner -.->|"plans modules"| node_module_planner
node_learner -.->|"views announcements"| node_announcements
node_learner -.->|"practices interviews"| node_interview
node_learner -.->|"studies problems"| node_leetcode150

click node_server "https://github.com/jung028/leetcode-spaced-repetition-tool/blob/main/index.ts"
click node_home "https://github.com/jung028/leetcode-spaced-repetition-tool/blob/main/HomeApp.tsx"
click node_leetcode_review "https://github.com/jung028/leetcode-spaced-repetition-tool/blob/main/leetcode/leetcode.ts"
click node_review_store "https://github.com/jung028/leetcode-spaced-repetition-tool/blob/main/leetcode/db.ts"
click node_review_api "https://github.com/jung028/leetcode-spaced-repetition-tool/blob/main/leetcode/api.ts"
click node_scheduler "https://github.com/jung028/leetcode-spaced-repetition-tool/blob/main/shared/scheduling.ts"
click node_capture_script "https://github.com/jung028/leetcode-spaced-repetition-tool/blob/main/userscript/leetcode-sync.user.js"
click node_todo "https://github.com/jung028/leetcode-spaced-repetition-tool/blob/main/todo/App.tsx"
click node_todo_store "https://github.com/jung028/leetcode-spaced-repetition-tool/blob/main/todo/db.ts"
click node_jobs "https://github.com/jung028/leetcode-spaced-repetition-tool/blob/main/jobs/App.tsx"
click node_jobs_store "https://github.com/jung028/leetcode-spaced-repetition-tool/blob/main/jobs/db.ts"
click node_exam_ui "https://github.com/jung028/leetcode-spaced-repetition-tool/blob/main/exam/App.tsx"
click node_exam_api "https://github.com/jung028/leetcode-spaced-repetition-tool/blob/main/exam/api.ts"
click node_exam_store "https://github.com/jung028/leetcode-spaced-repetition-tool/blob/main/exam/db.ts"
click node_exam_content "https://github.com/jung028/leetcode-spaced-repetition-tool/tree/main/exam-content"
click node_exam_catalog "https://github.com/jung028/leetcode-spaced-repetition-tool/blob/main/exam/content.ts"
click node_exam_generation "https://github.com/jung028/leetcode-spaced-repetition-tool/blob/main/exam/generate.ts"
click node_weekly_plan "https://github.com/jung028/leetcode-spaced-repetition-tool/blob/main/shared/weekly-plan/WeeklyPlanView.tsx"
click node_study_notes "https://github.com/jung028/leetcode-spaced-repetition-tool/blob/main/notes/App.tsx"
click node_module_planner "https://github.com/jung028/leetcode-spaced-repetition-tool/blob/main/ModulePlanner.tsx"
click node_training "https://github.com/jung028/leetcode-spaced-repetition-tool/blob/main/training/plan.ts"
click node_announcements "https://github.com/jung028/leetcode-spaced-repetition-tool/blob/main/AnnouncementsBoard.tsx"
click node_interview "https://github.com/jung028/leetcode-spaced-repetition-tool/blob/main/interview/App.tsx"
click node_leetcode150 "https://github.com/jung028/leetcode-spaced-repetition-tool/blob/main/leetcode150/content.ts"
click node_calendar_ui "https://github.com/jung028/leetcode-spaced-repetition-tool/blob/main/UniCalendar.tsx"

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_server,node_home toneBlue
class node_leetcode_review,node_review_store,node_review_api,node_scheduler,node_capture_script,node_todo,node_todo_store,node_jobs,node_jobs_store,node_calendar_ui toneAmber
class node_exam_ui,node_exam_api,node_exam_store,node_exam_content,node_exam_catalog,node_exam_generation toneMint
class node_weekly_plan,node_study_notes,node_module_planner,node_training toneRose
class node_announcements,node_interview,node_leetcode150,node_learner,node_leetcode,node_calendar toneIndigo
```

## Components

### App shell

- [Bun server](https://github.com/jung028/leetcode-spaced-repetition-tool/blob/main/index.ts): `index.ts`
- [Home board](https://github.com/jung028/leetcode-spaced-repetition-tool/blob/main/HomeApp.tsx): `HomeApp.tsx`

### Review and due work

- [LeetCode reviews](https://github.com/jung028/leetcode-spaced-repetition-tool/blob/main/leetcode/leetcode.ts): `leetcode/leetcode.ts`
- [Review data](https://github.com/jung028/leetcode-spaced-repetition-tool/blob/main/leetcode/db.ts): `leetcode/db.ts`
- [Review API](https://github.com/jung028/leetcode-spaced-repetition-tool/blob/main/leetcode/api.ts): `leetcode/api.ts`
- [Review scheduling](https://github.com/jung028/leetcode-spaced-repetition-tool/blob/main/shared/scheduling.ts): `shared/scheduling.ts`
- [Page capture](https://github.com/jung028/leetcode-spaced-repetition-tool/blob/main/userscript/leetcode-sync.user.js): `userscript/leetcode-sync.user.js`
- [Todo list](https://github.com/jung028/leetcode-spaced-repetition-tool/blob/main/todo/App.tsx): `todo/App.tsx`
- [Todo data](https://github.com/jung028/leetcode-spaced-repetition-tool/blob/main/todo/db.ts): `todo/db.ts`
- [Job pipeline](https://github.com/jung028/leetcode-spaced-repetition-tool/blob/main/jobs/App.tsx): `jobs/App.tsx`
- [Job data](https://github.com/jung028/leetcode-spaced-repetition-tool/blob/main/jobs/db.ts): `jobs/db.ts`
- [Calendar view](https://github.com/jung028/leetcode-spaced-repetition-tool/blob/main/UniCalendar.tsx): `UniCalendar.tsx`

### Exam practice

- [Exam practice](https://github.com/jung028/leetcode-spaced-repetition-tool/blob/main/exam/App.tsx): `exam/App.tsx`
- [Exam API](https://github.com/jung028/leetcode-spaced-repetition-tool/blob/main/exam/api.ts): `exam/api.ts`
- [Exam progress](https://github.com/jung028/leetcode-spaced-repetition-tool/blob/main/exam/db.ts): `exam/db.ts`
- [Course papers](https://github.com/jung028/leetcode-spaced-repetition-tool/tree/main/exam-content): `exam-content`
- [Paper schedule](https://github.com/jung028/leetcode-spaced-repetition-tool/blob/main/exam/content.ts): `exam/content.ts`
- [Paper generation](https://github.com/jung028/leetcode-spaced-repetition-tool/blob/main/exam/generate.ts): `exam/generate.ts`

### Planning and notes

- [Weekly planner](https://github.com/jung028/leetcode-spaced-repetition-tool/blob/main/shared/weekly-plan/WeeklyPlanView.tsx): `shared/weekly-plan/WeeklyPlanView.tsx`
- [Notes](https://github.com/jung028/leetcode-spaced-repetition-tool/blob/main/notes/App.tsx): `notes/App.tsx`
- [Module planner](https://github.com/jung028/leetcode-spaced-repetition-tool/blob/main/ModulePlanner.tsx): `ModulePlanner.tsx`
- [Training plan](https://github.com/jung028/leetcode-spaced-repetition-tool/blob/main/training/plan.ts): `training/plan.ts`

### Other study tools

- [Announcements](https://github.com/jung028/leetcode-spaced-repetition-tool/blob/main/AnnouncementsBoard.tsx): `AnnouncementsBoard.tsx`
- [Interview practice](https://github.com/jung028/leetcode-spaced-repetition-tool/blob/main/interview/App.tsx): `interview/App.tsx`
- [LeetCode 150](https://github.com/jung028/leetcode-spaced-repetition-tool/blob/main/leetcode150/content.ts): `leetcode150/content.ts`

### Other components

- **Learner**
- **LeetCode page**
- **Google Calendar**

## Connections

- Learner → Bun server: uses app
- Bun server → Review API: registers routes (evidence: `index.ts`)
- Bun server → Todo list: serves app
- Bun server → Exam API: registers routes (evidence: `index.ts`)
- Bun server → Job pipeline: serves app
- Learner → LeetCode reviews: adds solution
- LeetCode page → Page capture: provides solution
- Page capture → Review API: captures problem
- Review API → Review data: reads and writes (evidence: `leetcode/api.ts`)
- Review data → Review scheduling: uses ladder (evidence: `leetcode/db.ts`)
- Learner → LeetCode reviews: reviews due items
- LeetCode reviews → Review API: loads and updates
- LeetCode reviews → Calendar view: shows schedule
- Calendar view → Google Calendar: embeds calendar
- Home board → LeetCode reviews: merges due items
- Home board → Todo list: merges due items
- Home board → Exam practice: merges due items
- Home board → Job pipeline: merges next actions
- Todo list → Todo data: manages tasks (evidence: `todo/App.tsx`)
- Job pipeline → Job data: manages roles (evidence: `jobs/App.tsx`)
- Exam practice → Exam API: requests papers (evidence: `exam/App.tsx`)
- Exam API → Exam progress: reads and writes (evidence: `exam/api.ts`)
- Exam API → Paper schedule: builds schedule (evidence: `exam/api.ts`)
- Paper schedule → Course papers: aggregates papers (evidence: `exam/content.ts`)
- Exam API → Paper generation: starts generation (evidence: `exam/api.ts`)
- Learner → Exam practice: practices papers
- Notes → Weekly planner: renders training (evidence: `notes/App.tsx`)
- Training plan → Weekly planner: supplies plan (evidence: `training/App.tsx`)
- Learner → Module planner: plans modules
- Learner → Announcements: views announcements
- Learner → Interview practice: practices interviews
- Learner → LeetCode 150: studies problems
