# yashmahawa/super-md architecture

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

- Interactive diagram: https://gitdiagram.com/yashmahawa/super-md
- Repository: https://github.com/yashmahawa/super-md

## Overview

Super MD is a cross-platform Markdown workspace for opening notes, editing or reading them, using embedded study tools, and exporting paginated PDFs. Desktop uses a native Qt interface; Android uses native Compose controls with a WebView reader, while the TypeScript document UI supplies editing and rendered-note features. The graph preserves the documented Python, media, recovery, and PDF capabilities. Some subsystem links are based on README statements because their implementation was not sampled.

Main entry points: [`src/App.tsx`](https://github.com/yashmahawa/super-md/blob/main/src/App.tsx) (Workspace), [`android/app/src/main/java/dev/supermd/studio/StudioViewModel.kt`](https://github.com/yashmahawa/super-md/blob/main/android/app/src/main/java/dev/supermd/studio/StudioViewModel.kt) (Studio state), [`src/components/MarkdownPreview.tsx`](https://github.com/yashmahawa/super-md/blob/main/src/components/MarkdownPreview.tsx) (Rendered reader), [`desktop/studio.py`](https://github.com/yashmahawa/super-md/blob/main/desktop/studio.py) (Desktop workspace)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_web["Document UI"]
  node_webapp["Workspace<br/>[App.tsx]"]
  node_editor["Markdown editor<br/>[Editor.tsx]"]
  node_preview["Rendered reader"]
  node_chart["Interactive graphs"]
  node_media["Media tools<br/>[MediaTools.tsx]"]
  node_pythonui["Python cells<br/>[PythonCell.tsx]"]
  node_pdfui["PDF export<br/>[preparePdf.tsx]"]
end

subgraph group_desktop["Desktop App"]
  node_desktopentry["Qt entry point<br/>[main.py]"]
  node_desktopstudio["Desktop workspace<br/>[studio.py]"]
  node_documents["File handling<br/>[documents.py]"]
  node_pythonruntime["Python runtime<br/>[python_runtime.py]"]
end

subgraph group_android["Android App"]
  node_androidactivity["Compose workspace<br/>[MainActivity.kt]"]
  node_viewmodel["Studio state<br/>[StudioViewModel.kt]"]
  node_storage[("Media storage<br/>[MediaStorage.kt]")]
  node_recovery["Draft recovery<br/>[NoteRecovery.kt]"]
  node_fonts["Font library<br/>[FontLibrary.kt]"]
  node_worker["Python worker"]
end

subgraph group_engine["Document Services"]
  node_pdfengine["Typesetting engine<br/>[lib.rs]"]
  node_portable["Portable notes<br/>[portable.rs]"]
  node_rustbridge["Native commands<br/>[lib.rs]"]
end

node_user(("Note author"))

node_user -->|"opens note"| node_webapp
node_webapp -->|"hosts editing"| node_editor
node_webapp -->|"renders reading"| node_preview
node_preview -->|"renders charts"| node_chart
node_preview -->|"renders cells"| node_pythonui
node_webapp -->|"offers media tools"| node_media
node_webapp -.->|"exports PDF"| node_pdfui
node_user -->|"launches desktop"| node_desktopentry
node_desktopentry -->|"creates workspace"| node_desktopstudio
node_desktopstudio -->|"uses file handling"| node_documents
node_desktopstudio -->|"runs cells"| node_pythonruntime
node_user -->|"opens Android app"| node_androidactivity
node_androidactivity -->|"uses state"| node_viewmodel
node_viewmodel -->|"manages media"| node_storage
node_viewmodel -->|"recovers drafts"| node_recovery
node_viewmodel -->|"manages fonts"| node_fonts
node_viewmodel -->|"dispatches cells"| node_worker
node_worker -.->|"runs Python"| node_pythonruntime
node_pdfui -.->|"typesets pages"| node_pdfengine
node_rustbridge -->|"packs notes"| node_portable

click node_webapp "https://github.com/yashmahawa/super-md/blob/main/src/App.tsx"
click node_editor "https://github.com/yashmahawa/super-md/blob/main/src/components/Editor.tsx"
click node_preview "https://github.com/yashmahawa/super-md/blob/main/src/components/MarkdownPreview.tsx"
click node_chart "https://github.com/yashmahawa/super-md/blob/main/src/components/InteractiveChart.tsx"
click node_media "https://github.com/yashmahawa/super-md/blob/main/src/components/MediaTools.tsx"
click node_pythonui "https://github.com/yashmahawa/super-md/blob/main/src/components/PythonCell.tsx"
click node_pdfui "https://github.com/yashmahawa/super-md/blob/main/src/preparePdf.tsx"
click node_desktopentry "https://github.com/yashmahawa/super-md/blob/main/desktop/main.py"
click node_desktopstudio "https://github.com/yashmahawa/super-md/blob/main/desktop/studio.py"
click node_documents "https://github.com/yashmahawa/super-md/blob/main/desktop/documents.py"
click node_pythonruntime "https://github.com/yashmahawa/super-md/blob/main/desktop/python_runtime.py"
click node_androidactivity "https://github.com/yashmahawa/super-md/blob/main/android/app/src/main/java/dev/supermd/studio/MainActivity.kt"
click node_viewmodel "https://github.com/yashmahawa/super-md/blob/main/android/app/src/main/java/dev/supermd/studio/StudioViewModel.kt"
click node_storage "https://github.com/yashmahawa/super-md/blob/main/android/app/src/main/java/dev/supermd/studio/MediaStorage.kt"
click node_recovery "https://github.com/yashmahawa/super-md/blob/main/android/app/src/main/java/dev/supermd/studio/NoteRecovery.kt"
click node_fonts "https://github.com/yashmahawa/super-md/blob/main/android/app/src/main/java/dev/supermd/studio/FontLibrary.kt"
click node_worker "https://github.com/yashmahawa/super-md/blob/main/android/app/src/main/java/dev/supermd/studio/PythonWorkerService.kt"
click node_pdfengine "https://github.com/yashmahawa/super-md/blob/main/smd-core/src/lib.rs"
click node_portable "https://github.com/yashmahawa/super-md/blob/main/smd-core/src/portable.rs"
click node_rustbridge "https://github.com/yashmahawa/super-md/blob/main/src-tauri/src/lib.rs"

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_webapp,node_editor,node_preview,node_chart,node_media,node_pythonui,node_pdfui toneBlue
class node_desktopentry,node_desktopstudio,node_documents,node_pythonruntime toneAmber
class node_androidactivity,node_viewmodel,node_storage,node_recovery,node_fonts,node_worker toneMint
class node_pdfengine,node_portable,node_rustbridge toneRose
class node_user toneIndigo
```

## Components

### Document UI

- [Workspace](https://github.com/yashmahawa/super-md/blob/main/src/App.tsx): `src/App.tsx`
- [Markdown editor](https://github.com/yashmahawa/super-md/blob/main/src/components/Editor.tsx): `src/components/Editor.tsx`
- [Rendered reader](https://github.com/yashmahawa/super-md/blob/main/src/components/MarkdownPreview.tsx): `src/components/MarkdownPreview.tsx`
- [Interactive graphs](https://github.com/yashmahawa/super-md/blob/main/src/components/InteractiveChart.tsx): `src/components/InteractiveChart.tsx`
- [Media tools](https://github.com/yashmahawa/super-md/blob/main/src/components/MediaTools.tsx): `src/components/MediaTools.tsx`
- [Python cells](https://github.com/yashmahawa/super-md/blob/main/src/components/PythonCell.tsx): `src/components/PythonCell.tsx`
- [PDF export](https://github.com/yashmahawa/super-md/blob/main/src/preparePdf.tsx): `src/preparePdf.tsx`

### Desktop App

- [Qt entry point](https://github.com/yashmahawa/super-md/blob/main/desktop/main.py): `desktop/main.py`
- [Desktop workspace](https://github.com/yashmahawa/super-md/blob/main/desktop/studio.py): `desktop/studio.py`
- [File handling](https://github.com/yashmahawa/super-md/blob/main/desktop/documents.py): `desktop/documents.py`
- [Python runtime](https://github.com/yashmahawa/super-md/blob/main/desktop/python_runtime.py): `desktop/python_runtime.py`

### Android App

- [Compose workspace](https://github.com/yashmahawa/super-md/blob/main/android/app/src/main/java/dev/supermd/studio/MainActivity.kt): `android/app/src/main/java/dev/supermd/studio/MainActivity.kt`
- [Studio state](https://github.com/yashmahawa/super-md/blob/main/android/app/src/main/java/dev/supermd/studio/StudioViewModel.kt): `android/app/src/main/java/dev/supermd/studio/StudioViewModel.kt`
- [Media storage](https://github.com/yashmahawa/super-md/blob/main/android/app/src/main/java/dev/supermd/studio/MediaStorage.kt): `android/app/src/main/java/dev/supermd/studio/MediaStorage.kt`
- [Draft recovery](https://github.com/yashmahawa/super-md/blob/main/android/app/src/main/java/dev/supermd/studio/NoteRecovery.kt): `android/app/src/main/java/dev/supermd/studio/NoteRecovery.kt`
- [Font library](https://github.com/yashmahawa/super-md/blob/main/android/app/src/main/java/dev/supermd/studio/FontLibrary.kt): `android/app/src/main/java/dev/supermd/studio/FontLibrary.kt`
- [Python worker](https://github.com/yashmahawa/super-md/blob/main/android/app/src/main/java/dev/supermd/studio/PythonWorkerService.kt): `android/app/src/main/java/dev/supermd/studio/PythonWorkerService.kt`

### Document Services

- [Typesetting engine](https://github.com/yashmahawa/super-md/blob/main/smd-core/src/lib.rs): `smd-core/src/lib.rs`
- [Portable notes](https://github.com/yashmahawa/super-md/blob/main/smd-core/src/portable.rs): `smd-core/src/portable.rs`
- [Native commands](https://github.com/yashmahawa/super-md/blob/main/src-tauri/src/lib.rs): `src-tauri/src/lib.rs`

### Other components

- **Note author**

## Connections

- Note author → Workspace: opens note (evidence: `src/App.tsx`)
- Workspace → Markdown editor: hosts editing (evidence: `src/App.tsx`)
- Workspace → Rendered reader: renders reading (evidence: `src/App.tsx`)
- Rendered reader → Interactive graphs: renders charts (evidence: `src/components/MarkdownPreview.tsx`)
- Rendered reader → Python cells: renders cells (evidence: `src/components/MarkdownPreview.tsx`)
- Workspace → Media tools: offers media tools (evidence: `src/App.tsx`)
- Workspace → PDF export: exports PDF (evidence: `README.md`)
- Note author → Qt entry point: launches desktop (evidence: `README.md`)
- Qt entry point → Desktop workspace: creates workspace (evidence: `desktop/main.py`)
- Desktop workspace → File handling: uses file handling (evidence: `desktop/studio.py`)
- Desktop workspace → Python runtime: runs cells (evidence: `desktop/studio.py`)
- Note author → Compose workspace: opens Android app (evidence: `README.md`)
- Compose workspace → Studio state: uses state (evidence: `android/app/src/main/java/dev/supermd/studio/MainActivity.kt`)
- Studio state → Media storage: manages media (evidence: `android/app/src/main/java/dev/supermd/studio/StudioViewModel.kt`)
- Studio state → Draft recovery: recovers drafts (evidence: `android/app/src/main/java/dev/supermd/studio/StudioViewModel.kt`)
- Studio state → Font library: manages fonts (evidence: `android/app/src/main/java/dev/supermd/studio/StudioViewModel.kt`)
- Studio state → Python worker: dispatches cells (evidence: `android/app/src/main/java/dev/supermd/studio/StudioViewModel.kt`)
- Python worker → Python runtime: runs Python
- PDF export → Typesetting engine: typesets pages (evidence: `README.md`)
- Native commands → Portable notes: packs notes (evidence: `src-tauri/src/lib.rs`)
