↓Skip to main content

LexiStack — Spaced-Repetition Flashcards

·2 mins

Status: actively in progress — core study flow (SM-2 scheduling, card review) is working; deck/LLM-assisted content generation is evolving.

The problem #

Most flashcard apps either get the spaced-repetition math right or make card creation pleasant — rarely both. LexiStack is a from-scratch implementation of the SM-2 algorithm paired with an LLM-assisted workflow for suggesting cards and generating deck content, aimed at making both the science and the day-to-day use frictionless.

Architecture #

Two independent packages, each with its own Git history:

  • Backend (lexistack/) — Java 21, Spring Boot, Maven, file-based H2 database, Spring AI for LLM integration.
  • Frontend (lexistack-web/) — SvelteKit 2, Svelte 5 (runes), TypeScript, Tailwind CSS 4.

Key design decisions #

  • SM-2 behind a strategy interface. The spaced-repetition algorithm is implemented as SrsAlgorithmStrategy → Sm2StrategyImpl, keeping the scheduling logic swappable without touching the rest of the review flow. Review grades map to the classic Again/Hard/Good/Easy scale, with a minimum ease factor floor to prevent runaway scheduling intervals.
  • LLM as an assistant, not a dependency. Spring AI integrates an LLM to suggest cards and generate deck content, but the core review loop works entirely independently of it — the app degrades gracefully without the AI provider.
  • 1:1 Card/CardProgress split. Scheduling state (CardProgress) is modeled separately from card content (Card), inserted first and referenced by id — keeping SRS bookkeeping decoupled from the editorial content of a card.
  • Strict typing end to end. TypeScript strict mode on the frontend and Lombok-reduced boilerplate on the backend, prioritizing explicitness over convenience shortcuts.

Stack #

Java 21 · Spring Boot · Spring AI · SvelteKit 2 · Svelte 5 · TypeScript · Tailwind CSS 4 · H2