How taoist22/sn-flashcards works
Flashcards for Supernote is a React Native spaced-repetition plugin. Users create or import cards, optionally capture handwriting from a note, organize cards into decks, then study and record FSRS reviews; cards and settings persist locally, with optional Anki text exchange and image/ink features. App.tsx is the sampled UI orchestrator. README capabilities such as note-based deck suggestions, hints, images, and stats are represented, though their internal implementation is not fully sampled; only shown or documented relationships are connected.
Main entry points: App.tsx Plugin UI · ankiText.ts Anki text exchange · store.ts Domain store · inkCapture.ts Ink and image capture
Components 22
Plugin workflow
- Plugin UI
App.tsx - Deck management
App.tsx - Card creation
App.tsx - Note suggestions
App.tsx - Study and stats
App.tsx - Lasso OCR
src/services/lassoOcr.ts - Ink and image capture
src/services/inkCapture.ts
Cards and scheduling
- Card and deck model
src/types/flashcards.ts - Domain store
src/services/store.ts - FSRS scheduling
src/services/fsrsScheduler.ts
Device services
- Ink surface bridge
src/services/inkSurface.ts - Ink surface view
src/components/InkSurface.tsx - Native pen engine
android/app/src/main/java/com/supernoteflashcards/InkSurfaceModule.kt - Native host view
android/app/src/main/java/com/supernoteflashcards/InkSurfaceViewManager.kt - Storage bridge
src/services/nativeStorage.ts - Android file storage
android/app/src/main/java/com/supernoteflashcards/FlashcardStorageModule.java - File permissions
src/services/pluginPermissions.ts
Anki exchange
- Backup and restore
src/services/backup.ts - Anki text exchange
src/services/ankiText.ts
Other components
- Supernote user
- Current note
- Anki text files
Connections 25
- Supernote user → Plugin UI: uses
README.md - Plugin UI → Deck management: manages
README.md - Plugin UI → Card creation: creates
README.md - Plugin UI → Note suggestions: configures
README.md - Plugin UI → Study and stats: starts
README.md - Current note → Plugin UI: provides context
README.md - Plugin UI → Lasso OCR: requests recognition
App.tsx - Lasso OCR → Ink and image capture: renders lasso images
src/services/lassoOcr.ts - Plugin UI → Ink and image capture: imports images
App.tsx - Plugin UI → Domain store: updates domain state
App.tsx - Domain store → Card and deck model: uses types
src/services/store.ts - Domain store → FSRS scheduling: schedules reviews
src/services/store.ts - Domain store → Storage bridge: loads and saves
src/services/store.ts - Storage bridge → Android file storage: calls native storage
src/services/nativeStorage.ts - Plugin UI → Backup and restore: backs up data
App.tsx - Plugin UI → Anki text exchange: imports and exports
App.tsx - Anki text exchange → Domain store: fingerprints cards
src/services/ankiText.ts - Anki text exchange → Storage bridge: reads and writes files
src/services/ankiText.ts - Anki text exchange → Anki text files: exchanges text files
README.md - Plugin UI → File permissions: checks permissions
App.tsx - Ink and image capture → File permissions: requests access
src/services/inkCapture.ts - Anki text exchange → File permissions: requests access
src/services/ankiText.ts - Plugin UI → Ink surface view: renders
App.tsx - Ink surface view → Ink surface bridge: uses bridge
- Native pen engine → Native host view: hosts pen engine
android/app/src/main/java/com/supernoteflashcards/InkSurfaceViewManager.kt