It's great you're here and reading this guide, because we need volunteers to help keep this project active and alive for the greater benefit of everyone!
Here are some important resources:
- GitHub Issues - a place for bugs to be raised and feature requests made
- GitHub Discussions - a place to discuss ideas or real-world usage
To get started with this project you will need:
- Golang (project started using Go 1.16.2, but likely anything above 1.14 is fine)
- Yarn/NodeJS
- Air
To install air:
You can run:
-
go get -u github.com/cosmtrek/air
in a folder outside this project (so it is not added as a dependency).The
air
binary will be located in your~/go/bin
folder, which may need to added to your commands and/or path. The AIRCMD setting in the Makefile may need to be adjusted if a different location is used.
Thanks to Air, there is some amount of "live-reload". To run the project, you can run air -c .air.toml
in the project root. Once it is built, you should be able to access the site at http://localhost:4200/
Any code changes to golang/react files will cause a rebuild and restart, and will be accessible via the browser with a refresh!
For local development, a good first step is to copy the example .env.example
file to .env
and launch a local db
and air
like so:
cp .example.env .env
make run-air
For some fun interactive debugging with server.go, you could spin up the local docker db image, and manually run the server in debug more. See the Makefile for the latest and greatest commands to cherry-pick.
$ docker run --name the_cla_postgres -p 5432:5432 -e POSTGRES_PASSWORD=the_cla -e POSTGRES_DB=db -d postgres
34b413c68663b28d722fe2503b869a03bd2808e1facdcbbf5dde8a1ac0f6beb9...
Then run server.go in debug mode in your favorite IDE, and enjoy break points activating when you connect to endpoints. Wee!
For frontend work (with a previously manually launched database), this command is helpful for development:
make run-air-alone
Alternatively, if you just want to play around lightly, you can run the docker commands below. First set up your environment as described in App environment configuration, otherwise much may not work, and you will miss out on much goodness.
make docker
docker run -p 4200:4200 the-cla
This will be a lot slower, but you can build and run the entire application with only docker
(and make
) installed, essentially.
-
In order to help verify the authenticity of contributed code, we ask that your commits be signed. All commits must be signed off to show that you agree to publish your changes under the current terms and licenses of the project.
Here are some notes we found helpful in configuring a local environment to automatically sign git commits:
You can run the Golang tests by running make test
.
Please send Pull Requests that:
- Have a singluar purpose, and that is backed by one or more GitHub Issues in this project
- Are clear
- Have appropriate test coverage for the Pull Requests purpose
- Meet our Code Style Convention (see above)