Wiki › Project
ochess
Article
ReadAll pages
From Chaipat's knowledge graph
ochess is an online two-player chess game that runs in the browser in real time. The whole server is a single Python file using FastAPI, WebSockets and the python-chess library.
How it works
- Players create a game or join one from a simple web page.
- Moves travel over a WebSocket connection, so both boards update instantly.
- python-chess checks every move against the rules, so the server never has to implement chess itself.
- FastAPI serves a small HTML and JavaScript front end directly, and Uvicorn runs the server.