mirror of
https://github.com/evroon/bracket.git
synced 2026-03-04 07:11:00 -05:00
f85c5e31c8347d7cd9b031b015097aae6869bf08
Bracket
Ladder tournament system meant to be easy to use. Bracket written in async Python (with FastAPI) and Next.js as frontend using the Mantine library.
Setup
Database
First create a bracket cluster:
sudo pg_createcluster -u postgres -p 5532 13 bracket
pg_ctlcluster 13 bracket start
Subsequently, create a new bracket_dev database (and bracket_ci for tests):
sudo -Hu postgres psql -p 5532
CREATE USER bracket_ci WITH PASSWORD 'bracket_ci';
CREATE DATABASE bracket_ci OWNER bracket_ci;
You can do the same but replace the user and database name with:
bracket_ci: for running testsbracket_prod: for a production database
The database URL can be specified per environment in the .env files (see config).
Config
Copy ci.env to prod.env and fill in the values:
PG_DSN: The URL of the PostgreSQL databaseJWT_SECRET: Create a random secret usingopenssl rand -hex 32CORS_ORIGINSandCORS_ORIGIN_REGEX: Specify allowed frontend domain names for CORS (see the FastAPI docs)ADMIN_EMAILandADMIN_PASSWORD: The credentials of the admin user, which is created when initializing the database
Running the frontend and backend
The following starts the frontend and backend for local development:
Frontend
cd frontend
yarn
npm run dev
Backend
cd backend
./run.sh
Languages
TypeScript
51.1%
Python
47.6%
CSS
0.8%
Dockerfile
0.2%
