Skip to content

benSlaughter/spellbound

Folders and files

NameName
Last commit message
Last commit date

Latest commit

ย 

History

67 Commits
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 

Repository files navigation

๐ŸŒฑ SpellBound

A fun, gamified learning app for 10โ€“11 year olds โ€” spelling games, maths games, and a progress garden that grows as you learn. No scores, no timers, no pressure โ€” just encouragement and delight.

Built with love by a parent who wanted something better than flashcards. ๐Ÿ’š

โœจ Features

Spelling Games (8)

  • ๐Ÿ” Word Search โ€” find words hidden in a grid
  • ๐Ÿƒ Memory Match โ€” classic card-matching with spelling words
  • ๐Ÿ”€ Word Scramble โ€” unscramble the letters
  • โœ๏ธ Missing Letters โ€” fill in the blanks
  • ๐Ÿ”ค Word Builder โ€” hear a word, build it letter by letter
  • ๐ŸŽฏ Spell Catcher โ€” catch the correct spelling as it flies by
  • ๐ŸŒ‹ Word Volcano โ€” words erupt, match them before they vanish
  • ๐ŸŸฉ Wordal โ€” Wordle-style guessing with your spelling words

Maths Games (7)

  • ๐Ÿ”ข Times Table Explorer โ€” interactive multiplication grid with explore, practice, and pattern modes
  • ๐Ÿซง Number Bubbles โ€” pop the right answer
  • โ›ฐ๏ธ Math Mountain โ€” climb to the top by solving problems
  • ๐Ÿงฉ Puzzle Pieces โ€” reveal a picture by answering questions
  • ๐Ÿธ Number River โ€” hop across lily pads to the right answer
  • ๐Ÿงญ Math Maze โ€” navigate through rooms by solving equations
  • ๐ŸŒŠ Number Cascade โ€” answers cascade down, catch the right one

Fun Games (1)

  • ๐Ÿƒ Spot Match โ€” find the matching icon between two cards (unlockable)

Progress & Rewards

  • ๐ŸŒป My Garden โ€” a garden that grows as you learn (flowers, trees, butterflies!)
  • ๐Ÿ† Achievements โ€” 10 unlockable badges (First Sprout, Word Wizard, Maths Maestro, and more)
  • ๐ŸŽฎ Game unlock system โ€” fun games are unlocked by earning correct answers across all games
  • โญ Streak tracking โ€” encourages daily practice

More Features

  • ๐Ÿ’ฌ Feedback โ€” students can submit feedback from the app
  • ๐Ÿ” Admin area โ€” manage spellings, times tables, difficulties, settings, view progress, read feedback

๐Ÿš€ Quick Start

# Clone and install
git clone <your-repo-url> spellbound
cd spellbound
npm install

# Build and run
npm run build
npm start

Then open http://localhost:3000 in your browser. That's it!

๐ŸŒฟ First Run

On first launch, SpellBound automatically:

  1. Creates the SQLite database at data/spellbound.db
  2. Sets up all tables
  3. Seeds a default profile called "Learner"
  4. Sets the admin password to spellbound123

No configuration needed โ€” it just works.

๐Ÿ” Admin Access

Navigate to the admin area via the sidebar or go to /admin.

  • Default password: spellbound123
  • To change it: Log in โ†’ Settings โ†’ Update password
  • Sessions last 24 hours and are stored in memory

From the admin dashboard you can:

  • ๐Ÿ“ Manage spelling lists (create, edit, archive, activate)
  • ๐Ÿ”ข Configure which times tables and difficulty levels are available
  • ๐Ÿ“Š View learning progress and statistics
  • ๐Ÿ’ฌ Read student feedback
  • โš™๏ธ App settings (change password, reset progress)

โš ๏ธ Please change the default password on first use!

๐ŸŽฎ Game Unlock System

Fun games (like Spot Match) are unlocked by playing spelling and maths games. Every correct answer counts toward unlocking milestones. For example, Spot Match unlocks after 20 correct answers across any game.

This gives kids a motivating reason to practise โ€” the more they learn, the more games they unlock! The unlock status is visible on the Games hub page, where locked games show their requirements.

๐Ÿ“ How to Add Spelling Words

There are two ways to add spelling words:

1. Admin Panel (parent/teacher)

  1. Log in to the admin area
  2. Go to Manage Spellings
  3. Create a new list with a name (e.g., "Week 12")
  4. Add words (with optional hints)
  5. Activate the list to make it available in games

2. Child Entry Page

  1. From the spelling hub, click "Add My Words"
  2. Or go directly to /entry
  3. Type a list name and add words (minimum 3)
  4. The list is automatically created and activated

๐Ÿ›  Technology Stack

Technology Purpose
Next.js 16 (App Router) Full-stack React framework
TypeScript Type safety
Tailwind CSS v4 Utility-first styling
Framer Motion Animations and transitions
Phosphor Icons Beautiful duotone icon library
SQLite via better-sqlite3 Local database
bcryptjs Password hashing

๐Ÿ“ Project Structure

spellbound/
โ”œโ”€โ”€ data/                    # SQLite database (auto-created)
โ”œโ”€โ”€ public/                  # Static assets
โ”œโ”€โ”€ src/
โ”‚   โ”œโ”€โ”€ app/
โ”‚   โ”‚   โ”œโ”€โ”€ page.tsx         # Home page
โ”‚   โ”‚   โ”œโ”€โ”€ layout.tsx       # Root layout with sidebar
โ”‚   โ”‚   โ”œโ”€โ”€ spelling/        # Spelling hub + 8 game pages
โ”‚   โ”‚   โ”œโ”€โ”€ maths/           # Maths hub + 7 game pages
โ”‚   โ”‚   โ”œโ”€โ”€ games/           # Fun games hub + Spot Match
โ”‚   โ”‚   โ”œโ”€โ”€ progress/        # My Garden progress page
โ”‚   โ”‚   โ”œโ”€โ”€ entry/           # Child word entry page
โ”‚   โ”‚   โ”œโ”€โ”€ feedback/        # Student feedback page
โ”‚   โ”‚   โ”œโ”€โ”€ dev/             # Dev tools + icon library
โ”‚   โ”‚   โ”œโ”€โ”€ admin/           # Admin dashboard
โ”‚   โ”‚   โ”‚   โ”œโ”€โ”€ spellings/   # Manage spelling lists
โ”‚   โ”‚   โ”‚   โ”œโ”€โ”€ tables/      # Configure times tables
โ”‚   โ”‚   โ”‚   โ”œโ”€โ”€ progress/    # View learning progress
โ”‚   โ”‚   โ”‚   โ”œโ”€โ”€ feedback/    # Read student feedback
โ”‚   โ”‚   โ”‚   โ””โ”€โ”€ settings/    # App settings (password, reset)
โ”‚   โ”‚   โ””โ”€โ”€ api/             # API routes
โ”‚   โ”‚       โ”œโ”€โ”€ achievements/
โ”‚   โ”‚       โ”œโ”€โ”€ admin/       # login, logout
โ”‚   โ”‚       โ”œโ”€โ”€ entry/
โ”‚   โ”‚       โ”œโ”€โ”€ feedback/    # Student feedback
โ”‚   โ”‚       โ”œโ”€โ”€ maths/tables/# Times table config
โ”‚   โ”‚       โ”œโ”€โ”€ progress/
โ”‚   โ”‚       โ”œโ”€โ”€ settings/
โ”‚   โ”‚       โ”œโ”€โ”€ spellings/   # CRUD + activate
โ”‚   โ”‚       โ””โ”€โ”€ unlocks/     # Game unlock status
โ”‚   โ”œโ”€โ”€ components/
โ”‚   โ”‚   โ”œโ”€โ”€ ui/              # Reusable UI components
โ”‚   โ”‚   โ”œโ”€โ”€ svg/             # Custom flower, bee & rainbow SVGs
โ”‚   โ”‚   โ””โ”€โ”€ layout/          # Sidebar navigation
โ”‚   โ””โ”€โ”€ lib/
โ”‚       โ”œโ”€โ”€ db.ts            # Database access layer
โ”‚       โ”œโ”€โ”€ schema.sql       # Database schema (7 tables)
โ”‚       โ”œโ”€โ”€ achievements.ts  # Achievement definitions
โ”‚       โ”œโ”€โ”€ auth.ts          # Admin authentication
โ”‚       โ”œโ”€โ”€ maths-helpers.ts # Question generation + utilities
โ”‚       โ”œโ”€โ”€ sounds.ts        # Synthesised sound effects + speech
โ”‚       โ””โ”€โ”€ unlocks.ts       # Fun game unlock definitions
โ”œโ”€โ”€ Dockerfile               # Multi-stage Docker build
โ”œโ”€โ”€ docker-compose.yml       # Container orchestration
โ”œโ”€โ”€ deploy.sh                # Home server deploy script
โ”œโ”€โ”€ package.json
โ””โ”€โ”€ tsconfig.json

๐Ÿ’ป Development

# Run in development mode (with hot reload)
npm run dev

# Run on a custom port
PORT=3456 npm run dev

# Lint the codebase
npm run lint

# Run tests (211 tests)
npm test

# Build for production
npm run build

# Start the production server
npm start

โš™๏ธ Configuration

Database

  • Location: data/spellbound.db (relative to project root)
  • Auto-created on first run
  • Uses WAL journal mode for performance
  • Foreign keys are enabled

Environment Variables

SpellBound works without any environment variables. Optional:

Variable Default Description
NODE_ENV development Set to production for secure cookies
PORT 3000 Server port (Next.js default)

๐Ÿ  Deployment

SpellBound is designed to run on a home server โ€” a Raspberry Pi, an old laptop, a NAS, or any machine on your local network.

# Build once
npm run build

# Run it
npm start

# Or with a custom port
PORT=8080 npm start

For auto-start on boot, use your OS's service manager (systemd, launchd, etc.) or a process manager like pm2:

npm install -g pm2
pm2 start npm --name spellbound -- start
pm2 save
pm2 startup

๐Ÿ’ก Tip: Access from other devices on your network at http://<server-ip>:3000

๐Ÿณ Docker Deployment

SpellBound includes a production-ready Docker setup for easy deployment.

# Build and run locally with Docker
docker compose up --build

# Or deploy on your home server
./deploy.sh

How it works:

  • Multi-stage Dockerfile produces a lean standalone Next.js image
  • GitHub Actions CI pipeline (on push to main) runs tests, builds the Docker image, and pushes to GitHub Container Registry (GHCR)
  • deploy.sh pulls the latest image and restarts the container
  • SQLite database is persisted via a Docker volume (spellbound-data)
  • Puzzle images are bind-mounted from the host for easy updates

๐Ÿ“š Documentation

  • API Reference โ€” Complete REST API documentation
  • AGENTS.md โ€” Guide for AI coding agents working on this codebase

๐Ÿ“„ License

MIT โ€” do whatever you like with it. If it helps your kids learn, that makes me happy. ๐ŸŒป

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors