This repository contains code that powers chess.io's gameplay, user authentication, and analytics. It provides an API web clients can use to perform these actions. Written in NodeJS with the ExpressJS framework, PostgreSQL for player data, and Redis for real-time game state.
- NodeJS (Typescript) with Express framework.
- PostgreSQL: primary database.
- Redis: in-memory game store.
- WebSockets Protocol: real-time low latency communication.
- Docker: containerization.
To develop / test the endpoints locally, clone the repo then follow the steps outlined below.
git clone https://github.com/dev-xero/chess.io-backend.git chessio-backend- Rename .env.example to .env and fill in the fields with your own Postgres DB URI, Redis URI, JWT secret and remote url.
- Generate the Prisma client by running
yarn prisma generate. - Perform relevant db migrations by using the script:
migrations.sh. - To run the server in a dev environment with full reloads, use
server.sh. - To build the production code, use
yarn start:prod. - To cleanup build files, use the
clean.shscript.