Personal project

Lernzeit

Lernzeit is a local-first app for learning German, built with React and TypeScript. It combines FSRS spaced-repetition flashcards, an A1 to B1 grammar course, short stories and speaking questions read aloud by an offline German voice, a focus timer and a task board. It installs as a PWA, works offline, and AI assistants can add study material to it over MCP.

ReactTypeScriptViteTailwindIndexedDBPWAMCPCloudflare Workers
The Lernzeit sign-in page: a street in Bremen with the quote Übung macht den Meister beside the Willkommen zurück form

The problem

Lernzeit puts daily German practice in one app: flashcards, an A1 to B1 grammar course, short stories, speaking questions, a focus timer and a task board. It had to run with no backend, store every card and study session in the browser, work offline on a phone, and still let an AI assistant write study material into it.

My role

I designed and built Lernzeit alone: the IndexedDB data model, the FSRS scheduling, the on-device German voice, the PWA, the MCP bridge and the deployment on Cloudflare Workers.

Key decisions

  1. Local-first storage in IndexedDB

    Cards, study sessions and tasks live in IndexedDB and never leave the device. Every view subscribes to live queries, so an edit appears immediately, including in other open tabs, and a service worker serves the app when the network is gone.

  2. FSRS scheduling with an in-session queue

    ts-fsrs schedules each review from the card’s memory stability and difficulty, so intervals follow how well each word is actually retained. Within a session, a card rated Again returns 3 cards later, Hard 8 and Good 15, and the same word never appears twice in a row.

  3. A focus timer built on timestamps

    The focus timer stores timestamps and computes elapsed time from them instead of counting in memory. A refresh, a closed tab or a phone going to sleep loses nothing, and a session that crosses midnight is split across both days.

  4. An MCP bridge to browser-only data

    An outside process cannot open a browser’s IndexedDB, so the MCP server holds no data. It relays each tool call over a local WebSocket to the open Lernzeit tab, which writes it through the same code path as a card added by hand. A token authenticates the connection, and the Web Locks API ensures exactly one tab handles each request.

  5. On-device German text-to-speech

    The Thorsten German voice downloads once, then reads every card, story and speaking question aloud offline, with no API key or account. Each clip is synthesized once and cached, and the next card’s audio is generated while you are still answering the current one.