Open to projects
← Work

Case Study · 2026

Cardlet

An AI-powered flashcard platform with spaced repetition, adaptive tutoring, and multi-mode quizzes. Built open-source from the ground up.

Visit cardlet.app ↗GitHub ↗

Type

SaaS product · Open source

Year

2026

Stack

Next.js 16 (App Router)TypeScriptSupabase (Postgres + Auth + Storage)OpenRouter / ClaudeTailwind CSS v4SM-2 spaced repetition

The problem

Existing flashcard apps (Quizlet, Anki) treat studying as a static activity — you flip cards on a schedule, rate yourself, move on. There's no intelligence when you're stuck. Anki's algorithm is powerful but opaque and difficult to set up. Quizlet has no real spaced repetition at all.

Students needed a platform that adapts to their performance, explains concepts in context when they struggle, and doesn't require manual configuration to get started.

What was built

Six systems, one product.

Spaced repetition engine

Built the SM-2 algorithm from scratch — cards surface based on each user's confidence history. Three ratings (know / struggling / unknown) map to quality scores that set the next review interval.

AI tutor

When a user marks a card unknown, an AI tutor session opens. Claude streams a contextual explanation scoped to that card. Full responses cost 10 credits; half-performance responses cost 5 — giving users control over depth.

Multiple quiz modes

Study session (flip cards), multiple choice (AI-generated distractors via OpenRouter), written answer (AI graded), and match game. Each mode exercises recall differently.

Admin dashboard

Educators upload PDF or doc course materials. One button fires an AI pipeline that reads the material and generates a 10-card study set. No manual card creation for teachers.

Credits system

A unified localStorage credit pool governs all AI features — tutor, written grading, card generation. Default 100 credits with a +100 bundle. Prevents runaway API costs without blocking access.

Open source

Licensed AGPL-3.0 and published on GitHub. The repo includes a complete .env.example, accurate README, and clean commit history — built to be forkable.

Architecture

Server Components fetch data from Supabase and pass it as props to Client Components. AI calls (tutoring, grading, generation) go through Next.js API routes — never from the browser directly. Streaming responses use the SSE pattern via ReadableStream.

Row-level security in Supabase ensures users can only access their own data. The admin dashboard uses a service-role client that bypasses RLS — gated behind a separate httpOnly cookie auth flow, not Supabase Auth.

Want something built like this?

Start a conversation