Skip to content

How It Works

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) │
└───────────┘
  • 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
  • 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
  • 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

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.

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.

When you share text from your phone:

  1. Capture — The mobile app sends a POST /add request to the server with the selected text and your auth headers (X-User-Id, X-Auth-Token).

  2. Queue — The server stores the entry in the database with added_to_anki = false.

  3. Poll — The desktop app polls GET /pending every few seconds and receives any unprocessed entries.

  4. Tokenize — For each entry, the desktop app sends the text to the local Yomitan API’s /tokenize endpoint, which breaks it into individual words/tokens.

  5. Enrich — For each token, it calls Yomitan’s /ankiFields endpoint to get dictionary data: definitions, readings, pitch accents, audio URLs, etc.

  6. Create Card — The desktop app sends an addNote request to AnkiConnect with the enriched data mapped to your configured Anki fields.

  7. 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.

  • Per-user authentication — Every API request includes X-User-Id and X-Auth-Token headers. 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.