A gamified vocabulary learning app with daily streaks, character evolution, and spaced repetition. Built with Next.js and Supabase.
- 🎮 Gamified Quests: Learn vocabulary through interactive sessions with XP and leveling
- 🔥 Daily Streaks: Build consistency with Duolingo-style daily streak tracking
- 🌱 Character Evolution: Watch your character grow from Seed to Blossom as you maintain streaks
- 🧠 SM-2 Spaced Repetition: Scientifically-proven algorithm schedules reviews at optimal intervals
- 📖 Etymology & Roots: Learn word origins and root meanings for deeper understanding
- 👤 Anonymous Auth: No login required - progress saved automatically
- 📊 Rank System: Progress through ranks from Novice to Word Master
- Frontend: Next.js 15 (App Router), TypeScript, TailwindCSS
- Backend: Supabase (PostgreSQL, Auth, RLS)
- Algorithm: SM-2 Spaced Repetition
- Monitoring: Structured logging for production
- Node.js 18+
- npm or yarn
- A Supabase project (create one free)
cd wpmeg
npm install- Create a new project at supabase.com
- Go to SQL Editor and run migrations:
- Copy contents of
supabase/migrations/001_initial_schema.sql - Copy contents of
supabase/migrations/002_streak_system.sql - Paste and run each in SQL Editor
- Copy contents of
- Go to Authentication → Providers and enable Anonymous Sign-in
- Copy your project credentials from Settings → API
cp .env.example .env.localEdit .env.local:
NEXT_PUBLIC_SUPABASE_URL=https://your-project.supabase.co
NEXT_PUBLIC_SUPABASE_ANON_KEY=your-anon-keynpm run dev- Navigate to http://localhost:3000/admin/import
- Enter the import secret (set in your env)
- Click "Import Content"
- Start: Click "Start Learning" on the landing page
- Dashboard: View your XP, level, streaks, and character evolution
- Quest: Play a session to learn new vocabulary
- Review: Answer flashcards using Again/Hard/Good/Easy buttons
- Progress: Watch your XP grow, maintain streaks, and evolve your character!
wpmeg/
├── content/wpmae/ # Vocabulary content (JSON)
├── supabase/migrations/ # Database schema & migrations
├── src/
│ ├── app/ # Next.js pages & API routes
│ │ ├── home/ # Dashboard with stats, streaks
│ │ ├── quest/ # Learning sessions
│ │ ├── review/ # Spaced repetition review
│ │ └── actions/ # Server actions (DB logic)
│ ├── lib/
│ │ ├── sm2.ts # SM-2 algorithm
│ │ ├── streak.ts # Streak utilities
│ │ ├── logger.ts # Production logging
│ │ └── types.ts # TypeScript types
│ └── components/ # React components
│ ├── game/ # XP, Streaks, Character
│ └── ui/ # Buttons, Cards, etc.
- Again (quality 2): Reset - review tomorrow
- Hard (quality 3): Correct with difficulty
- Good (quality 4): Correct answer
- Easy (quality 5): Perfect recall
Interval increases exponentially with correct answers.
- +10 XP for correct answers
- +2 XP for incorrect answers
- +50 XP for completing a session
- Level = floor(XP / 500) + 1
- Ranks: Novice → Apprentice → Scholar → Expert → Master → Word Master
- 1 session OR 5 reviews = 1 day activity
- Streak milestones unlock character evolution:
- 3 days: Sprout 🌱
- 7 days: Seedling 🌿
- 14 days: Growing 🪴
- 30 days: Blossom 🌸
Logs are automatically captured for critical operations:
- User authentication flows
- XP updates
- Session completions
- Review submissions
- Streak updates
Where to check logs:
- Development: Browser console + terminal running
npm run dev - Production (Vercel): Dashboard → Project → Logs tab → Filter by "Error"
- books: Book metadata
- chapters: Chapter groupings
- sessions: Learning sessions
- words: Vocabulary with etymology
- exercise_items: Quiz prompts
- user_profile: XP, level, streaks, character stage
- user_session_progress: Session completion tracking
- user_word_state: SM-2 state per word
- user_daily_activity: Daily streak tracking
- Push code to GitHub
- Import project in Vercel
- Add environment variables:
NEXT_PUBLIC_SUPABASE_URLNEXT_PUBLIC_SUPABASE_ANON_KEY
- Deploy!
Post-deployment:
- Check logs in Vercel Dashboard → Logs
- Monitor error rates
- Test complete user flow (signup → quest → review → streak)
MIT


