How It Works
Overview
Section titled “Overview”Remoki is a three-part system: mobile apps for capturing text, a cloud server for queuing, and a desktop app for processing entries into Anki cards.
┌─────────┐ ┌──────────────┐ ┌─────────────┐ ┌─────────┐│ Phone │ ──→ │ Cloud Server │ ──→ │ Desktop App │ ──→ │ Anki ││ (share) │ │ (queue) │ │ (process) │ │ (cards) │└─────────┘ └──────────────┘ └─────────────┘ └─────────┘ │ ┌─────┴─────┐ │ Yomitan │ │ (API) │ └───────────┘Components
Section titled “Components”Cloud Server
Section titled “Cloud Server”- Runs on Cloudflare Workers with a D1 (SQLite) database
- Stores pending mining entries per user
- Handles device registration and authentication
- Globally distributed — low latency from anywhere
- No personal data stored beyond mining entries and auth tokens
Desktop App
Section titled “Desktop App”- Built with Tauri (Rust backend, React frontend)
- Polls the server every few seconds for new entries
- Sends text to the local Yomitan API for tokenization and dictionary lookup
- Creates Anki cards via AnkiConnect with your configured field mappings
- Manages settings, field mappings, and pairing
Mobile Apps
Section titled “Mobile Apps”- Android: Kotlin with Jetpack Compose, integrates as a share sheet extension and text selection action
- iOS: SwiftUI with a share extension
- Both use QR code scanning to pair with the desktop app
- Minimal footprint — their only job is to send selected text to the server
Data Flow
Section titled “Data Flow”1. Registration
Section titled “1. Registration”When the desktop app launches for the first time, it generates a unique user ID and registers with the cloud server. The server returns an authentication token. No email or sign-up required.
2. Pairing
Section titled “2. Pairing”The desktop app encodes the server URL, user ID, and auth token into a QR code. When a mobile app scans this code, it stores those credentials locally. All subsequent shares from that phone are authenticated with those credentials.
3. Mining Cycle
Section titled “3. Mining Cycle”When you share text from your phone:
-
Capture — The mobile app sends a
POST /addrequest to the server with the selected text and your auth headers (X-User-Id,X-Auth-Token). -
Queue — The server stores the entry in the database with
added_to_anki = false. -
Poll — The desktop app polls
GET /pendingevery few seconds and receives any unprocessed entries. -
Tokenize — For each entry, the desktop app sends the text to the local Yomitan API’s
/tokenizeendpoint, which breaks it into individual words/tokens. -
Enrich — For each token, it calls Yomitan’s
/ankiFieldsendpoint to get dictionary data: definitions, readings, pitch accents, audio URLs, etc. -
Create Card — The desktop app sends an
addNoterequest to AnkiConnect with the enriched data mapped to your configured Anki fields. -
Mark Complete — On success, the desktop app updates the server entry to
added_to_anki = true. On failure, the error is logged and the entry can be retried.
Security
Section titled “Security”- Per-user authentication — Every API request includes
X-User-IdandX-Auth-Tokenheaders. Entries are isolated per user. - QR pairing — Credentials are transferred via QR code scan, avoiding manual entry of long tokens.
- Local processing — All text enrichment (dictionary lookups, definitions) happens on your machine through Yomitan. The cloud server only sees the raw text you shared.
- Edge hosting — The server runs on Cloudflare’s edge network with built-in DDoS protection.