- Install go ≥ 1.21.5
- Download go modules:
go mod download - Download npm modules:
cd ui && npm install - Create "config.yaml" file as follows:
db_conn: ./test.db port: 8080 default_admin_password: password
- Build CSS:
npm run build --prefix ./ui - Run app:
go run ./cmd/clay-play
If you don't want to run the above commands every time a change occurs, you can use air for live reloading.
- Install
airwithgo install github.com/air-verse/air - Run
air -c .air.toml
Using SQlite as database. Migrations are handled through goose. We only use goose as a library rather than the CLI so no need to download the CLI.
- Create a new migration:
go run ./cmd/clay-play migration create <name>- This will create a new migration file named something like
migrations/20240219151811_<name>.sql, where you can put the migration details in
- This will create a new migration file named something like
- On app startup,
goose.Up(...)runs to always bring the DB schema up to date