The goal of this project is to provide a set of web components for online chess play.
- chess server (the hub)
- JS client library for hub connection
- JS client library for board & pieces creation & manipulation
- HTML+CSS+JS client
The 1st version is "hit & run" style. The user provides a login name (no auth) and is directed to the main page, which includes a basic chat system and a form. The form allows the user to search for a game (level, and level span tolerancy). If no game is found, a new one is created. The user is then directed to the board. He "sits" in one of the free chairs (blacks or whites). The game starts when both chairs are occupied.
Head to http://www.chess-hub.net/ to try it.
server : |==============================================================================================> | 95%
client : |==============================================================================================> | 95%
- install nodejs & npm
- create a dir & run git clone
- npm install (installs all gruntjs dependencies)
- (sudo) npm install -g grunt-cli (if you wish to use grunt)
- node server.js
- open in browser
Built with NodeJS. No framework. Using gruntjs with jslint & uglify.
- do everything with nodejs : routing, serving static files, handling connections and messaging
- simple login (no login/password database, IRC style) : give a login name, if it's free then you're in
- use a simple dialog protocol based on json post requests, allowing the use of custom clients
- messaging : 1 main lobby, 1 channel per game, direct messages, IRC style ("XX has joined #MyGame", "@YY Hey !", ...)
- find a partner based on : self-estimated level (beginner, experienced, master, great master)
- learning games : have a willing master+ and a willing beginner play together
- must be playable through proxies => long polling instead of web sockets (will implement sockets later with polling as a fallback method)
- limit the number of clients
- user timeout
- save games to files
- web sockets connection
- allow a user to watch an ongoing game
- allow a user to open multiple boards
- should enforce chess rules (don't delegate all to clients)
- handle the user key (to avoid user impersonnification)
- handle user timeout
- handle multiple channel polling for each client
- receive array of moves (for composite moves like castling or promoting) instead of one service call per move
- handle timed games
Built in JS. Requires jQuery, mostly for asynchronous calls.
Library that handles connection and messaging with the Hub.
- handle the user key (to avoid user impersonnification)
- send an array of moves (for composite moves like castling or promoting) instead of one service call per move
Built in JS. Requires jQuery, mostly for DOM objects manipulation.
Library that handles board and pieces creation & manipulation.
- generate the board
- generated pieces objects
- spawn the pieces and place them
- handle the moves
- enforce pieces move restrictions
- rethink the _canMove and _isCheck functions; should not rely on the dom
- maintain an array of squares with their pieces for fast search
- finish the "sit" process
- enforce other rules (check, check mate, castling, en passant)
- display whose turn it is
- allow to show last move
- handle timed games
Built in HTML/CSS/JS and jQuery Mobile. Requires jQuery.
1st version Goals :
- as simple as possible
- 3 pages :
- login screen (no auth, just give a username)
- main page : preferences, search a game, chat lobby
- board page : board, local chat, users list (black player, white player, spectators)
- responsive design
- save games into local storage and replay
- export saved games
- offline capable :
- play a saved game
- ...?
- correctly place & render the board
- add chat to games
- add a "create" function
- allow users to join a specific game
- via an url
- via a link in the main chat page
- add a "invite" button
- via Twitter,
- email,
- or other services
- finish the main page design
- work on the login page; describe the app, show the stats
- save the context into local storage
- handle reconnection (or page refresh)