# seanprashad/leetcode-patterns architecture

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

- Interactive diagram: https://gitdiagram.com/seanprashad/leetcode-patterns
- Repository: https://github.com/seanprashad/leetcode-patterns

## Overview

Leetcode Patterns is a browser-based coding-interview practice app: users browse questions organized by patterns, track completion and review progress, and can follow structured roadmaps. The main page assembles the practice views and learning panels. Local persistence and optional signed-in synchronization support progress across sessions and devices. The README also documents fundamentals and Java solutions, but these are reference material rather than runtime subsystems in this tree. Several component implementations were not sampled, so uncertain internal wiring is omitted.

Main entry points: [`src/app/page.tsx`](https://github.com/seanprashad/leetcode-patterns/blob/main/src/app/page.tsx) (Home page), [`src/components/roadmaps/RoadmapView.tsx`](https://github.com/seanprashad/leetcode-patterns/blob/main/src/components/roadmaps/RoadmapView.tsx) (Roadmap view), [`src/components/layout/AuthContext.tsx`](https://github.com/seanprashad/leetcode-patterns/blob/main/src/components/layout/AuthContext.tsx) (Auth context), [`src/components/layout/ViewSwitcher.tsx`](https://github.com/seanprashad/leetcode-patterns/blob/main/src/components/layout/ViewSwitcher.tsx) (View switcher)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_experience["Practice experience"]
  node_home["Home page<br/>[page.tsx]"]
  node_view["View switcher<br/>[ViewSwitcher.tsx]"]
  node_table["Question table<br/>[QuestionsTable.tsx]"]
  node_toolbar["Question filters<br/>[FilterToolbar.tsx]"]
  node_row["Question actions<br/>[QuestionRow.tsx]"]
  node_review["Review date"]
end

subgraph group_learning["Learning resources"]
  node_roadmap["Roadmap view<br/>[RoadmapView.tsx]"]
  node_roadmapdata["Roadmap content<br/>[roadmaps.ts]"]
  node_tips["Practice tips<br/>[TipsPanel.tsx]"]
  node_about["About panel<br/>[AboutPanel.tsx]"]
  node_acknowledgements["Acknowledgements"]
end

subgraph group_state["Progress and state"]
  node_storage[("Browser progress<br/>[storage.ts]")]
  node_reminders["Reminder logic<br/>[reminders.ts]"]
end

subgraph group_integrations["External integrations"]
  node_auth["Auth context<br/>[AuthContext.tsx]"]
  node_sync["Progress sync<br/>[sync.ts]"]
  node_supabase["Supabase client<br/>[supabase.ts]"]
  node_analytics["Analytics<br/>[analytics.ts]"]
  node_service_registrar["Service worker registration"]
  node_service_worker["Offline cache<br/>[sw.js]"]
  node_question_updater["Question metadata updater"]
end

node_learner(("Learner"))
node_supabase_service[("Supabase")]
node_leetcode["LeetCode API"]

node_learner -->|"opens"| node_home
node_home -->|"renders"| node_view
node_home -->|"renders"| node_tips
node_home -->|"renders"| node_about
node_home -->|"renders"| node_acknowledgements
node_view -->|"selects view"| node_table
node_table -->|"filters questions"| node_toolbar
node_table -->|"renders rows"| node_row
node_row -->|"opens"| node_review
node_view -->|"selects view"| node_roadmap
node_roadmap -->|"reads phases"| node_roadmapdata
node_row -->|"persists progress"| node_storage
node_roadmap -->|"loads and saves"| node_storage
node_roadmap -->|"initializes reminders"| node_reminders
node_review -->|"uses date helpers"| node_reminders
node_auth -->|"uses"| node_supabase
node_auth -->|"coordinates sync"| node_sync
node_sync -->|"merges progress"| node_storage
node_sync -->|"reads and writes"| node_supabase_service
node_auth -->|"tracks events"| node_analytics
node_question_updater -->|"fetches metadata"| node_leetcode
node_service_registrar -->|"registers"| node_service_worker

click node_home "https://github.com/seanprashad/leetcode-patterns/blob/main/src/app/page.tsx"
click node_view "https://github.com/seanprashad/leetcode-patterns/blob/main/src/components/layout/ViewSwitcher.tsx"
click node_table "https://github.com/seanprashad/leetcode-patterns/blob/main/src/components/questions/QuestionsTable.tsx"
click node_toolbar "https://github.com/seanprashad/leetcode-patterns/blob/main/src/components/questions/FilterToolbar.tsx"
click node_row "https://github.com/seanprashad/leetcode-patterns/blob/main/src/components/questions/QuestionRow.tsx"
click node_review "https://github.com/seanprashad/leetcode-patterns/blob/main/src/components/questions/ReviewDateModal.tsx"
click node_roadmap "https://github.com/seanprashad/leetcode-patterns/blob/main/src/components/roadmaps/RoadmapView.tsx"
click node_roadmapdata "https://github.com/seanprashad/leetcode-patterns/blob/main/src/data/roadmaps.ts"
click node_tips "https://github.com/seanprashad/leetcode-patterns/blob/main/src/components/panels/TipsPanel.tsx"
click node_about "https://github.com/seanprashad/leetcode-patterns/blob/main/src/components/panels/AboutPanel.tsx"
click node_acknowledgements "https://github.com/seanprashad/leetcode-patterns/blob/main/src/components/panels/AcknowledgementsPanel.tsx"
click node_storage "https://github.com/seanprashad/leetcode-patterns/blob/main/src/lib/storage.ts"
click node_reminders "https://github.com/seanprashad/leetcode-patterns/blob/main/src/lib/reminders.ts"
click node_auth "https://github.com/seanprashad/leetcode-patterns/blob/main/src/components/layout/AuthContext.tsx"
click node_sync "https://github.com/seanprashad/leetcode-patterns/blob/main/src/lib/sync.ts"
click node_supabase "https://github.com/seanprashad/leetcode-patterns/blob/main/src/lib/supabase.ts"
click node_analytics "https://github.com/seanprashad/leetcode-patterns/blob/main/src/lib/analytics.ts"
click node_service_registrar "https://github.com/seanprashad/leetcode-patterns/blob/main/src/components/layout/ServiceWorkerRegistrar.tsx"
click node_service_worker "https://github.com/seanprashad/leetcode-patterns/blob/main/public/sw.js"
click node_question_updater "https://github.com/seanprashad/leetcode-patterns/blob/main/cron/update_questions.py"

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_home,node_view,node_table,node_toolbar,node_row,node_review toneBlue
class node_roadmap,node_roadmapdata,node_tips,node_about,node_acknowledgements,node_supabase_service toneAmber
class node_storage,node_reminders,node_leetcode toneMint
class node_auth,node_sync,node_supabase,node_analytics,node_service_registrar,node_service_worker,node_question_updater toneRose
class node_learner toneIndigo
```

## Components

### Practice experience

- [Home page](https://github.com/seanprashad/leetcode-patterns/blob/main/src/app/page.tsx): `src/app/page.tsx`
- [View switcher](https://github.com/seanprashad/leetcode-patterns/blob/main/src/components/layout/ViewSwitcher.tsx): `src/components/layout/ViewSwitcher.tsx`
- [Question table](https://github.com/seanprashad/leetcode-patterns/blob/main/src/components/questions/QuestionsTable.tsx): `src/components/questions/QuestionsTable.tsx`
- [Question filters](https://github.com/seanprashad/leetcode-patterns/blob/main/src/components/questions/FilterToolbar.tsx): `src/components/questions/FilterToolbar.tsx`
- [Question actions](https://github.com/seanprashad/leetcode-patterns/blob/main/src/components/questions/QuestionRow.tsx): `src/components/questions/QuestionRow.tsx`
- [Review date](https://github.com/seanprashad/leetcode-patterns/blob/main/src/components/questions/ReviewDateModal.tsx): `src/components/questions/ReviewDateModal.tsx`

### Learning resources

- [Roadmap view](https://github.com/seanprashad/leetcode-patterns/blob/main/src/components/roadmaps/RoadmapView.tsx): `src/components/roadmaps/RoadmapView.tsx`
- [Roadmap content](https://github.com/seanprashad/leetcode-patterns/blob/main/src/data/roadmaps.ts): `src/data/roadmaps.ts`
- [Practice tips](https://github.com/seanprashad/leetcode-patterns/blob/main/src/components/panels/TipsPanel.tsx): `src/components/panels/TipsPanel.tsx`
- [About panel](https://github.com/seanprashad/leetcode-patterns/blob/main/src/components/panels/AboutPanel.tsx): `src/components/panels/AboutPanel.tsx`
- [Acknowledgements](https://github.com/seanprashad/leetcode-patterns/blob/main/src/components/panels/AcknowledgementsPanel.tsx): `src/components/panels/AcknowledgementsPanel.tsx`

### Progress and state

- [Browser progress](https://github.com/seanprashad/leetcode-patterns/blob/main/src/lib/storage.ts): `src/lib/storage.ts`
- [Reminder logic](https://github.com/seanprashad/leetcode-patterns/blob/main/src/lib/reminders.ts): `src/lib/reminders.ts`

### External integrations

- [Auth context](https://github.com/seanprashad/leetcode-patterns/blob/main/src/components/layout/AuthContext.tsx): `src/components/layout/AuthContext.tsx`
- [Progress sync](https://github.com/seanprashad/leetcode-patterns/blob/main/src/lib/sync.ts): `src/lib/sync.ts`
- [Supabase client](https://github.com/seanprashad/leetcode-patterns/blob/main/src/lib/supabase.ts): `src/lib/supabase.ts`
- [Analytics](https://github.com/seanprashad/leetcode-patterns/blob/main/src/lib/analytics.ts): `src/lib/analytics.ts`
- [Service worker registration](https://github.com/seanprashad/leetcode-patterns/blob/main/src/components/layout/ServiceWorkerRegistrar.tsx): `src/components/layout/ServiceWorkerRegistrar.tsx`
- [Offline cache](https://github.com/seanprashad/leetcode-patterns/blob/main/public/sw.js): `public/sw.js`
- [Question metadata updater](https://github.com/seanprashad/leetcode-patterns/blob/main/cron/update_questions.py): `cron/update_questions.py`

### Other components

- **Learner**
- **Supabase**
- **LeetCode API**

## Connections

- Learner → Home page: opens
- Home page → View switcher: renders
- Home page → Practice tips: renders
- Home page → About panel: renders
- Home page → Acknowledgements: renders
- View switcher → Question table: selects view
- Question table → Question filters: filters questions
- Question table → Question actions: renders rows
- Question actions → Review date: opens
- View switcher → Roadmap view: selects view
- Roadmap view → Roadmap content: reads phases
- Question actions → Browser progress: persists progress
- Roadmap view → Browser progress: loads and saves
- Roadmap view → Reminder logic: initializes reminders
- Review date → Reminder logic: uses date helpers
- Auth context → Supabase client: uses
- Auth context → Progress sync: coordinates sync
- Progress sync → Browser progress: merges progress
- Progress sync → Supabase: reads and writes
- Auth context → Analytics: tracks events
- Question metadata updater → LeetCode API: fetches metadata
- Service worker registration → Offline cache: registers
