Move the dashboard and setup pages to a Vue SPA
The pages are now a Vue 3 + Vite + TypeScript app in web/, built into internal/web/dist/app and embedded in the binary. Go still serves index.html for / and /setup behind the admin gate, plus the hashed /assets/* (public, cached forever). The router takes its base from the current URL, so it works under nginx's /tracker/ prefix unchanged. Only dist/.gitkeep is committed, so go build and go test need no Node; an unbuilt binary shows a "run make web" page at /. The Dockerfile gains a Node stage, CI typechecks and builds the app, and make build/run build it first. Co-Authored-By: Claude Opus 5.5 <[email protected]>
This commit is contained in:
@@ -1,9 +1,17 @@
|
||||
COMPOSE := docker compose -f deploy/docker-compose.yml
|
||||
DEV_DB := postgres://tracker:tracker@localhost:5432/tracker?sslmode=disable
|
||||
|
||||
.PHONY: build test test-integration run up down docker migrate install-agent
|
||||
.PHONY: web web-dev build test test-integration run up down docker migrate install-agent
|
||||
|
||||
build:
|
||||
# Builds the Vue app into internal/web/dist/app, which the binary embeds.
|
||||
web:
|
||||
cd web && { [ -d node_modules ] || npm ci; } && npm run build
|
||||
|
||||
# Vite dev server with hot reload; it proxies /api to `make run` on :8080.
|
||||
web-dev:
|
||||
cd web && npm run dev
|
||||
|
||||
build: web
|
||||
go build -o bin/ ./cmd/...
|
||||
|
||||
test:
|
||||
@@ -13,7 +21,7 @@ test:
|
||||
test-integration:
|
||||
TEST_DATABASE_URL='$(DEV_DB)' go test -count=1 ./...
|
||||
|
||||
run:
|
||||
run: web
|
||||
AUTH_MODE=dev DEV_MODE=true DATABASE_URL='$(DEV_DB)' go run ./cmd/tracker serve
|
||||
|
||||
up:
|
||||
|
||||
Reference in New Issue
Block a user