A GEWIS rooster (roster/schedule) maker. This is the backend repository.
Make sure you can run Go and have this repository open in your favourite IDE.
Install the required packages:
go mod tidy
Copy the example environment file:
cp .env-example .env
Ensure DEV_TYPE is set to "local" in your .env file if you want to run the project without Keycloak authentication.
Make sure to set the JWT_SECRET
Set ALLOWED_ORIGINS to your locally run frontend
If you want to seed the database with initial data (users, organs, rosters), run:
go run ./cmd/seeder/main.go
To start the application, run:
go run ./cmd/src/main.go
To generate the documentation (Swagger/OpenAPI) from the root directory, run:
swag init -g cmd/server/main.go -d ./ -o docs --parseInternal --pd
To generate the client (which can be uploaded to npm) from the root directory, run:
openapi-generator-cli generate -i docs/swagger.yaml -g typescript-axios -o client/src
- Ensure your
.envis configured (see Configuration section above). - Seed the database if necessary.
- Start the server
go run ./cmd/src/main.go
First make sure you have installed golang-migrate on your pc
migrate create -ext sql -dir internal/platform/database/migrations -seq file_name