š Flashcard Learning App
A full-featured flashcard application with spaced repetition learning, built for Val Town.
- Deck Management: Create, edit, and delete flashcard decks
- Card Creation: Add unlimited flashcards with front (question) and back (answer)
- Spaced Repetition: Smart learning algorithm (SM-2) that shows cards at optimal intervals
- Study Sessions: Intuitive study mode with card flipping and 4-level difficulty ratings
- Statistics: Track your learning progress with detailed metrics
- Backup & Restore: Export/import your data as JSON
šÆ Spaced Repetition System
Uses the proven SM-2 algorithm (same foundation as Anki) to optimize your learning:
- Again: Didn't remember - Review again soon
- Hard: Remembered with difficulty - Review in a few days
- Good: Remembered correctly - Review at normal interval
- Easy: Remembered instantly - Review much later
Cards become easier or harder based on your performance, maximizing retention while minimizing study time.
š Statistics & Tracking
- Total cards created across all decks
- Total reviews completed
- Total study time
- Average accuracy percentage
- Detailed session history with per-deck performance
- Username-based login (no password required)
- Per-user data isolation using Val Town blob storage
- JSON backup/restore for data portability
- All data stored securely in Val Town's infrastructure
- Login: Enter any username (creates new user if doesn't exist)
- Create a Deck: Click "Create Deck" and give it a name
- Add Cards: Open your deck and add flashcards (front and back)
- Study: Click "Study" to begin learning with spaced repetition
- Track Progress: View your statistics to see your learning journey
- Read the question (front of card)
- Try to recall the answer
- Click "Show Answer" to flip the card
- Rate your recall:
- Again (red): Didn't remember
- Hard (orange): Remembered with difficulty
- Good (green): Remembered correctly
- Easy (blue): Remembered instantly
- The algorithm schedules the next review based on your rating
- Click "Backup" in the navigation
- Click "Download Backup" to export as JSON
- Save the file somewhere safe
- To restore: Select the file and click "Restore Backup"
flashcard/
āāā main.ts # Entry point
āāā README.md # This file
āāā ARCHITECTURE.md # Detailed technical documentation
āāā backend/
ā āāā index.ts # Hono app and route setup
ā āāā storage.ts # Blob storage utilities
ā āāā routes/
ā āāā auth.ts # User authentication
ā āāā decks.ts # Deck CRUD
ā āāā cards.ts # Card CRUD
ā āāā study.ts # Study sessions and SM-2
ā āāā stats.ts # Statistics and tracking
ā āāā backup.ts # Data export/import
āāā frontend/
ā āāā index.html # Single-page app UI
ā āāā index.js # Client-side logic
āāā shared/
āāā types.ts # Shared types and SR algorithm
- Backend: Hono (lightweight web framework)
- Frontend: Vanilla JavaScript + TailwindCSS
- Storage: Val Town Blob Storage
- Runtime: Deno (Val Town platform)
- Algorithm: SM-2 Spaced Repetition
- Simple per-user isolation
- Fast single-fetch loading
- No schema migrations
- Perfect for personal-scale apps
- Lightweight (no framework overhead)
- Simple to understand and modify
- Fast load times
- No build step needed
- Proven effective (used by Anki)
- Well-documented and understood
- Simple to implement
- Excellent for long-term retention
All endpoints require X-Username header (except login).
POST /api/auth/login - Login/create user
GET/POST/PUT/DELETE /api/decks - Manage decks
GET/POST/PUT/DELETE /api/cards - Manage cards
GET /api/study/:deckId - Get due cards
POST /api/study/review - Record card review
GET /api/stats - Get statistics
POST /api/stats/sessions - Save study session
GET /api/backup - Export data
POST /api/backup/restore - Import data
See ARCHITECTURE.md for detailed API documentation.
# This is designed for Val Town's platform
# To run locally, you'd need Val Town's SDK and blob storage emulator
- Upload all project files to Val Town
- Set
main.ts as the entry point
- Configure as an HTTP Val
- No environment variables needed
- Use Val Town's preview feature to test in real-time
- Create test decks and cards
- Try the study mode with different ratings
- Verify statistics update correctly
- Test backup/restore functionality
Potential features to add:
This project is built for Val Town and is free to use, modify, and distribute.
Built with ā¤ļø for effective learning through spaced repetition.
Algorithm based on SuperMemo's SM-2, popularized by Anki.
Happy Learning! š