# kiy-codes/recall-flashcards architecture

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

- Interactive diagram: https://gitdiagram.com/kiy-codes/recall-flashcards
- Repository: https://github.com/kiy-codes/recall-flashcards
- Video tour (about a minute): https://gitdiagram.com/kiy-codes/recall-flashcards/video

## Overview

Recall is a local-first flashcard product for desktop and web, with a separate React Native mobile client. The central user workflow is creating or importing decks, studying cards, and retaining progress locally; major branches add tests, a built-in deck catalog, sharing, optional AI evaluation, and manually controlled cloud snapshots. The tree and excerpts identify these domains, but do not show how the large desktop app dispatches to most of its helpers, so those internal edges are omitted. Supabase and mobile relationships are shown only where the excerpts establish them.

Main entry points: [`supabase/functions/_shared/providers.ts`](https://github.com/kiy-codes/recall-flashcards/blob/main/supabase/functions/_shared/providers.ts) (AI provider adapter), [`supabase/functions/evaluate-answer/index.ts`](https://github.com/kiy-codes/recall-flashcards/blob/main/supabase/functions/evaluate-answer/index.ts) (Answer evaluation endpoint), [`mobile/src/MobileApp.js`](https://github.com/kiy-codes/recall-flashcards/blob/main/mobile/src/MobileApp.js) (Mobile app), [`catalog-core.js`](https://github.com/kiy-codes/recall-flashcards/blob/main/catalog-core.js) (Catalog validation)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_study["Decks and study"]
  node_desktop["Desktop and web app<br/>[app.js]"]
  node_scheduling["Review scheduler<br/>[scheduler.js]"]
  node_metadata["Deck metadata<br/>[metadata-utils.js]"]
  node_answer_eval["Local answer evaluation<br/>[ai-evaluator.js]"]
end

subgraph group_catalog["Deck catalog"]
  node_catalog_ui["Catalog browser<br/>[catalog-ui.js]"]
  node_catalog_service["Catalog service<br/>[catalog-service.js]"]
  node_catalog_core["Catalog validation<br/>[catalog-core.js]"]
  node_admin_library["Library publishing<br/>[index.ts]"]
end

subgraph group_cloud["Sharing and sync"]
  node_account["Account UI<br/>[account-ui.js]"]
  node_share_ui["Share interface<br/>[share-ui.js]"]
  node_share_service["Share service<br/>[share-service.js]"]
  node_share_core["Share data handling<br/>[share-core.js]"]
  node_sync_ui["Cloud account UI<br/>[account-ui.js]"]
  node_sync_service["Snapshot sync<br/>[sync-service.js]"]
  node_sync_core["Snapshot validation and merge<br/>[sync-core.js]"]
  node_cloud_client["Cloud client entry"]
end

subgraph group_ai["AI services"]
  node_ai_admin["AI administration<br/>[index.ts]"]
  node_answer_endpoint["Answer evaluation endpoint<br/>[index.ts]"]
  node_input_validation["Evaluation validation<br/>[evaluator.ts]"]
  node_providers["AI provider adapter<br/>[providers.ts]"]
end

subgraph group_mobile["Mobile client"]
  node_mobile_app["Mobile app<br/>[MobileApp.js]"]
  node_mobile_core["Mobile library and study logic<br/>[core.js]"]
  node_local_store[("Mobile local storage")]
end

node_learner(("Learner"))
node_ai_provider{{"AI provider APIs"}}

node_learner -->|"uses"| node_desktop
node_catalog_ui -->|"validates decks"| node_catalog_core
node_admin_library -->|"uses"| node_catalog_core
node_share_service -->|"uses"| node_share_core
node_sync_service -->|"uses"| node_sync_core
node_cloud_client -->|"imports"| node_sync_core
node_ai_admin -->|"calls"| node_providers
node_answer_endpoint -->|"validates input"| node_input_validation
node_answer_endpoint -->|"calls"| node_providers
node_providers -->|"validates result"| node_input_validation
node_providers -->|"requests"| node_ai_provider
node_mobile_app -->|"uses"| node_mobile_core
node_mobile_app -->|"reads and writes"| node_local_store

click node_desktop "https://github.com/kiy-codes/recall-flashcards/blob/main/app.js"
click node_scheduling "https://github.com/kiy-codes/recall-flashcards/blob/main/scheduler.js"
click node_metadata "https://github.com/kiy-codes/recall-flashcards/blob/main/metadata-utils.js"
click node_answer_eval "https://github.com/kiy-codes/recall-flashcards/blob/main/ai-evaluator.js"
click node_account "https://github.com/kiy-codes/recall-flashcards/blob/main/account-ui.js"
click node_catalog_ui "https://github.com/kiy-codes/recall-flashcards/blob/main/catalog-ui.js"
click node_catalog_service "https://github.com/kiy-codes/recall-flashcards/blob/main/catalog-service.js"
click node_catalog_core "https://github.com/kiy-codes/recall-flashcards/blob/main/catalog-core.js"
click node_admin_library "https://github.com/kiy-codes/recall-flashcards/blob/main/supabase/functions/admin-library/index.ts"
click node_share_ui "https://github.com/kiy-codes/recall-flashcards/blob/main/share-ui.js"
click node_share_service "https://github.com/kiy-codes/recall-flashcards/blob/main/share-service.js"
click node_share_core "https://github.com/kiy-codes/recall-flashcards/blob/main/share-core.js"
click node_sync_ui "https://github.com/kiy-codes/recall-flashcards/blob/main/account-ui.js"
click node_sync_service "https://github.com/kiy-codes/recall-flashcards/blob/main/sync-service.js"
click node_sync_core "https://github.com/kiy-codes/recall-flashcards/blob/main/sync-core.js"
click node_cloud_client "https://github.com/kiy-codes/recall-flashcards/blob/main/cloud-client-entry.js"
click node_ai_admin "https://github.com/kiy-codes/recall-flashcards/blob/main/supabase/functions/admin-ai/index.ts"
click node_answer_endpoint "https://github.com/kiy-codes/recall-flashcards/blob/main/supabase/functions/evaluate-answer/index.ts"
click node_input_validation "https://github.com/kiy-codes/recall-flashcards/blob/main/supabase/functions/_shared/evaluator.ts"
click node_providers "https://github.com/kiy-codes/recall-flashcards/blob/main/supabase/functions/_shared/providers.ts"
click node_mobile_app "https://github.com/kiy-codes/recall-flashcards/blob/main/mobile/src/MobileApp.js"
click node_mobile_core "https://github.com/kiy-codes/recall-flashcards/blob/main/mobile/src/core.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_desktop,node_scheduling,node_metadata,node_answer_eval toneBlue
class node_catalog_ui,node_catalog_service,node_catalog_core,node_admin_library toneAmber
class node_account,node_share_ui,node_share_service,node_share_core,node_sync_ui,node_sync_service,node_sync_core,node_cloud_client,node_ai_provider toneMint
class node_ai_admin,node_answer_endpoint,node_input_validation,node_providers toneRose
class node_mobile_app,node_mobile_core,node_local_store,node_learner toneIndigo
```

## Components

### Decks and study

- [Desktop and web app](https://github.com/kiy-codes/recall-flashcards/blob/main/app.js): `app.js`
- [Review scheduler](https://github.com/kiy-codes/recall-flashcards/blob/main/scheduler.js): `scheduler.js`
- [Deck metadata](https://github.com/kiy-codes/recall-flashcards/blob/main/metadata-utils.js): `metadata-utils.js`
- [Local answer evaluation](https://github.com/kiy-codes/recall-flashcards/blob/main/ai-evaluator.js): `ai-evaluator.js`

### Deck catalog

- [Catalog browser](https://github.com/kiy-codes/recall-flashcards/blob/main/catalog-ui.js): `catalog-ui.js`
- [Catalog service](https://github.com/kiy-codes/recall-flashcards/blob/main/catalog-service.js): `catalog-service.js`
- [Catalog validation](https://github.com/kiy-codes/recall-flashcards/blob/main/catalog-core.js): `catalog-core.js`
- [Library publishing](https://github.com/kiy-codes/recall-flashcards/blob/main/supabase/functions/admin-library/index.ts): `supabase/functions/admin-library/index.ts`

### Sharing and sync

- [Account UI](https://github.com/kiy-codes/recall-flashcards/blob/main/account-ui.js): `account-ui.js`
- [Share interface](https://github.com/kiy-codes/recall-flashcards/blob/main/share-ui.js): `share-ui.js`
- [Share service](https://github.com/kiy-codes/recall-flashcards/blob/main/share-service.js): `share-service.js`
- [Share data handling](https://github.com/kiy-codes/recall-flashcards/blob/main/share-core.js): `share-core.js`
- [Cloud account UI](https://github.com/kiy-codes/recall-flashcards/blob/main/account-ui.js): `account-ui.js`
- [Snapshot sync](https://github.com/kiy-codes/recall-flashcards/blob/main/sync-service.js): `sync-service.js`
- [Snapshot validation and merge](https://github.com/kiy-codes/recall-flashcards/blob/main/sync-core.js): `sync-core.js`
- [Cloud client entry](https://github.com/kiy-codes/recall-flashcards/blob/main/cloud-client-entry.js): `cloud-client-entry.js`

### AI services

- [AI administration](https://github.com/kiy-codes/recall-flashcards/blob/main/supabase/functions/admin-ai/index.ts): `supabase/functions/admin-ai/index.ts`
- [Answer evaluation endpoint](https://github.com/kiy-codes/recall-flashcards/blob/main/supabase/functions/evaluate-answer/index.ts): `supabase/functions/evaluate-answer/index.ts`
- [Evaluation validation](https://github.com/kiy-codes/recall-flashcards/blob/main/supabase/functions/_shared/evaluator.ts): `supabase/functions/_shared/evaluator.ts`
- [AI provider adapter](https://github.com/kiy-codes/recall-flashcards/blob/main/supabase/functions/_shared/providers.ts): `supabase/functions/_shared/providers.ts`

### Mobile client

- [Mobile app](https://github.com/kiy-codes/recall-flashcards/blob/main/mobile/src/MobileApp.js): `mobile/src/MobileApp.js`
- [Mobile library and study logic](https://github.com/kiy-codes/recall-flashcards/blob/main/mobile/src/core.js): `mobile/src/core.js`
- **Mobile local storage**

### Other components

- **Learner**
- **AI provider APIs**

## Connections

- Learner → Desktop and web app: uses (evidence: `README.md`)
- Catalog browser → Catalog validation: validates decks (evidence: `README.md`)
- Library publishing → Catalog validation: uses (evidence: `supabase/functions/admin-library/index.ts`)
- Share service → Share data handling: uses (evidence: `share-service.js`)
- Snapshot sync → Snapshot validation and merge: uses (evidence: `sync-service.js`)
- Cloud client entry → Snapshot validation and merge: imports (evidence: `cloud-client-entry.js`)
- AI administration → AI provider adapter: calls (evidence: `supabase/functions/admin-ai/index.ts`)
- Answer evaluation endpoint → Evaluation validation: validates input (evidence: `supabase/functions/evaluate-answer/index.ts`)
- Answer evaluation endpoint → AI provider adapter: calls (evidence: `supabase/functions/evaluate-answer/index.ts`)
- AI provider adapter → Evaluation validation: validates result (evidence: `supabase/functions/_shared/providers.ts`)
- AI provider adapter → AI provider APIs: requests (evidence: `supabase/functions/_shared/providers.ts`)
- Mobile app → Mobile library and study logic: uses (evidence: `mobile/src/MobileApp.js`)
- Mobile app → Mobile local storage: reads and writes (evidence: `mobile/src/MobileApp.js`)
