jamtrack/README.md

66 lines
1.7 KiB
Markdown

# Jamtrack
## Description
A PocketBase-backed web application for tracking jam sessions. Uses `templ` for
type-safe HTML templates and `modernc.org/sqlite` (via PocketBase) for persistence.
## Development
```
just dev # live-reload dev server with templ watch proxy (port 7331 → 8090)
just build # generate templates + compile binary to bin/jamtrack
just serve # run the prebuilt binary
just test # go test -race ./...
just gen # regenerate templ templates only
```
The PocketBase admin UI is available at `http://localhost:8090/_/` while the server
is running.
## E2E tests
The Playwright E2E suite exercises the four main user flows in a real browser against a running dev server.
### One-time setup
Requires Node.js. Run once (or after updating `package.json`):
```
just e2e-setup
```
This installs the `playwright` npm package and downloads the Chromium browser.
`node_modules/` inside `e2e/` is git-ignored.
### Credentials
The suite needs PocketBase superuser credentials to authenticate against the admin
API. It creates a throwaway app user at the start of each run and deletes it on
exit, so no app-level credentials need to be configured.
Copy `example.env` to `.env` (git-ignored) and fill in real values:
```sh
cp example.env .env
$EDITOR .env
```
`.env` uses plain `KEY=VALUE` format (no `export`). `just e2e` reads it
automatically via `go tool envrun`.
The suite creates `APP_USER` in the `users` collection on first run if it does not
already exist.
### Running
```
just e2e
```
The dev server (`just dev` or `just serve`) must be running on port 8090/7331
before the suite is invoked.
## License
AGPL v3.0, see LICENSE.txt for details.