Bootstraps Vellum as a single Go binary with one SQLite database. - core: env-driven config, slog logging, SQLite (WAL) with pooled pragmas, embedded migration runner keyed on PRAGMA user_version - migrations/0001_core.sql: identity, media, user state, infra. Media items are global; all per-user state (progress, favorites, grants) is a join. One polymorphic progress table covers every media kind. - httpapi: request-ID, structured request logging, panic recovery, JSON endpoints for /healthz and /api/v1/version - multi-arch Dockerfile (pure-Go SQLite, CGO_ENABLED=0) with an entrypoint that honours PUID/PGID like the rest of the self-hosted stack - tests for migration idempotency, FK enforcement, WAL, config, middleware Media does not exist yet. Nothing is exposed beyond health and version.
37 lines
605 B
Makefile
37 lines
605 B
Makefile
# Vellum — developer commands.
|
|
#
|
|
# Requires Go >= 1.26. On Fedora: sudo dnf install golang
|
|
|
|
BINARY := vellum
|
|
VERSION ?= 0.1.0-dev
|
|
LDFLAGS := -s -w -X main.version=$(VERSION)
|
|
|
|
.PHONY: build run test fmt vet tidy check docker clean
|
|
|
|
build:
|
|
CGO_ENABLED=0 go build -trimpath -ldflags "$(LDFLAGS)" -o $(BINARY) ./cmd/vellum
|
|
|
|
run:
|
|
go run ./cmd/vellum
|
|
|
|
test:
|
|
go test ./...
|
|
|
|
fmt:
|
|
gofmt -w .
|
|
|
|
vet:
|
|
go vet ./...
|
|
|
|
tidy:
|
|
go mod tidy
|
|
|
|
# What CI should run.
|
|
check: fmt vet test
|
|
|
|
docker:
|
|
podman build --build-arg VERSION=$(VERSION) -t localhost/vellum:$(VERSION) .
|
|
|
|
clean:
|
|
rm -f $(BINARY)
|
|
rm -rf data config
|