Skip to content

Folders and files

NameName
Last commit message
Last commit date

Latest commit

ย 

History

74 Commits
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 

Repository files navigation

Blunder Bank

A chess learning platform built with Laravel and React that helps players improve by studying their own mistakes through spaced repetition flashcards.

๐ŸŽฏ About

Blunder Bank is a personal chess improvement tool designed for players who want to systematically analyze and learn from their blunders. Rather than relying on engine analysis or automated imports, Blunder Bank puts you in controlโ€”you define what made the move a blunder, categorize it, and practice it until it sticks.

The core philosophy: Manual Entry = Deeper Learning. By forcing yourself to admit and analyze your errors, you create a more meaningful learning experience.


โœจ Key Features

๐Ÿ“š Create Your Personal Blunder Library

  • Add chess blunders from your games manually
  • Store the chess position (FEN format), correct move, and opening details
  • Add personal notes explaining why it was a blunder (tactical blindspot? Time pressure? Opening trap?)
  • Track ELO rating at the time of the blunder
  • Link to source games

๐ŸŽฎ Practice Modes

  • General Practice: Review all blunders or filter by specific criteria
  • Focused Practice: Targeted training sessions for specific blunders
  • Answer interface for interactive learning

๐Ÿ“Š Advanced Tracking & Statistics

  • Overall accuracy percentage across all cards
  • Correct vs. wrong attempts tracking
  • Practice streaks (current and highest streak)
  • Last practiced timestamp
  • Filter blunders by:
    • Accuracy percentage
    • User ELO rating
    • Date created
    • Date last practiced
    • Opening name
    • Search by notes

๐Ÿ” Secure Authentication

  • Email verification
  • Two-factor authentication (2FA) support
  • Secure password hashing
  • Session management

๐Ÿ“ฑ Modern User Experience

  • Clean, responsive React interface with Inertia.js
  • Real-time data updates
  • Tailwind CSS styling with Radix UI components
  • Dark mode support
  • Mobile-friendly design

๐Ÿ› ๏ธ Tech Stack

Backend

  • Framework: Laravel 12
  • Authentication: Laravel Fortify (with 2FA support)
  • Database: MySQL/PostgreSQL (migrations included)
  • API: RESTful endpoints for flashcard CRUD operations
  • Testing: Pest PHP
  • Code Quality: Pint (PHP linter)

Frontend

  • Library: React 19
  • Routing: Inertia.js (server-side routing with React components)
  • Styling: Tailwind CSS 4
  • UI Components: Radix UI
  • Build Tool: Vite
  • Type Safety: TypeScript
  • Code Quality: ESLint, Prettier

DevOps & Tools

  • Package Manager: Composer (PHP), npm (JavaScript)
  • Local Development: Laravel Sail (Docker)
  • Queue Support: Laravel Queue (for background tasks)

๐Ÿ“ Project Structure

blunder-bank/
โ”œโ”€โ”€ app/
โ”‚   โ”œโ”€โ”€ Models/
โ”‚   โ”‚   โ”œโ”€โ”€ User.php              # User model with stats
โ”‚   โ”‚   โ””โ”€โ”€ FlashCard.php         # FlashCard model
โ”‚   โ”œโ”€โ”€ Http/
โ”‚   โ”‚   โ”œโ”€โ”€ Controllers/          # FlashCardController, UserController
โ”‚   โ”‚   โ”œโ”€โ”€ Middleware/           # Auth middleware
โ”‚   โ”‚   โ””โ”€โ”€ Requests/             # Form request validation
โ”‚   โ”œโ”€โ”€ Actions/
โ”‚   โ””โ”€โ”€ Concerns/                 # Traits for reusable logic
โ”‚
โ”œโ”€โ”€ resources/
โ”‚   โ”œโ”€โ”€ js/
โ”‚   โ”‚   โ”œโ”€โ”€ pages/               # React page components
โ”‚   โ”‚   โ”‚   โ”œโ”€โ”€ dashboard.tsx    # Dashboard with stats
โ”‚   โ”‚   โ”‚   โ”œโ”€โ”€ blundersList.tsx # Library view with filters
โ”‚   โ”‚   โ”‚   โ”œโ”€โ”€ practiceFlashCards.tsx
โ”‚   โ”‚   โ”‚   โ”œโ”€โ”€ focusedPracticeFlashCards.tsx
โ”‚   โ”‚   โ”‚   โ””โ”€โ”€ welcome.tsx      # Landing page
โ”‚   โ”‚   โ””โ”€โ”€ components/          # Reusable React components
โ”‚   โ”œโ”€โ”€ css/                     # Tailwind configuration
โ”‚   โ””โ”€โ”€ views/
โ”‚       โ””โ”€โ”€ app.blade.php        # Root Blade template
โ”‚
โ”œโ”€โ”€ routes/
โ”‚   โ””โ”€โ”€ web.php                  # All application routes
โ”‚
โ”œโ”€โ”€ database/
โ”‚   โ”œโ”€โ”€ migrations/              # Database schema
โ”‚   โ”œโ”€โ”€ factories/               # Seeding factories
โ”‚   โ””โ”€โ”€ seeders/                 # Database seeders
โ”‚
โ”œโ”€โ”€ tests/                       # Pest PHP tests
โ”œโ”€โ”€ config/                      # Laravel configuration
โ”œโ”€โ”€ bootstrap/                   # Bootstrap files
โ”‚
โ””โ”€โ”€ vite.config.ts              # Vite build configuration

๐Ÿš€ Getting Started

Prerequisites

  • PHP 8.2+
  • Composer
  • Node.js 18+ & npm
  • MySQL/PostgreSQL database

Installation

  1. Clone the repository

    git clone <repository-url>
    cd blunder-bank
  2. Run setup script (Recommended)

    composer run setup

    This will:

    • Install PHP dependencies
    • Create .env file
    • Generate app key
    • Run database migrations
    • Install npm packages
    • Build assets
  3. Manual setup (If needed)

    # Install dependencies
    composer install
    npm install
    
    # Environment configuration
    cp .env.example .env
    php artisan key:generate
    
    # Database setup
    php artisan migrate
    
    # Build frontend assets
    npm run build

Development

Start the development server with all required services:

composer run dev

This runs concurrently:

  • Laravel development server (port 8000)
  • Queue listener
  • Vite dev server (HMR)

For SSR (Server-Side Rendering):

composer run dev:ssr

Building for Production

npm run build
php artisan queue:work

๐Ÿ“‹ Database Schema

Users Table

  • id, name, email, password
  • email_verified_at, two_factor_secret, two_factor_recovery_codes
  • Statistics: stats_total_correct, stats_total_wrong, stats_last_practiced_at, stats_current_streak, stats_highest_streak

Flash Cards Table

  • id, user_id (foreign key)
  • fen (chess position)
  • correct_move (correct response)
  • note (long text explanation)
  • user_elo_at_time (ELO rating when added)
  • opening_name (e.g., "Sicilian Defense")
  • source_game_url (link to game source)
  • Statistics: times_correct, times_wrong, last_practiced_at, priority_score
  • Timestamps: created_at, updated_at

๐Ÿ”Œ API Endpoints

All authenticated endpoints require session or token authentication.

Flashcard Operations

  • POST /api/flashcards โ€” Create new flashcard
  • GET /api/flashcards โ€” List all user's flashcards
  • GET /api/flashcards/:id โ€” Get specific flashcard
  • PATCH /api/flashcards/:id โ€” Update flashcard
  • DELETE /api/flashcards/:id โ€” Delete flashcard
  • GET /api/flashcards/next-card โ€” Get next card for practice
  • POST /api/flashcards/answer-attempt/:id โ€” Record practice attempt

User Stats

  • GET /api/dashboard/stats โ€” Get user statistics

๐Ÿงช Testing

Run tests with:

composer test      # Run all tests with linting checks
npm run lint:check # Check JavaScript linting
npm run types:check # Check TypeScript types

๐Ÿ”„ Roadmap & Future Features

From todo.tasks:

  • โœ… Accept multiple correct moves per card
  • โณ Improve focused practice accuracy logic
  • โณ Add Privacy Policy screen in footer
  • โณ Implement platform logo
  • โณ Add meta tags for better social sharing
  • Major: Migrate endpoints to API-first with token authentication (for mobile app compatibility)

๐Ÿ“ Key Concepts

FEN (Forsythโ€“Edwards Notation)

Chess positions are stored in FEN formatโ€”a standardized way to describe any chess position. Example:

r1bqkb1r/pppp1ppp/2n2n2/4p3/2B1P3/5N2/PPPP1PPP/RNBQK2R w KQkq - 4 4

Spaced Repetition

The platform is designed with spaced repetition principles in mindโ€”cards you struggle with are revisited more frequently, helping you solidify weak areas.

Priority Score

Internal system to determine which cards need practice based on accuracy and recency.


๐Ÿค Contributing

Contributions welcome! Please ensure:

  1. Code follows Pint (PHP) and ESLint/Prettier (JavaScript) standards
  2. Tests pass: composer test
  3. Type checks pass: npm run types:check

๐Ÿ“„ License

MIT License


๐Ÿ‘ค Author

Made by Kian Jacob Anthony Tubalinal


๐Ÿ“ง Support

For issues or questions, please open an issue on the repository.


๐ŸŽ“ Learning Resources


Happy studying! Turn those blunders into strength. โ™Ÿ๏ธ

About

A full-stack web app designed to help chess players systematically track, analyze, and eliminate their recurring mistakes using spaced repetition.

Topics

Resources

Stars

Watchers

Forks

Releases

Packages

Contributors

Languages