ChessMate is an online chess platform where players can engage in player-versus-player (PvP) matches or compete against AI. The platform supports both rated games and friendly matches, catering to a wide audience ranging from complete beginners to seasoned chess veterans. ChessMate's goal is to make chess more accessible and enjoyable for everyone by eliminating the need for physical boards or in-person opponents. This web-based application is developed with Spring Boot for the backend and Angular for the frontend.
- Spring Boot - Backend framework for building REST API applications
- Spring Data JPA - Provides repository support for JPA data access
- Spring Websocket - Synchronizes game state between players in real-time
- PostgreSQL - An open-source relational database to store game data
- Flyway - Manages database migrations
- JUnit - Facilitates unit testing in Java
- Auth0 - SSO authentication
- Angular 17 - Frontend framework to build SPA applications
- PrimeNG - Rich set of UI components for the Angular
- Bootstrap 5 - CSS library for quickly prototyping layouts
- Mode-View-Controller (MVC)
- Repository
- Inversion of Control / Dependency injection
- Chess board with drag-and-drop functionality
- Real-time game synchronization using Websockets
- Chess engine integration for validating moves (converted the Chess.js library to Java)
- Anonymous and authenticated user support
- Resign and draw game options
- Authenticated game rooms for private matches
- User registration and profile management
- Leaderboard and game history tracking
- Stockfish engine integration for AI opponents
- Chat functionality between players
- UI improvements and responsive design
To set up ChessMate locally, follow these steps:
-
Install SDKs
-
Install Angular app NPM packages: navigate to the frontend directory and install dependencies:
cd ./frontend npm install
-
Modify the database connection strings in Spring Boot's application.properties file. Update the following sections:
spring.datasource.url
- Specify the database server host address with port number and instance name.spring.datasource.username
- Specify the database usernamespring.datasource.password
- Specify the database user passwordspring.flyway.url
- Same values from thespring.datasource
values for the Flyway migration.spring.flyway.user
spring.flyway.password
-
Run applications:
- To start the backend application:
cd ./backend ./gradlew bootRun
- To launch the frontend application:
cd ./frontend npm run start
-
Use the following local URLs to access the apps:
- Backend API: http://localhost:8000
- Frontend UI: http://localhost:8001