- Follow Typescript and Svelte best practices
- Code Review Comments guide from the Go project should be followed
There are a few ways to run the application locally, the easiest way is to use Docker Compose, but you can also run the application directly on your machine provided you have the dependencies installed.
- Building and running with Docker Compose
- Build and Run without Docker Compose
- Creating SQL Migrations
- Adding new Localizations
- Format code before commit
docker-compose up --build
- Postgres
- Go
- Node.js
- Task (recommended) is used to manage development tasks in the project.
- Goose (recommended) is used to manage SQL migrations
- Caddy Server (optional) is used to run locally with HTTPS
With Task running the task install
command will install dependencies
OR manually run the following commands
go mod download
go install github.com/swaggo/swag/cmd/[email protected]
cd ui && npm install
Postgres must be running with the same configuration as in the docker-compose.yml
file.
With Task run the task dev
command to build and run the application then visit
http://localhost:8080 in your browser.
Or task dev-secure
to run with HTTPS (using Caddy) then
visit https://thunderdome.localhost in your browser.
- Using the above dev Task(s) will automatically handle this for you.
If you've setup Task simply task format
to format all go and frontend code before commit, otherwise make format
is
still available for those with make installed.
- not doing so can result in a failed build on GitHub
- Using the above dev Task(s) will automatically handle this for you.
The restful API is documented using swagger comments in the Go code, any changes to that documentation require regenerating the docs with the following commands and committing the updated docs with the changes.
With Task task gen-swag
will regenerate the swagger docs
OR manually run the following commands
swag fmt
swag init -g internal/http/http.go -o docs/swagger
Generate new migration file using the following command, replacing SHORT_DESCRIPTIVE_FILNAME
with a short descriptive
name for the migration example create_poker_table
.
goose -dir internal/db/migrations create SHORT_DESCRIPTIVE_FILNAME sql
Thunderdome supports Locale selection on the UI (Default en-US)
Adding new locale's involves just a few steps.
- First by copying the
ui/src/i18n/en/index.ts
into the new locale folder atui/src/i18n/{locale}/index.ts
using the two letter locale code for the directory name and translating all the values. - Second, the locale will need to be added to the locales list used by switcher component
in
ui/config.js
locales
object - Run
npm run locales
inui
directory to generate the new locale types used by the build process - commit changes and open PR