Skip to content

micshafes/chess-memory

Folders and files

NameName
Last commit message
Last commit date

Latest commit

ย 

History

24 Commits
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 

Repository files navigation

Danya's Chess Positions Explorer

An interactive web application for exploring chess positions from Daniel Naroditsky's YouTube speedrun games.

Chess Position Explorer License

๐Ÿ“‹ Table of Contents

๐ŸŽฏ Overview

This project lets you explore every chess position from Daniel Naroditsky's (Danya's) famous YouTube speedrun series. Search any position to see:

  • ๐ŸŸข What moves Danya played from that position
  • ๐Ÿ”ด What moves opponents tried against him
  • ๐ŸŽฅ YouTube video links with timestamps to watch Danya handle that position
  • โ™Ÿ๏ธ Interactive board with drag-and-drop move exploration

Perfect for chess students who want to learn from Danya's incredible teaching content in a searchable, interactive format.

โœจ Features

Frontend Application

  • Interactive Chess Board - Drag-and-drop pieces to explore positions
  • Move Database - See all moves Danya and opponents played from each position
  • YouTube Integration - Direct links to videos with exact timestamps
  • Move History - Navigate forward/backward through your exploration
  • Responsive Design - Works on desktop, tablet, and mobile
  • Sound Effects - Optional move/capture sounds
  • Board Flipping - View from either perspective

Backend Pipeline

  • Automated Data Processing - Extracts positions from PGN game files
  • YouTube Title Fetching - Real video titles via oEmbed API
  • Position Normalization - Smart FEN matching for transpositions
  • Timestamp Calculation - Precise video timestamps using game clocks
  • SQLite Database - Efficient storage and querying

๐ŸŽฎ Demo

Try it yourself!

๐Ÿš€ Quick Start

For Users

  1. Clone the repository

    git clone https://github.com/yourusername/chess-memory.git
    cd chess-memory
  2. Serve the frontend locally

    cd frontend
    python -m http.server 8000
  3. Open in browser

    http://localhost:8000
    

For Contributors

See CONTRIBUTING.md for detailed setup instructions.

๐Ÿ“ Project Structure

chess-memory/
โ”œโ”€โ”€ frontend/                   # Static web application
โ”‚   โ”œโ”€โ”€ index.html             # Main HTML file
โ”‚   โ”œโ”€โ”€ css/
โ”‚   โ”‚   โ””โ”€โ”€ styles.css         # All styling
โ”‚   โ”œโ”€โ”€ js/
โ”‚   โ”‚   โ””โ”€โ”€ app.js             # Application logic
โ”‚   โ”œโ”€โ”€ img/                   # Images (tribute photos)
โ”‚   โ””โ”€โ”€ chess_positions.json   # Position database (50-100MB)
โ”‚
โ”œโ”€โ”€ backend/                    # Data processing pipeline
โ”‚   โ””โ”€โ”€ scripts/               # Python scripts for building database
โ”‚       โ”œโ”€โ”€ 1_match_games_csv_to_api.py
โ”‚       โ”œโ”€โ”€ 2_build_database_from_games.py
โ”‚       โ”œโ”€โ”€ 3_fetch_youtube_titles.py
โ”‚       โ”œโ”€โ”€ 4_clean_database.py
โ”‚       โ”œโ”€โ”€ 5_export_to_frontend_json.py
โ”‚       โ”œโ”€โ”€ rebuild_all.py     # Master rebuild script
โ”‚       โ””โ”€โ”€ README.md          # Pipeline documentation
โ”‚
โ””โ”€โ”€ data/                       # Data files
    โ”œโ”€โ”€ csv/                   # Original game lists
    โ”œโ”€โ”€ json/                  # Game data and exports
    โ””โ”€โ”€ sqlite/                # SQLite database

๐Ÿ”„ Data Pipeline

The backend processes raw game data through a 5-step pipeline:

1. Match CSV โ†’ Chess.com API
   โ†“
2. Build SQLite Database (extract positions)
   โ†“
3. Fetch YouTube Titles
   โ†“
4. Clean Invalid Links
   โ†“
5. Export to Frontend JSON

See backend/scripts/README.md for detailed pipeline documentation.

Running the Pipeline

cd backend/scripts

# Install dependencies
pip install -r requirements.txt

# Full rebuild (recommended)
python rebuild_all.py

# Or run steps individually
python 1_match_games_csv_to_api.py
python 2_build_database_from_games.py
python 3_fetch_youtube_titles.py
python 4_clean_database.py
python 5_export_to_frontend_json.py

# Copy output to frontend
cp ../../data/json/chess_positions_frontend.json ../../frontend/chess_positions.json

๐Ÿค Contributing

We welcome contributions! Whether it's:

  • ๐Ÿ› Bug reports
  • ๐Ÿ’ก Feature suggestions
  • ๐Ÿ“ Documentation improvements
  • ๐ŸŽจ UI/UX enhancements
  • ๐Ÿ”ง Code contributions

See CONTRIBUTING.md for guidelines.

๐Ÿ’ป Development

Prerequisites

Frontend:

  • Modern web browser
  • Local web server (Python, Node.js, or VS Code Live Server)

Backend:

  • Python 3.8+
  • pip (Python package manager)

Local Development Setup

  1. Fork and clone the repository

    git clone https://github.com/yourusername/chess-memory.git
    cd chess-memory
  2. Set up Python environment (optional but recommended)

    python -m venv chess_env
    source chess_env/bin/activate  # On Windows: chess_env\Scripts\activate
  3. Install backend dependencies

    cd backend/scripts
    pip install -r requirements.txt
  4. Run the frontend

    cd ../../frontend
    python -m http.server 8000

Testing

  • Frontend: Open browser console and check for JavaScript errors
  • Backend: Each script includes error handling and progress logging
  • API Testing: Use dev_test_chess_api.py to verify Chess.com API access

๐ŸŒ Deployment

GitHub Pages

  1. Enable GitHub Pages in repository settings
  2. Set source to main branch, /frontend folder
  3. Custom domain (optional): Add CNAME file to frontend

See frontend/DEPLOYMENT.md for detailed deployment instructions.

Other Platforms

The frontend is a static site and can be deployed to:

  • Netlify: Drag & drop frontend/ folder
  • Vercel: Import GitHub repository
  • Any static host: Upload frontend/ contents

๐ŸŽ“ How It Works

Position Matching

Every position in Danya's games is extracted and stored with:

  • FEN notation (position identifier)
  • Move history (what Danya played, what opponents tried)
  • Video timestamps (calculated from game clocks)

Frontend Architecture

  • Single-page application - No backend server required
  • Client-side search - Entire database loaded once
  • Instant lookups - In-memory position matching
  • Browser caching - Fast subsequent loads

Key Technologies

  • Frontend: Vanilla JavaScript, chessboard.js, chess.js
  • Backend: Python, python-chess, SQLite
  • APIs: Chess.com public API, YouTube oEmbed API

๐Ÿ“Š Data Sources

Game Data

  • Chess games from Daniel Naroditsky's Chess.com accounts:
    • senseidanya
    • hebeccararis
    • ohmylands
    • frankfurtairport

Speedrun Series Included

  • Back to 3000
  • Beginner to Master
  • Develop Your Instincts
  • Master Class
  • Sensei Speedrun
  • Top Theory

๐Ÿ™ Acknowledgments

  • Daniel Naroditsky - For creating incredible educational content and inspiring the chess community
  • Chess.com - For providing public API access to game data
  • chessboard.js & chess.js - For excellent open-source chess libraries
  • The Chess Community - For supporting chess education

This project was created as a tribute to Danya's teaching legacy and to help chess students learn from his games.

๐Ÿ“œ License

This project is for educational and personal use.

  • Game data is from public Chess.com games
  • YouTube content belongs to Daniel Naroditsky
  • Code is open-source for educational purposes

Please respect intellectual property rights when using or modifying this project.


๐Ÿ“ž Contact

Have questions or suggestions? Feel free to:

  • Open an issue on GitHub
  • Submit a pull request
  • Share your feedback

Made with โ™Ÿ๏ธ by chess enthusiasts, for chess students everywhere.

In loving memory of Daniel Naroditsky - the world's favorite chess teacher.

About

No description, website, or topics provided.

Resources

License

Contributing

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors