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:
cd into the directory and install the dependencies:
Test your change
You can create a branch for your changes and try to build from the source as you go:
When you are satisfied with the changes, we suggest you run:
Before you commit the changes, we also suggest you run:
Testing the bracket generator web UI
Open the browser and walk through bracket generation manually. Type checking and unit tests do not exercise the UI rendering path.
Testing the mobile / 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
PORT, BIND_ADDRESS, and TOURNAMENT_DATA_DIR are read by the binary directly, so they also work without make:
An explicit --folder, --port, or --bind flag still overrides the env var.
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 the web-mobile/js/ sources (.js or .jsx) or web-mobile/css/*.css requires the following:
- Rebuild the JS bundle:
cd web-mobile && npm run build(ornpx esbuild ...; see the projectMakefile) - Rebuild the binary:
make go/build - Restart the server:
make run-mobile
Editing these frontend sources and refreshing the browser does 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.