Skip to content

Contributing

By participating in this project, you agree to abide our code of conduct.

Set up your machine

bracket-creator is written in Go.

Prerequisites:

Other things you might need to run the tests:

Clone bracket-creator anywhere:

git clone git@github.com:gitrgoliveira/bracket-creator.git

cd into the directory and install the dependencies:

make local/deps

Test your change

You can create a branch for your changes and try to build from the source as you go:

make go/build

When you are satisfied with the changes, we suggest you run:

make go/test
make go/test-race

Before you commit the changes, we also suggest you run:

make pre-commit

Testing the bracket generator web UI

make run          # starts on localhost:8080
PORT=8081 make run

Open the browser and walk through bracket generation manually — type checking and unit tests do not exercise the UI rendering path.

Testing the mobile / live tournament app

make run-mobile                                     # localhost:8080, data dir ./tournament-data
PORT=8082 make run-mobile                           # custom port
TOURNAMENT_DATA_DIR=/path/to/data make run-mobile  # custom data dir

Important: web-mobile/ is a Preact/JSX frontend compiled by esbuild into web-mobile/dist/ and then embedded into the Go binary at build time. Any change to web-mobile/js/*.js or web-mobile/css/*.css requires:

  1. Rebuild the JS bundle: cd web-mobile && npm run build (or npx esbuild ... — see the project Makefile)
  2. Rebuild the binary: make go/build
  3. Restart the server: make run-mobile

Simply editing .js files and refreshing the browser will not pick up changes — the browser is served the embedded bundle baked into the last binary build.

Create a commit

Commit messages should be well formatted, and to make that "standardized", we are using Conventional Commits.

You can follow the documentation on their website.

Submit a pull request

Push your branch to your bracket-creator fork and open a pull request against the main branch.

Credit

This CONTRIBUTING guideline is very inspired by the goreleaser. Thanks goreleaser.