Chess stamps is a tool for pulling statistics on your chess games played on Lichess and comparing your opening your repertoire to the population. It uses a "stamp collecting" theme.
Live URL: https://www.chessstamps.app
Chess Stamps uses a Flask backend and a React frontend. API calls to the Lichess API are made from the backend.
These instructions will get you a copy of the project up and running on your local machine.
You need to have Node.js, npm, and Python installed on your machine. You can install Node.js and npm from the official Node.js website and Python from the official Python website.
This project uses a virtual environment to manage Python dependencies. To set up the virtual environment:
- Navigate to the project directory in your terminal.
- Create a new virtual environment by running the following command:
python3 -m venv venv
On Windows, run:
venv\Scripts\activate
On Unix or MacOS, run:
source venv/bin/activate
- Clone the repository:
git clone <repository_url>
- Navigate to the project directory:
cd <project_directory>
- Install the backend dependencies:
pip install -r requirements.txt
- Navigate to the client directory:
cd client
- Install the frontend dependencies:
npm install
- Create a
.env
file in the project directory and add your environment variables:
lichessToken = '<your_lichess_token>'
FLASK_ENV = 'development'
LICHESS_CLIENT_ID="lichess-oauth-flask"
SECRET_KEY="<secret_key>"
AUTH_METHOD="oauth"
Replace <your_lichess_token>
with a personal access token described here. This is to provide another auth method for dev purposes without having to go through OAuth every time. To stop using OAuth, you can change the AUTH_METHOD
described in .env
.
<SECRET_KEY>
is a static secret key for the Flask app. You can generate a secret key using the following Python code:
import secrets
print(secrets.token_hex(16))
To run the backend, navigate to the project directory and execute the following command:
flask run
To run the frontend, navigate to the client
directory and execute the following command:
npm start
The backend will start and be available at http://localhost:5000
, and the frontend will be available at http://localhost:3000
.
- React
- Flask
- Chessboard component from react-chessboard
- Some styles and components from Material-UI. Styling is a mix of CSS and MUI.
- Lichess API for game data and Lichess tables for opening names
- Kyle Giddon
This project is licensed under the MIT License - see the LICENSE.md file for details.
To contribute to this project, please open an issue or a pull request.
There are some obvious rooms for improvement, such as:
- The database is very storage-inefficient right now.
- The UI for the "All Stamps" section can have improvements such as filtering by popularity, ply, etc.