Project 19: Flashcard Learning App
40 min read
SM-2 AlgorithmCSS 3D TransformsSpaced RepetitionFile ImportProgress TrackingCard Scheduling
📋 Project Brief
Build a spaced-repetition flashcard app using the SM-2 algorithm (Anki-style). Cards are scheduled based on how well the user remembers them, with intervals increasing for well-known cards and decreasing for difficult ones. Includes 3D flip animations and a progress dashboard.
✅ Feature Requirements
Feature 1: 3D Card Flip
Acceptance Criteria:
- Clicking a card triggers a CSS 3D flip animation (
transform: rotateY(180deg)) - The front shows the question; the back shows the answer
- The flip must use
perspectiveandbackface-visibility: hidden - Flip duration: ~400ms with an ease-in-out curve
- Clicking again (or pressing Space) flips back
Feature 2: SM-2 Spaced Repetition
Acceptance Criteria:
- After viewing the answer, the user rates difficulty: "Again" (Hard), "Good," or "Easy"
- Again: Card reappears in 1 minute, then 10 minutes
- Good: Interval doubles from the previous interval (1d → 2d → 4d → 8d...)
- Easy: Interval triples
- Each card stores: interval, ease_factor, repetition_count, next_review_date
- On app open, show only cards where
next_review_date ≤ today
Feature 3: Markdown Support
Acceptance Criteria:
- Card content supports Markdown: bold, italic, code blocks, lists
- Code snippets render with syntax highlighting
- Math formulas supported via basic LaTeX notation (stretch)
- Images can be embedded via URL
Feature 4: Progress Dashboard
Acceptance Criteria:
- Circular progress chart: "Cards Mastered" (interval > 21 days) vs. "Learning" vs. "New"
- Daily review count: "Reviewed 15 cards today"
- Streak tracker: consecutive days of reviews completed
- Forecast: "You have ~8 cards due tomorrow, ~12 in 3 days"
Feature 5: Deck Import
Acceptance Criteria:
- Import decks from CSV or JSON files
- CSV format:
front,back(one card per row) - JSON format:
[{ "front": "...", "back": "..." }] - Show a preview of the first 5 cards before confirming import
- Duplicate detection: skip cards that already exist in the deck
📊 SM-2 Algorithm Reference
| Rating | Effect on Interval | Effect on Ease Factor |
|---|---|---|
| Again (0-1) | Reset to 1 minute | Decrease by 0.2 (min: 1.3) |
| Good (3) | Previous interval × Ease Factor | No change |
| Easy (5) | Previous interval × Ease Factor × 1.3 | Increase by 0.15 |
🧪 Testing Checklist
- Unit test SM-2 interval calculations for all ratings
- Unit test ease factor clamping (never below 1.3)
- Unit test "due today" filtering logic
- Unit test CSV/JSON parsing
- Integration test: rating a card updates its next review date correctly
🚀 Stretch Goals
- Add audio pronunciation for language learning cards
- Implement card tags/categories for organized study
- Add a "Cram Mode" that shows all cards regardless of schedule
- Implement cloud sync for cross-device study sessions