# ssreal/lc-recall architecture

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

- Interactive diagram: https://gitdiagram.com/ssreal/lc-recall
- Repository: https://github.com/ssreal/lc-recall

## Overview

LC Recall is a browser-based coding-interview flashcard app. Users review due cards (or cram), rate recall, and see updated schedules; they can also browse and edit a problem deck, create cards, import LLM-generated cards, inspect analytics, and back up or restore data. The graph separates the React interface, study/card domain logic, and browser persistence, with Markdown/code rendering as an internal presentation layer. Some links rely on the SOURCE INDEX or README because the relevant source was not fully sampled.

Main entry points: [`src/App.tsx`](https://github.com/ssreal/lc-recall/blob/main/src/App.tsx) (App coordinator), [`lib/storage.ts`](https://github.com/ssreal/lc-recall/blob/main/lib/storage.ts) (Deck storage and JSON), [`lib/fsrs.ts`](https://github.com/ssreal/lc-recall/blob/main/lib/fsrs.ts) (FSRS scheduler), [`src/components/ReviewSession.tsx`](https://github.com/ssreal/lc-recall/blob/main/src/components/ReviewSession.tsx) (Review session)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_ui["Application interface"]
  node_app["App coordinator<br/>[App.tsx]"]
  node_header["Navigation and theme<br/>[Header.tsx]"]
  node_review["Review session<br/>[ReviewSession.tsx]"]
  node_deck["Problem deck<br/>[CardList.tsx]"]
  node_editor["Card editor<br/>[CardModal.tsx]"]
  node_backup["Backup and restore"]
  node_llm["Prompt import"]
  node_analytics["Memory analytics<br/>[StatsView.tsx]"]
end

subgraph group_study["Study and card logic"]
  node_fsrs["FSRS scheduler<br/>[fsrs.ts]"]
  node_prompt["Prompt and response parsing<br/>[promptGenerator.ts]"]
  node_starters["Starter deck<br/>[starterCards.ts]"]
  node_shuffle["Card shuffling<br/>[shuffle.ts]"]
  node_schema["Flashcard model<br/>[flashcard.ts]"]
end

subgraph group_persistence["Deck persistence"]
  node_storage["Deck storage and JSON<br/>[storage.ts]"]
  node_local[("Browser local storage")]
end

subgraph group_render["Content rendering"]
  node_markdown["Markdown renderer"]
  node_codeblock["Code block renderer<br/>[CodeBlock.tsx]"]
  node_prism["Syntax highlighting<br/>[prism.ts]"]
end

node_user(("Learner"))

node_user -->|"uses"| node_app
node_app -->|"loads and saves"| node_storage
node_app -->|"renders"| node_header
node_app -->|"renders"| node_review
node_app -->|"renders"| node_deck
node_app -->|"renders"| node_analytics
node_app -->|"renders"| node_editor
node_app -->|"renders"| node_backup
node_app -->|"renders"| node_llm
node_review -->|"updates schedule"| node_fsrs
node_review -->|"shuffles cards"| node_shuffle
node_deck -->|"renders content"| node_markdown
node_deck -->|"uses scheduling"| node_fsrs
node_editor -->|"uses scheduling"| node_fsrs
node_editor -->|"renders content"| node_markdown
node_editor -->|"renders snippets"| node_codeblock
node_backup -->|"imports and exports"| node_storage
node_backup -->|"resets to starters"| node_starters
node_llm -->|"generates and parses"| node_prompt
node_llm -->|"renders snippets"| node_codeblock
node_markdown -->|"renders code"| node_codeblock
node_codeblock -->|"highlights code"| node_prism
node_storage -->|"reads and writes"| node_local
node_storage -->|"initializes deck"| node_starters
node_starters -->|"creates scheduler cards"| node_fsrs
node_prompt -->|"creates scheduler cards"| node_fsrs
node_storage -->|"converts card data"| node_schema
node_prompt -->|"builds flashcards"| node_schema
node_review -->|"uses card model"| node_schema
node_analytics -->|"reads card model"| node_schema

click node_app "https://github.com/ssreal/lc-recall/blob/main/src/App.tsx"
click node_header "https://github.com/ssreal/lc-recall/blob/main/src/components/Header.tsx"
click node_review "https://github.com/ssreal/lc-recall/blob/main/src/components/ReviewSession.tsx"
click node_deck "https://github.com/ssreal/lc-recall/blob/main/src/components/CardList.tsx"
click node_editor "https://github.com/ssreal/lc-recall/blob/main/src/components/CardModal.tsx"
click node_backup "https://github.com/ssreal/lc-recall/blob/main/src/components/ImportExportModal.tsx"
click node_llm "https://github.com/ssreal/lc-recall/blob/main/src/components/LLMPromptImportModal.tsx"
click node_analytics "https://github.com/ssreal/lc-recall/blob/main/src/components/StatsView.tsx"
click node_fsrs "https://github.com/ssreal/lc-recall/blob/main/lib/fsrs.ts"
click node_prompt "https://github.com/ssreal/lc-recall/blob/main/lib/promptGenerator.ts"
click node_starters "https://github.com/ssreal/lc-recall/blob/main/lib/starterCards.ts"
click node_shuffle "https://github.com/ssreal/lc-recall/blob/main/lib/shuffle.ts"
click node_schema "https://github.com/ssreal/lc-recall/blob/main/types/flashcard.ts"
click node_storage "https://github.com/ssreal/lc-recall/blob/main/lib/storage.ts"
click node_markdown "https://github.com/ssreal/lc-recall/blob/main/src/components/common/MarkdownRenderer.tsx"
click node_codeblock "https://github.com/ssreal/lc-recall/blob/main/src/components/common/CodeBlock.tsx"
click node_prism "https://github.com/ssreal/lc-recall/blob/main/src/lib/prism.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_app,node_header,node_review,node_deck,node_editor,node_backup,node_llm,node_analytics toneBlue
class node_fsrs,node_prompt,node_starters,node_shuffle,node_schema toneAmber
class node_storage,node_local toneMint
class node_markdown,node_codeblock,node_prism toneRose
class node_user toneIndigo
```

## Components

### Application interface

- [App coordinator](https://github.com/ssreal/lc-recall/blob/main/src/App.tsx): `src/App.tsx`
- [Navigation and theme](https://github.com/ssreal/lc-recall/blob/main/src/components/Header.tsx): `src/components/Header.tsx`
- [Review session](https://github.com/ssreal/lc-recall/blob/main/src/components/ReviewSession.tsx): `src/components/ReviewSession.tsx`
- [Problem deck](https://github.com/ssreal/lc-recall/blob/main/src/components/CardList.tsx): `src/components/CardList.tsx`
- [Card editor](https://github.com/ssreal/lc-recall/blob/main/src/components/CardModal.tsx): `src/components/CardModal.tsx`
- [Backup and restore](https://github.com/ssreal/lc-recall/blob/main/src/components/ImportExportModal.tsx): `src/components/ImportExportModal.tsx`
- [Prompt import](https://github.com/ssreal/lc-recall/blob/main/src/components/LLMPromptImportModal.tsx): `src/components/LLMPromptImportModal.tsx`
- [Memory analytics](https://github.com/ssreal/lc-recall/blob/main/src/components/StatsView.tsx): `src/components/StatsView.tsx`

### Study and card logic

- [FSRS scheduler](https://github.com/ssreal/lc-recall/blob/main/lib/fsrs.ts): `lib/fsrs.ts`
- [Prompt and response parsing](https://github.com/ssreal/lc-recall/blob/main/lib/promptGenerator.ts): `lib/promptGenerator.ts`
- [Starter deck](https://github.com/ssreal/lc-recall/blob/main/lib/starterCards.ts): `lib/starterCards.ts`
- [Card shuffling](https://github.com/ssreal/lc-recall/blob/main/lib/shuffle.ts): `lib/shuffle.ts`
- [Flashcard model](https://github.com/ssreal/lc-recall/blob/main/types/flashcard.ts): `types/flashcard.ts`

### Deck persistence

- [Deck storage and JSON](https://github.com/ssreal/lc-recall/blob/main/lib/storage.ts): `lib/storage.ts`
- **Browser local storage**

### Content rendering

- [Markdown renderer](https://github.com/ssreal/lc-recall/blob/main/src/components/common/MarkdownRenderer.tsx): `src/components/common/MarkdownRenderer.tsx`
- [Code block renderer](https://github.com/ssreal/lc-recall/blob/main/src/components/common/CodeBlock.tsx): `src/components/common/CodeBlock.tsx`
- [Syntax highlighting](https://github.com/ssreal/lc-recall/blob/main/src/lib/prism.ts): `src/lib/prism.ts`

### Other components

- **Learner**

## Connections

- Learner → App coordinator: uses (evidence: `README.md`)
- App coordinator → Deck storage and JSON: loads and saves (evidence: `src/App.tsx`)
- App coordinator → Navigation and theme: renders (evidence: `src/App.tsx`)
- App coordinator → Review session: renders (evidence: `src/App.tsx`)
- App coordinator → Problem deck: renders (evidence: `src/App.tsx`)
- App coordinator → Memory analytics: renders (evidence: `src/App.tsx`)
- App coordinator → Card editor: renders (evidence: `src/App.tsx`)
- App coordinator → Backup and restore: renders (evidence: `src/App.tsx`)
- App coordinator → Prompt import: renders (evidence: `src/App.tsx`)
- Review session → FSRS scheduler: updates schedule (evidence: `src/components/ReviewSession.tsx`)
- Review session → Card shuffling: shuffles cards (evidence: `src/components/ReviewSession.tsx`)
- Problem deck → Markdown renderer: renders content (evidence: `src/components/CardList.tsx`)
- Problem deck → FSRS scheduler: uses scheduling (evidence: `src/components/CardList.tsx`)
- Card editor → FSRS scheduler: uses scheduling (evidence: `src/components/CardModal.tsx`)
- Card editor → Markdown renderer: renders content (evidence: `src/components/CardModal.tsx`)
- Card editor → Code block renderer: renders snippets (evidence: `src/components/CardModal.tsx`)
- Backup and restore → Deck storage and JSON: imports and exports (evidence: `src/components/ImportExportModal.tsx`)
- Backup and restore → Starter deck: resets to starters (evidence: `src/components/ImportExportModal.tsx`)
- Prompt import → Prompt and response parsing: generates and parses (evidence: `src/components/LLMPromptImportModal.tsx`)
- Prompt import → Code block renderer: renders snippets (evidence: `src/components/LLMPromptImportModal.tsx`)
- Markdown renderer → Code block renderer: renders code (evidence: `src/components/common/MarkdownRenderer.tsx`)
- Code block renderer → Syntax highlighting: highlights code (evidence: `src/components/common/CodeBlock.tsx`)
- Deck storage and JSON → Browser local storage: reads and writes (evidence: `lib/storage.ts`)
- Deck storage and JSON → Starter deck: initializes deck (evidence: `lib/storage.ts`)
- Starter deck → FSRS scheduler: creates scheduler cards (evidence: `lib/starterCards.ts`)
- Prompt and response parsing → FSRS scheduler: creates scheduler cards (evidence: `lib/promptGenerator.ts`)
- Deck storage and JSON → Flashcard model: converts card data (evidence: `lib/storage.ts`)
- Prompt and response parsing → Flashcard model: builds flashcards (evidence: `lib/promptGenerator.ts`)
- Review session → Flashcard model: uses card model (evidence: `src/components/ReviewSession.tsx`)
- Memory analytics → Flashcard model: reads card model (evidence: `src/components/StatsView.tsx`)
