ChessLink is a real-time WebSocket API for facilitating chess game interactions — minimal, TypeScript-driven, and designed for rapid integration.
🧠 This project is a personal learning exercise where I explored WebSocket communication patterns, practiced deploying a Node.js server to Render.io, and built a simple TypeScript API for real-time chess gameplay with basic lobby management.
- Node.js with TypeScript
- Socket.io for real-time WebSocket communication
- Docker for containerization and deployment
- Jest for testing
- Render.io for production deployment
- Real-time multiplayer chess gameplay via WebSocket connections
- Basic lobby system for game discovery and matchmaking
- Game state management with move validation
- Reconnection handling with 5-second grace period
- Draw offers and resignation support
- Player-specific game state updates
- Dockerized for deployment consistency
- TypeScript implementation with type definitions
# Clone the repository
git clone https://github.com/BeckettFrey/ChessLink.git
cd ChessLink
# Install dependencies
npm install
# Run in development mode
npm run devThe server will start on http://localhost:3000 with health check available at /health.
# Build and run with Docker
docker build -t chesslink .
docker run -p 3000:3000 chesslink
# Or use Docker Compose
docker-compose up --build# Run all tests
npm test
# Run tests with coverage
npm run test:coverage
# Run tests in watch mode
npm run test:watchTests are not fully complete but structurally thought out. Test files are located in:
src/
├── gameManager/__tests__/
├── middleware/__tests__/
├── services/__tests__/
└── sockets/__tests__/
Useful for developers who need:
- Simple chess integration — Basic API for chess functionality
- Minimal lobby setup — Straightforward multiplayer chess implementation
- Real-time game state — Synchronized gameplay across clients
- Learning reference — Example implementation for similar projects
This repository documents my hands-on exploration of real-time application development. Through building ChessLink, I:
- Learned WebSocket Communication: Implemented bidirectional real-time communication with event handling and state synchronization
- Practiced Production Deployment: Successfully containerized and deployed a TypeScript application to Render.io
- Explored TypeScript APIs: Developed a structured API with type definitions and basic error handling
- Experimented with Game State Management: Created systems for handling game states, disconnections, and player interactions
- Applied Development Practices: Used Docker for consistency, Jest for testing, and organized project structure
import io from 'socket.io-client';
const socket = io('your-chesslink-api-url');
// Join game
socket.emit('joinGame', gameId);
// Handle game updates
socket.on('updateChessLink', (chessLink) => {
// Update state accordingly
setChessLink(chessLink);
});
// Make a move
socket.emit('makeMove', { from: 'e2', to: 'e4' })