ezBadminton Server
The backend for the ezBadminton tournament organizer app.
PocketBase
The server uses PocketBase as a framework. PocketBase brings an SQLite database, authentication service, a Record API, realtime updates and file storage.
The code in this repository extends PocketBase using its various hooks to modify the behaviour of existing API routes, aswell as to add new ones.
The ezBadminton clients subscribe to the realtime updates to keep in
sync with all changes.
Contributing
Everyone is welcome to fork and/or make pull requests!
How to get started
-
Install Go 1.21+ on your system
-
Create a working directory like ez_badminton_server
-
Fork and clone this repository
you@yourdevice:~/ez_badminton_server$ git clone [your-forked-repository]
-
Download the dependencies
you@yourdevice:~/ez_badminton_server$ go mod init github.com/ezBadminton/ezBadmintonServer && go mod tidy
-
Compile and run the server
you@yourdevice:~/ez_badminton_server$ go run . serve
It will create the pb_data
directory.
-
Stop the service (Ctrl+C
)
NOTE: From this point the instructions are the same as in the ezBadminton admin app contribution guide.
-
Set up your admin access
you@yourdevice:~/ez_badminton_server$ go run . admin create test@example.com your-password
-
Start the service again
you@yourdevice:~/ez_badminton_server$ go run . serve
-
Open the pocketbase admin UI in your browser and log in
-
Open the pocketbase settings and import the ezBadminton database schema from pb_schema.json.
-
Select the 'tournament_organizer' user-collection and create a test-user for yourself
- Click 'New Record', fill out the form and click 'Create'
-
Select the 'tournaments' collection and create a tournament
- Click 'New Record', give it a title and click 'Create'
You are ready to connect to the server (e.g. using the ezBadminton Admin App!
To compile the server into an executable use
you@yourdevice:~/ez_badminton_server$ go build .