1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
binary := "lethe"
version := `git describe --tags 2>/dev/null || echo dev`
default:
@just --list
build: web-build
CGO_ENABLED=0 go build -ldflags "-X main.version={{version}}" -o {{binary}} ./cmd/lethe
web-install:
cd web && npm ci
web-dev:
cd web && npm run dev
web-build:
cd web && npm run build
web-test:
cd web && npm test
web-lint:
cd web && npm run lint && npm run typecheck
web-clean:
rm -rf web/node_modules internal/server/web/dist/assets
rm -f internal/server/web/dist/index.html
@printf '<!doctype html><title>lethe</title><body>SPA not built — run <code>just web-build</code></body>\n' > internal/server/web/dist/index.html
run:
go run ./cmd/lethe -config config.yaml
dev:
go tool air
# Run Go (air) and Vite (web-dev) concurrently. Ctrl-C kills both.
dev-all:
#!/usr/bin/env bash
set -euo pipefail
trap 'kill 0' EXIT INT TERM
(cd web && npm run dev) &
go tool air &
wait
test:
go test -race ./...
lint:
golangci-lint run --fix ./...
fmt:
gofmt -w .
goimports -w .
go fix ./...
tidy:
go mod tidy
# Migration helpers for dev/ops use only — authoring new migrations or manually
# driving up/down against a local DB. The running daemon auto-migrates on
# startup via Database.Init -> Migrate (internal/platform/database/database.go),
# so production deployments do not need to invoke these.
# `go tool migrate` resolves through the `tool` directive in go.mod (Go 1.24+).
migrate-up:
go tool migrate -path internal/platform/database/migrations -database "sqlite://./lethe.db" up
migrate-down:
go tool migrate -path internal/platform/database/migrations -database "sqlite://./lethe.db" down 1
migrate-create NAME:
go tool migrate create -ext sql -dir internal/platform/database/migrations -seq {{NAME}}
docker-build:
docker build -t {{binary}}:{{version}} .
docker-up:
docker compose up -d
docker-down:
docker compose down