About based.mobi

A small, opinionated chess server focused on clean games, clear rules, and fast connections.

based.mobi is a real-time multiplayer chess server focused on simple, fast matchmaking and a clean playing experience. Games are managed entirely in memory on the server, and the UI is a lightweight static client served alongside the engine.

How it works

The backend is written in Rust using axum and tokio. Each connected browser opens a WebSocket to the server. All game actions – joining rooms, making moves, offering draws, requesting rematches – are sent as small JSON messages over this WebSocket.

Here's what happens when you make a move: you click a square on the board, the browser packages your move in a JSON message (like {"type": "make_move", "move": "e2e4"}), and sends it over the WebSocket. The server receives this, validates the move using the shakmaty library to ensure it's legal, updates the game state, and then broadcasts the updated game state to all participants (both players and spectators). Your browser receives this update and re-renders the board, move history, and timers. This entire cycle typically completes in milliseconds.

The server keeps track of active games, rooms, players, spectators and timers. When anything changes in a game, the server pushes an updated game state to all participants (both players and spectators) so that every client stays in sync. If you refresh the page or briefly lose connection, the WebSocket reconnects and you can request the current game state to catch up.

There is deliberately no persistent database on the server: when a game ends and the process eventually restarts, all in-memory state is discarded. Long-term storage happens only in your browser (see below).

Chess rules and engine

All chess rules are enforced on the server using the Rust shakmaty library:

  • Legal move generation for all pieces
  • Castling, en passant and promotions
  • Check, checkmate, stalemate and insufficient material
  • Threefold repetition and the fifty-move rule (claimable)
  • The automatic seventy-five-move rule for draws

The draw rules work as follows: players can claim a draw after threefold repetition (the same position occurs three times) or after fifty moves without a pawn move or capture. However, if the game reaches seventy-five moves without a pawn move or capture, the draw is automatic – no claim needed. This matches FIDE regulations where the seventy-five-move rule is mandatory and cannot be waived.

For analysis and bot play, the frontend runs a WebAssembly build of Stockfish entirely in your browser (compiled from the stockfish.wasm project by Niklas Fiekas). This is the same Stockfish engine used in professional chess software, but compiled to run in your browser using WebAssembly. The engine runs at full strength locally on your device – no moves or analysis are sent to any external engine server.

When you enable analysis or play against the bot, the server only ever sees the same game messages as in a normal game (moves, draw offers, rematch requests). Engine evaluations, best-move suggestions and annotations never leave your browser. The bot difficulty is controlled by Stockfish's skill level parameter (1-20, default 10), which adjusts the engine's playing strength. For move analysis, the engine searches to a depth of 8-12 plies depending on the context, balancing accuracy with speed so analysis completes quickly.

Time controls and FIDE-style timing

The server maintains the authoritative clocks for each game. Time is tracked in seconds and updated from a background task that runs every 2 seconds. After every move, the server subtracts the elapsed time for the player who just moved and then applies the increment (the bonus time added after each move).

The presets are designed to mirror common FIDE-style controls:

  • Bullet: 2+1 – Online convention, not FIDE-rated but popular for fast games
  • Blitz: 3+2 – Standard FIDE blitz time control (3 minutes + 2 seconds per move)
  • Rapid: 15+10 – Standard FIDE rapid time control (15 minutes + 10 seconds per move)
  • Classical: 60+30 – Eligible as FIDE standard time control (60 minutes + 30 seconds per move). Under current FIDE regulations, 45+30 or longer qualifies for standard rating.

The browser displays a smooth countdown based on the last time update from the server, but the server is always the source of truth for flagging and game results. If your clock hits zero on the server, you lose on time – unless your opponent has insufficient mating material, in which case the game is drawn even if you flagged.

Persistence, replay and analysis

Important: The only place games live long-term is your browser. The server never stores them on disk or in any database. All game state exists only in memory while players are connected. If the server process restarts, all active games vanish from the server, but your local history remains untouched in your browser.

Completed games are saved in your browser's localStorage (up to 100 games, with the oldest automatically removed when the limit is reached). Each entry stores:

  • Move history in UCI and SAN notation
  • FEN snapshots for each move (allowing you to step through the game)
  • Final result and result reason (checkmate, timeout, draw by agreement, etc.)
  • PGN (including headers with player names, date, time control, and result)
  • Stockfish evaluation and move-quality annotations when available (best moves, mistakes, blunders)

The replay page loads these saved games locally, reconstructs the positions, and can run fresh Stockfish analysis in your browser so you can step through the game with engine guidance. You can download the PGN for any saved game to import into chess databases or analysis software.

Because games are only persisted client-side, clearing your browser storage or using a different device will clear or isolate your history. The server never writes your moves to disk. This design choice prioritizes privacy and simplicity: there's no central archive of your games, no user accounts, no email addresses, and no personal data stored anywhere.

FIDE compliance goals

This site aims to follow the FIDE Laws of Chess for move legality, game results and timing:

  • Legal move generation and validation for every move
  • Correct handling of checkmate, stalemate and insufficient material
  • Threefold repetition and fifty-move rule (player-claimable)
  • Automatic seventy-five-move rule for draws
  • Standard-style time controls with increments, including 60+30

However, this is intentionally not a full tournament management system. It does not include:

  • Rating server or ELO calculations
  • Pairing systems (Swiss, round-robin, etc.)
  • Arbiter tools or dispute resolution
  • PGN signing or anti-cheat measures
  • Tournament brackets or standings

The goal is faithful rules and timings compatible with FIDE-standard play, not full tournament infrastructure. The 60+30 classical preset in particular is suitable for standard games under current FIDE regulations (as of 2026, FIDE accepts 45+30 or longer as standard time controls).

Security & privacy

No tracking, no analytics, no cookies. The core game client contains no third-party analytics scripts, no tracking pixels, and no cookies beyond what your browser uses for localStorage. The only data transmitted to the server is the WebSocket messages necessary for gameplay (moves, draw offers, room joins, etc.).

The server does not log moves, store game history, or maintain any persistent records of players. There are no user accounts, so there's no email addresses, passwords, or personal information collected. Your identity is ephemeral – tied only to your current WebSocket session. When you disconnect, that identity is forgotten.

All communication happens over HTTPS (or HTTP in local development). The WebSocket connection is encrypted in transit, and the server uses security headers (COOP/COEP) required for SharedArrayBuffer support, which also helps prevent certain cross-origin attacks.

Browser & device support

The basic game (playing, spectating, matchmaking) works in any modern browser. However, some features require additional browser capabilities:

  • Stockfish analysis and bot play require SharedArrayBuffer support, which is only available in secure contexts (HTTPS) and requires specific security headers from the server. Chrome, Firefox, and Edge support this on HTTPS. Safari 15.2+ supports it with the proper headers (COOP: same-origin, COEP: require-corp).
  • WebAssembly is required for Stockfish. All modern browsers support WebAssembly, but older versions may not.
  • WebSocket support is required for real-time gameplay. This is available in all modern browsers.

If your browser doesn't support SharedArrayBuffer (or you're on HTTP instead of HTTPS), you can still play games, spectate, and use all core features – you just won't be able to enable analysis or play against the bot. The site will detect this and disable those options automatically.

The site is designed to be readable and usable on small mobile devices (including small iPhones). The layout adapts to screen size, and touch interactions work for moving pieces and using controls.

Limitations & philosophy

This server is intentionally minimal and opinionated. Some features you might expect from other chess sites are deliberately absent:

  • No rating system – There's no ELO, no leaderboards, no rankings. This keeps the focus on playing chess rather than grinding for points. Games are just games.
  • No chat or social features – There's no in-game chat, no friend lists, no profiles. This eliminates moderation overhead and keeps the experience focused on chess.
  • No accounts – You don't sign up, log in, or create a profile. Your identity is per-session. This means no password resets, no email verification, and no account recovery – but also no data breaches, no spam, and no personal information at risk.
  • No persistent game history on server – Games only exist in memory while active, and in your browser after completion. This means no global archive, but also no privacy concerns about your games being stored indefinitely.

The philosophy is simple: fast matchmaking, clean rules, minimal friction. If you want ratings, chat, or persistent accounts, there are other sites for that. This one is for playing chess.

Deployment and architecture

The server is a single Rust binary that serves static assets from the /static directory and exposes one WebSocket endpoint at /ws. It is intended to run behind a simple reverse proxy on a single host, with no external dependencies other than the OS and a TCP listener. There's no database, no Redis, no message queue – just the binary and the static files.

All third-party JavaScript (chess.js for move validation on the client, Stockfish for analysis) is self-hosted. This ensures reliability (no dependency on external CDNs), privacy (no requests to third-party domains), and compatibility with the COEP: require-corp header needed for SharedArrayBuffer support.

The server is designed for single-region deployment. If you're far from the server, you'll experience higher latency in move transmission, but the game will still function correctly. For global low-latency play, you'd need multiple regional deployments, which is beyond the scope of this minimal setup.

All communication between your browser and the server happens over HTTPS (or HTTP in local development) and a single WebSocket connection. There is no third-party analytics or tracking embedded in the core game client.

Frequently asked questions

Is my data stored on your servers?
No. Games only exist in server memory while players are connected. When a game ends, it's gone from the server. The only long-term storage is in your browser's localStorage, which you control.

Can I export my games?
Yes. Every saved game includes a PGN that you can download from the replay page. You can import these into chess databases, analysis software, or share them with others.

Is the engine cheating for my opponent?
No. The Stockfish engine only runs in your own browser. Your opponent never sees your analysis, and you never see theirs. The server only sees normal game messages (moves, draw offers, etc.) – it has no access to engine evaluations or suggestions.

What happens if I refresh during a game?
Your WebSocket reconnects automatically. You can request the current game state to catch up, and the game continues normally. However, if you're playing against the bot, the bot's WebSocket connection is separate, so the bot will continue playing even if you refresh.

Why no accounts or ratings?
To keep things simple and private. No accounts means no passwords to manage, no email addresses to protect, and no risk of data breaches. No ratings means no pressure to grind for points – just play chess.

Can I play on mobile?
Yes. The site is designed to work on mobile devices, including small iPhones. Touch interactions work for moving pieces, and the layout adapts to screen size. However, bot play and analysis require SharedArrayBuffer support, which may not be available on all mobile browsers or HTTP connections.