How antigluten/amgi works
Amgi is an offline-first, Anki-compatible flashcard app for iOS, with watchOS and widget companions. The main workflow is to manage decks and cards, study a scheduled review queue, and sync collection changes with a compatible server. The SwiftUI features call dependency-client interfaces, which lead through service facades and typed protobuf requests to Anki’s Rust engine. Other major capabilities include browsing and editing cards, EPUB reading with offline dictionary lookup, statistics, templates, image occlusion, and Shortcuts. Some feature-level links are documented rather than verified in sampled implementation excerpts.
Main entry points: AnkiClients Dependency clients · RootView.swift App shell · EPUBChapterPageController.swift EPUB reader · ReviewSession.swift Review session
Components 25
App experience
- App shell
AmgiFeatures/Sources/RootFeature/RootView.swift - Deck management
AmgiFeatures/Sources/DecksFeature/DeckList/DeckListView.swift - Review session
AmgiFeatures/Sources/ReviewCore/ReviewSession.swift - Browse and edit
AmgiFeatures/Sources/BrowseFeature/BrowseView.swift - Template editing
AmgiFeatures/Sources/TemplatesFeature/TemplateEditorView.swift - Statistics
AmgiFeatures/Sources/StatsFeature/StatsDashboardView.swift - Sync flow
AmgiFeatures/Sources/SyncFeature/SyncCoordinator.swift - Theme system
AmgiUI/Sources/Theme/ThemeManager.swift
Reading
- EPUB reader
AmgiFeatures/Sources/ReaderFeature/Reader/EPUBChapterPageController.swift - Reader book client
Sources/AnkiClients/ReaderBookClient+Live.swift - Dictionary lookup
AmgiReader/Sources/ReaderDictionary/DictionaryLookupRuntime.swift - EPUB parsing
AmgiReader/Sources/ReaderEPUB/EPUBBookParser.swift
Anki domain
- Dependency clients
Sources/AnkiClients - Service facades
Sources/AnkiServices - Domain models
Sources/AnkiKit - Card rendering
Sources/AmgiCardWeb/CardRenderEngine.swift
Backend bridge
- Backend wrapper
Sources/AnkiBackend/AnkiBackend.swift - Protobuf bridge
Sources/AnkiProtoBridge/ServiceCatalog.swift - Anki Rust engine
anki-bridge-rs/src/lib.rs - Collection storage
Companions
- Home widgets
AmgiFeatures/Sources/WidgetFeature/WidgetTimelineProvider.swift - Watch app
AmgiFeatures/Sources/WatchFeature/WatchContentView.swift - Shortcuts
AmgiFeatures/Sources/IntentsFeature/StudyDeckIntent.swift
Other components
- Learner
- Sync server
Connections 28
- Learner → App shell: uses
- App shell → Deck management: routes to
- App shell → Review session: routes to
- App shell → Browse and edit: routes to
- App shell → Statistics: routes to
- App shell → Sync flow: routes to
- Deck management → Dependency clients: requests data
README.md - Review session → Dependency clients: requests review data
README.md - Review session → Card rendering: prepares cards
AmgiFeatures/Sources/ReviewCore/ReviewSession.swift - Browse and edit → Dependency clients: requests data
- Template editing → Dependency clients: requests data
- Statistics → Dependency clients: requests data
- Sync flow → Dependency clients: calls
AmgiFeatures/Sources/SyncFeature/SyncCoordinator.swift - Sync flow → Sync server: synchronizes
README.md - EPUB reader → Reader book client: loads books
- EPUB reader → Dictionary lookup: looks up text
- EPUB reader → EPUB parsing: opens EPUB
- Reader book client → Dependency clients: uses note clients
Sources/AnkiClients/ReaderBookClient+Live.swift - Reader book client → Domain models: assembles books
Sources/AnkiClients/ReaderBookClient+Live.swift - Dependency clients → Service facades: calls
README.md - Service facades → Backend wrapper: invokes
Sources/AnkiServices/DecksService.swift - Backend wrapper → Protobuf bridge: dispatches requests
README.md - Protobuf bridge → Anki Rust engine: bridges calls
README.md - Anki Rust engine → Collection storage: reads and writes
README.md - Theme system → App shell: supplies appearance
- Home widgets → Collection storage: shows due counts
- Watch app → Anki Rust engine: runs engine
README.md - Shortcuts → Dependency clients: requests actions