chess Svelte Themes

Chess

Realtime chess app; front end practice with Svelte.

Real-Time Multiplayer Chess

A modern, real-time multiplayer chess application built with SvelteKit, Socket.IO, and Redis. Play chess with friends through shareable game links, featuring real-time moves, game state management, and WebSocket communication.

šŸŽ® Play Now - Live Demo

šŸš€ Features

  • Real-time multiplayer gameplay
  • Shareable game links with QR codes
  • Game state persistence with Redis
  • Secure WebSocket connections (WSS)
  • Mobile-responsive design
  • Time controls for each player
  • Move validation and chess rules enforcement
  • Production-grade SSL/TLS encryption

šŸ›  Tech Stack

  • Frontend: SvelteKit, TypeScript
  • Backend: Node.js, Express
  • Real-time: Socket.IO
  • State Management: Redis
  • Security: Helmet, Rate Limiting, Let's Encrypt SSL
  • Deployment: Docker, DigitalOcean

šŸ— Architecture

+----------------+     WebSocket     +----------------+     Persist     +----------------+
|                | <--------------> |                | <------------> |                |
|  SvelteKit UI  |    Socket.IO     |  Express/Node  |     State      |     Redis      |
|                |                  |                |                |                |
+----------------+                  +----------------+                +----------------+

šŸ”§ Setup & Development

  1. Clone the repository:

    git clone https://github.com/yourusername/chess-app.git
    cd chess-app
    
  2. Install dependencies:

    npm install
    
  3. Set up environment variables:

    cp .env.example .env
    # Edit .env with your configuration
    
  4. Start development server:

    npm run dev
    
  5. For production build:

    npm run build
    npm run start
    

šŸ³ Docker Deployment

# Build and run with Docker Compose
docker compose up -d

šŸ“ Project Structure

chess-app/
ā”œā”€ā”€ src/
ā”‚   ā”œā”€ā”€ lib/           # Shared components and utilities
ā”‚   ā”œā”€ā”€ routes/        # SvelteKit routes and pages
ā”‚   ā”œā”€ā”€ server/        # Backend server code
ā”‚   ā””ā”€ā”€ server.ts      # Main server entry point
ā”œā”€ā”€ static/           # Static assets
ā”œā”€ā”€ certs/           # SSL certificates
ā””ā”€ā”€ docker-compose.yml

šŸ” Security

  • HTTPS/SSL encryption with Let's Encrypt
  • Automatic SSL certificate renewal
  • HTTP to HTTPS redirection
  • Strict Transport Security (HSTS)
  • Rate limiting
  • Helmet security headers
  • Secure WebSocket (WSS) connections
  • Input validation
  • Content Security Policy (CSP)

šŸŒ Deployment

The application is deployed at chess.bidseek.dev using:

  • DigitalOcean Droplet
  • Docker Compose
  • Let's Encrypt SSL certificates
  • Nginx reverse proxy
  • Automatic container restart
  • Redis persistence

šŸ“ License

MIT License - See LICENSE file for details

šŸ¤ Contributing

Contributions welcome! Please read CONTRIBUTING.md for guidelines.

Top categories

Loading Svelte Themes