Peregrine is a HTTP JSON API written in Go for scouting and analysis of FIRST Robotics competitions.
For a description of what scouting is, please view the SCOUTING.md.
git clone [email protected]:Pigmice2733/peregrine-backend.git
cd peregrine-backend
Install PostgreSQL and start the server.
Install the peregrine
binary:
NOTE: If you cloned the repo to somewhere in your GOPATH (e.g. with
go get
) you'll need toexport GO111MODULE=on
.
go generate ./... # neccessary to compile OpenAPI documentation into the binary
go install ./...
createdb -U postgres peregrine
cp template.json config.json
Modify config.json
as neccesary. You will likely not need to change anything besides the TBA API key and the JWT secret if you followed the instructions here. You will need to go to the TBA account page and get a read API key and set apiKey
under the tba
section to the read API key you register. Set the JWT secret to the output from uuidgen -r
.
Download golang-migrate and run the database migrations:
migrate -database "postgres://postgres@localhost:5432/peregrine?sslmode=disable" -path "$(pwd)/migrations" up
peregrine config.json
Peregrine's entire API is documented with OpenAPI 3.0.0 (previously known as Swagger). You can view the documentation here. If you notice any inaccuracies please let us know so the documentation can be corrected.
go test -v ./...
report-endpoints
):git checkout -b report-endpoints
git add internal/foo/bar.go
git commit -m "Add the initial report endpoints"
Verify that your tests pass (see the testing section). If they don't then fix them and add a commit.
Push the branch to the remote github repo:
git push -u origin report-endpoints