Backend (Go/Gin/pgx): env config, pgx pool with retries, Garage S3 client (path-style, region garage), embedded golang-migrate migrations, JWT auth with refresh rotation, albums CRUD, members/roles/invites with no-escalation matrix, photo upload + async imaging/goexif WebP variants, cursor pagination, presigned URLs, likes/comments, SSE hub (album + personal), notifications, share links. Frontend (SvelteKit 2 + Svelte 5 + Tailwind v4): API wrapper with 401 refresh, auth store, all screens, Uploader/PhotoGrid/Lightbox/Comments, SSE client with reconnect + REST catch-up, three themes + system via data-theme. Deploy without Docker: Makefile builds the frontend into backend/static and embeds it (go:embed) into a single statically linked binary; systemd unit and nginx SSE example included. Use gen2brain/webp (-tags nodynamic) instead of cgo kolesa-team/go-webp to keep CGO_ENABLED=0 static builds; design.md/proposal.md updated accordingly.
32 lines
710 B
Makefile
32 lines
710 B
Makefile
.PHONY: build frontend backend run migrate tidy test clean
|
|
|
|
frontend:
|
|
cd frontend && npm ci && npm run build
|
|
rm -rf backend/static/*
|
|
cp -r frontend/build/* backend/static/
|
|
|
|
backend:
|
|
mkdir -p bin
|
|
# -tags nodynamic forces gen2brain/webp to use its pure-Go transpiled path
|
|
# (no purego/dlopen), keeping the binary fully static.
|
|
cd backend && CGO_ENABLED=0 go build -tags nodynamic -trimpath -ldflags="-s -w" \
|
|
-o ../bin/shared-album ./cmd/server
|
|
|
|
build: frontend backend
|
|
|
|
run: backend
|
|
cd backend && ../bin/shared-album
|
|
|
|
migrate:
|
|
cd backend && go run ./cmd/migrate
|
|
|
|
tidy:
|
|
cd backend && go mod tidy
|
|
|
|
test:
|
|
cd backend && go test ./...
|
|
|
|
clean:
|
|
rm -rf bin backend/static/*
|
|
touch backend/static/.gitkeep
|