LoopKit
Production-ready flashcard engine with SM-2 spaced repetition for NestJS and React
LoopKit is a production-ready flashcard engine implementing the SM-2 spaced repetition algorithm. It handles deck hierarchies, note types, card scheduling, and content rendering. It ships as two packages that work together.
Packages
| Package | Description |
|---|---|
@hfu.digital/loopkit-nestjs | Backend NestJS module with pluggable storage, SRS algorithms, and content pipeline |
@hfu.digital/loopkit-react | Frontend library with headless hooks and pre-styled study components |
Key Features
- SM-2 Spaced Repetition — Battle-tested algorithm with configurable parameters
- Pluggable Storage — Bring your own database via the storage adapter pattern (Prisma adapter included)
- Algorithm Pluggability — Swap SM-2 for any custom algorithm via the
SRSAlgorithminterface - Headless-First Frontend — Hooks for full control, plus optional pre-styled components
- Content Pipeline — Template interpolation with optional Markdown, KaTeX, code-highlighting, and HTML-sanitization transforms
- Import / Export — CSV and JSON import/export for deck portability
- Statistics — Pure functions for retention rate, study streak, review forecast, and more
- Undo Support — Undo the last review during a study session
- Deck Hierarchy — Nested decks with inherited configuration
Versioning
CalVer (yyyy.mm.version). Pin exact versions in package.json; range operators (^, ~) do not behave like semver across month boundaries. See the docs root for details.
Quick Links
Getting Started
Install and wire up the backend and frontend packages
Architecture
Hexagonal design, storage adapters, SRS pluggability, and content pipeline
Backend
@hfu.digital/loopkit-nestjs — sessions, decks, notes, scheduling
Frontend
@hfu.digital/loopkit-react — hooks and study components
Type Reference
Entity, config, rendering, and result type definitions
Guides
Custom storage, custom algorithm, custom content transforms
Examples
Working NestJS, React, and full-stack examples