Design Document - majo-z/ChessProject GitHub Wiki
Introduction
Chess Online is a HTTP Chess Web API that allows its consumers to create and play chess games via HTTP requests.
There is a React JS front end served as the root resource that allows you to play and keep start new, and keep track of all your in-progress games.
System Requirements
Modern browser (latest Firefox or Chrome)
Technologies Used
- Spring Boot
- Java 8
- junit4
- React JS
- WebPack
- Yarn
- Bootstrap
- Css
- Html5 & canvas
- js
- jQuery
- Python 3
- unittest
- pydoc
- Hibernate
- MySQL
- Maven
- Photoshop
- git/github
- Docker
Architecture of the Solution
See the Project Structure to see the project structure.
Spring Boot Java server
connected to a MySQL database Serving up a React JS app as the root resource Python bot that connects to the HTTP API as a user.
Project Workflow
We met up for between 5 and 8 hours every week as a team since we started the project, and also did additional work over the weekends.
Features of the Implementation
Java Server
Provides various HTTP endpoints which facilitate managing chess games programmatically via HTTP.
React Front End
React js front end allows users to play and manage their on-going chess games via a convenient web application.
PyBot
The Python bot is a python CLI tool that interacts with the HTTP api via the requests library.
Docker
A docker image and docker-compose file are available which will set up multiple containers running Chess Online.
Limitations
The current implementation of the server won't scale well with a large user base. Every time a new game is started a new process starts when each python bot is started.
Castling, En passant and promoting pawns are unimplemented, and so these moves are not valid currently.
Web app doesn't fit the screen on smaller resolutions.
Using modern css techniques which won't work on older browsers.
Known Bugs
The web application doesn't work correctly on mobile devices, this is due to the css resizing the chess board on smaller devices and interfering with the calculations which determine which tile is currently selected.
Recommendations for Future Development & Features
- Add unimplemented chess rules.
- Improve the Python bot AI.
- Add authentication and a better login mechanism.
- Improvements such as friend list, matchmaking, chat window
- Add React Redux and React router to make front end development easier.
- Look into alternatives to HTML canvas.
- Make web app more responsive on mobile devices.
- Add additional board games.
- Add email authentication.
Conclusions
We initially selected Chess as we wanted to challenge ourselves and make use of everything that we've learned so far. As the project progressed, we realised that we had to experiment and research various technologies to assist us.
These technologies helped us to overcome aspects of the project that we weren't happy with. We had initially started our front end using jQuery, but this quickly became unmanageable, so we looked into more modern front end frameworks and settled on React.js. By the end of the project, we feel we've learned a lot about how modern front end JavaScript frameworks work, and how fast these frameworks evolve.
Since we settled on React, it would have been preferable to have used Node.js and Express.js to develop the backend instead of Spring Boot. Needing to restart the server any time a change was made to the UI slowed down development.
However, we had already made significant progress on the Spring Boot server, before even considering different front end options.
It was very difficult to determine where the project should finish, due to constantly wanting to improve the project and add new features.
We enjoyed working on this challenging but rewarding project and we feel we've worked well as a team and accomplished the goals we had laid out for ourselves at the beginning of the project, and some that were not initially planned but were added during development.