Giter Site home page Giter Site logo

athorndia / bracket Goto Github PK

View Code? Open in Web Editor NEW

This project forked from evroon/bracket

0.0 0.0 0.0 2.37 MB

Flexible tournament system with web interface

Home Page: https://evroon.github.io/bracket/

License: MIT License

Shell 0.19% JavaScript 0.41% Python 57.32% TypeScript 41.70% Mako 0.17% Dockerfile 0.21%

bracket's Introduction

Favicon of Bracket

Bracket

codecov backend frontend last commit release


Warning This project is still under construction and considered beta software. Release v1.0.0 will be the first out-of-beta release.

Ladder tournament system meant to be easy to use. Bracket is written in async Python (with FastAPI) and Next.js as frontend using the Mantine library.

Preview

Quickstart

To quickly run bracket to see how it works, clone it and run docker-compose up:

git clone [email protected]:evroon/bracket.git
cd bracket
sudo docker-compose up -d

This will start the backend and frontend of Bracket, as well as a postgres instance. You should now be able to view bracket at http://localhost:3000.

To insert dummy rows into the database, run:

sudo docker exec bracket-backend pipenv run ./cli.py create-dev-db

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:

sudo -Hu postgres psql  -p 5532
CREATE USER bracket_dev WITH PASSWORD 'bracket_dev';
CREATE DATABASE bracket_dev OWNER bracket_dev;

You can do the same but replace the user and database name with:

  • bracket_ci: for running tests
  • bracket_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 database
  • JWT_SECRET: Create a random secret using openssl rand -hex 32
  • CORS_ORIGINS and CORS_ORIGIN_REGEX: Specify allowed frontend domain names for CORS (see the FastAPI docs)
  • ADMIN_EMAIL and ADMIN_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 run dev

Backend

cd backend
pipenv install -d
pipenv shell
./run.sh

bracket's People

Contributors

dependabot[bot] avatar evroon avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.