# zibhelina/etude architecture

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

- Interactive diagram: https://gitdiagram.com/zibhelina/etude
- Repository: https://github.com/zibhelina/etude

## Overview

Etude is a local-first study environment combining programmable flashcards, spaced repetition, a Notebook, Courses, deadlines, AI agents, and sync. A learner works through cards and receives grading and scheduled follow-up; they can also organize material in notes or courses and inspect study progress. The web app and CLI expose the product, while the server routes requests into the core engine and its SQLite-backed collection. README capabilities are included even where implementation excerpts were unavailable; dashed edges mark relationships not verified in sampled source.

Main entry points: [`src/core/engine.ts`](https://github.com/zibhelina/etude/blob/main/src/core/engine.ts) (Collection engine), [`src/server`](https://github.com/zibhelina/etude/tree/main/src/server) (HTTP routes), [`web/src/App.tsx`](https://github.com/zibhelina/etude/blob/main/web/src/App.tsx) (Web application), [`desktop/app.ts`](https://github.com/zibhelina/etude/blob/main/desktop/app.ts) (Desktop shell)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_interfaces["User interfaces"]
  node_web_app["Web application<br/>[App.tsx]"]
  node_desktop_app["Desktop shell<br/>[app.ts]"]
  node_cli["CLI and MCP<br/>[run.ts]"]
  node_http_routes["HTTP routes"]
end

subgraph group_study["Study engine"]
  node_engine["Collection engine<br/>[engine.ts]"]
  node_collection_db[("SQLite collection<br/>[db.ts]")]
  node_card_types["Programmable card types"]
  node_scheduling["Schedulers<br/>[schedulers.ts]"]
  node_study_stats["Study analytics<br/>[engine-stats.ts]"]
end

subgraph group_knowledge["Knowledge workspace"]
  node_notebook["Notebook and folders<br/>[notes.ts]"]
  node_courses_agenda["Courses and agenda<br/>[courses.ts]"]
  node_media["Media handling<br/>[engine-media.ts]"]
end

subgraph group_services["Sharing and services"]
  node_ai_agents["AI and agents<br/>[agent.ts]"]
  node_market["Market and account<br/>[market.ts]"]
  node_sync_share["Sync and sharing<br/>[client.ts]"]
  node_plugins["Plugins<br/>[plugins.ts]"]
  node_telemetry["Telemetry<br/>[telemetry.ts]"]
end

subgraph group_automation["Automation and insight"]
  node_pack_import["Pack and Anki import<br/>[engine-packs.ts]"]
end

node_learner(("Learner"))
node_agent_user(("AI agent"))

node_learner -.->|"uses"| node_web_app
node_learner -.->|"uses"| node_desktop_app
node_agent_user -->|"automates"| node_cli
node_web_app -.->|"requests"| node_http_routes
node_desktop_app -.->|"opens engine"| node_http_routes
node_cli -.->|"commands"| node_engine
node_http_routes -->|"calls"| node_engine
node_engine -->|"opens"| node_collection_db
node_engine -->|"uses"| node_notebook
node_engine -->|"uses"| node_scheduling
node_http_routes -->|"stores media"| node_media
node_http_routes -->|"routes agent requests"| node_ai_agents
node_http_routes -->|"routes course requests"| node_courses_agenda
node_engine -.->|"provides analytics"| node_study_stats
node_learner -->|"practices"| node_card_types
node_learner -->|"organizes notes"| node_notebook
node_learner -->|"plans study"| node_courses_agenda
node_learner -->|"discovers content"| node_market
node_engine -.->|"imports content"| node_pack_import
node_learner -->|"syncs and shares"| node_sync_share
node_learner -.->|"extends app"| node_plugins
node_engine -->|"reports activity"| node_telemetry

click node_web_app "https://github.com/zibhelina/etude/blob/main/web/src/App.tsx"
click node_desktop_app "https://github.com/zibhelina/etude/blob/main/desktop/app.ts"
click node_cli "https://github.com/zibhelina/etude/blob/main/src/cli/run.ts"
click node_http_routes "https://github.com/zibhelina/etude/tree/main/src/server"
click node_engine "https://github.com/zibhelina/etude/blob/main/src/core/engine.ts"
click node_collection_db "https://github.com/zibhelina/etude/blob/main/src/core/db.ts"
click node_card_types "https://github.com/zibhelina/etude/tree/main/types"
click node_scheduling "https://github.com/zibhelina/etude/blob/main/src/core/schedulers.ts"
click node_study_stats "https://github.com/zibhelina/etude/blob/main/src/core/engine-stats.ts"
click node_notebook "https://github.com/zibhelina/etude/blob/main/src/core/notes.ts"
click node_courses_agenda "https://github.com/zibhelina/etude/blob/main/src/core/courses.ts"
click node_media "https://github.com/zibhelina/etude/blob/main/src/core/engine-media.ts"
click node_ai_agents "https://github.com/zibhelina/etude/blob/main/src/core/agent.ts"
click node_market "https://github.com/zibhelina/etude/blob/main/src/core/market.ts"
click node_sync_share "https://github.com/zibhelina/etude/blob/main/src/core/sync/client.ts"
click node_plugins "https://github.com/zibhelina/etude/blob/main/src/core/plugins.ts"
click node_telemetry "https://github.com/zibhelina/etude/blob/main/src/core/telemetry.ts"
click node_pack_import "https://github.com/zibhelina/etude/blob/main/src/core/engine-packs.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_web_app,node_desktop_app,node_cli,node_http_routes toneBlue
class node_engine,node_collection_db,node_card_types,node_scheduling,node_study_stats toneAmber
class node_notebook,node_courses_agenda,node_media toneMint
class node_ai_agents,node_market,node_sync_share,node_plugins,node_telemetry toneRose
class node_pack_import,node_learner,node_agent_user toneIndigo
```

## Components

### User interfaces

- [Web application](https://github.com/zibhelina/etude/blob/main/web/src/App.tsx): `web/src/App.tsx`
- [Desktop shell](https://github.com/zibhelina/etude/blob/main/desktop/app.ts): `desktop/app.ts`
- [CLI and MCP](https://github.com/zibhelina/etude/blob/main/src/cli/run.ts): `src/cli/run.ts`
- [HTTP routes](https://github.com/zibhelina/etude/tree/main/src/server): `src/server`

### Study engine

- [Collection engine](https://github.com/zibhelina/etude/blob/main/src/core/engine.ts): `src/core/engine.ts`
- [SQLite collection](https://github.com/zibhelina/etude/blob/main/src/core/db.ts): `src/core/db.ts`
- [Programmable card types](https://github.com/zibhelina/etude/tree/main/types): `types`
- [Schedulers](https://github.com/zibhelina/etude/blob/main/src/core/schedulers.ts): `src/core/schedulers.ts`
- [Study analytics](https://github.com/zibhelina/etude/blob/main/src/core/engine-stats.ts): `src/core/engine-stats.ts`

### Knowledge workspace

- [Notebook and folders](https://github.com/zibhelina/etude/blob/main/src/core/notes.ts): `src/core/notes.ts`
- [Courses and agenda](https://github.com/zibhelina/etude/blob/main/src/core/courses.ts): `src/core/courses.ts`
- [Media handling](https://github.com/zibhelina/etude/blob/main/src/core/engine-media.ts): `src/core/engine-media.ts`

### Sharing and services

- [AI and agents](https://github.com/zibhelina/etude/blob/main/src/core/agent.ts): `src/core/agent.ts`
- [Market and account](https://github.com/zibhelina/etude/blob/main/src/core/market.ts): `src/core/market.ts`
- [Sync and sharing](https://github.com/zibhelina/etude/blob/main/src/core/sync/client.ts): `src/core/sync/client.ts`
- [Plugins](https://github.com/zibhelina/etude/blob/main/src/core/plugins.ts): `src/core/plugins.ts`
- [Telemetry](https://github.com/zibhelina/etude/blob/main/src/core/telemetry.ts): `src/core/telemetry.ts`

### Automation and insight

- [Pack and Anki import](https://github.com/zibhelina/etude/blob/main/src/core/engine-packs.ts): `src/core/engine-packs.ts`

### Other components

- **Learner**
- **AI agent**

## Connections

- Learner → Web application: uses (evidence: `README.md`)
- Learner → Desktop shell: uses (evidence: `README.md`)
- AI agent → CLI and MCP: automates (evidence: `README.md`)
- Web application → HTTP routes: requests
- Desktop shell → HTTP routes: opens engine
- CLI and MCP → Collection engine: commands
- HTTP routes → Collection engine: calls (evidence: `src/server/routes-collection.ts`)
- Collection engine → SQLite collection: opens (evidence: `src/core/engine.ts`)
- Collection engine → Notebook and folders: uses (evidence: `src/core/engine.ts`)
- Collection engine → Schedulers: uses (evidence: `src/core/engine.ts`)
- HTTP routes → Media handling: stores media (evidence: `src/server/routes-settings.ts`)
- HTTP routes → AI and agents: routes agent requests (evidence: `src/server/routes-agent.ts`)
- HTTP routes → Courses and agenda: routes course requests (evidence: `src/server/routes-frames.ts`)
- Collection engine → Study analytics: provides analytics (evidence: `src/core/engine.ts`)
- Learner → Programmable card types: practices (evidence: `README.md`)
- Learner → Notebook and folders: organizes notes (evidence: `README.md`)
- Learner → Courses and agenda: plans study (evidence: `README.md`)
- Learner → Market and account: discovers content (evidence: `README.md`)
- Collection engine → Pack and Anki import: imports content (evidence: `src/core/engine.ts`)
- Learner → Sync and sharing: syncs and shares (evidence: `README.md`)
- Learner → Plugins: extends app
- Collection engine → Telemetry: reports activity (evidence: `src/core/telemetry.ts`)
