diff --git a/.env.example b/.env.example index 46a2f9b..9350373 100644 --- a/.env.example +++ b/.env.example @@ -8,9 +8,13 @@ WORKER_CONCURRENCY=5 CONSOLE_PROXY_ADDR=:8081 # Supabase/Postgres -DATABASE_URL=postgres://postgres:postgres@localhost:5432/postgres?sslmode=disable -SUPABASE_JWKS_URL=http://localhost:54321/auth/v1/.well-known/jwks.json -SUPABASE_ISSUER=http://localhost:54321/auth/v1 +DATABASE_URL=postgres://postgres:postgres@localhost:54322/postgres?sslmode=disable +SUPABASE_URL=http://localhost:8000 +SUPABASE_AUTH_EXTERNAL_URL=http://localhost:8000/auth/v1 +SUPABASE_JWKS_URL=http://localhost:8000/auth/v1/.well-known/jwks.json +SUPABASE_ISSUER=http://localhost:8000/auth/v1 +SUPABASE_ANON_KEY= +SUPABASE_SERVICE_ROLE_KEY= # Redis/asynq REDIS_ADDR=localhost:6379 @@ -21,5 +25,6 @@ MASTER_KEY_BASE64= # Frontend VITE_API_BASE_URL=http://localhost:8080 -VITE_SUPABASE_URL=http://localhost:54321 +VITE_SUPABASE_URL=http://localhost:8000 VITE_SUPABASE_ANON_KEY= +APP_SITE_URL=http://localhost:5173 diff --git a/.gitignore b/.gitignore index e7f13d6..0e42483 100644 --- a/.gitignore +++ b/.gitignore @@ -17,6 +17,7 @@ node_modules/ dist/ frontend/dist/ frontend/.vite/ +*.tsbuildinfo # Logs *.log diff --git a/CHANGELOG.md b/CHANGELOG.md index 856d953..7efd830 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,3 +4,4 @@ - E0-T01 begonnen: Monorepo-Grundstruktur, Root-Dokumentation, Env-Beispiel und minimale Service-Startpunkte angelegt. - Annahme dokumentiert: vorlaeufiger Modulpfad ist `proxui`. +- E0-T02 vorbereitet: Makefile-Targets und ESLint-Config angelegt; fehlgeschlagener reduzierter Supabase-Compose wurde entfernt, naechster Ansatz ist die offizielle Supabase-Self-Hosted-Konfiguration. diff --git a/Makefile b/Makefile new file mode 100644 index 0000000..9f719d7 --- /dev/null +++ b/Makefile @@ -0,0 +1,37 @@ +SHELL := /bin/sh + +GOCACHE ?= $(CURDIR)/.tmp/go-build +GO := env GOCACHE=$(GOCACHE) go +COMPOSE := docker compose + +.PHONY: dev dev-down dev-logs migrate test lint build frontend-build verify clean + +dev: + @echo "Dev infrastructure is not configured yet. Next step: official Supabase self-host stack." + +dev-down: + @echo "No dev infrastructure is configured." + +dev-logs: + @echo "No dev infrastructure is configured." + +migrate: + @echo "No migrations configured yet. E2-T01 will wire golang-migrate." + +test: + env GOCACHE="$(GOCACHE)" go test ./backend/... ./worker/... ./console-proxy/... + +lint: + env GOCACHE="$(GOCACHE)" go vet ./backend/... ./worker/... ./console-proxy/... + npm run lint --prefix frontend + +build: + env GOCACHE="$(GOCACHE)" go build ./backend/cmd/api ./worker/cmd/worker ./console-proxy/cmd/console-proxy + +frontend-build: + npm run build --prefix frontend + +verify: lint test build frontend-build + +clean: + rm -rf frontend/dist ".tmp/go-build" diff --git a/README.md b/README.md index d5bf194..fbd31f3 100644 --- a/README.md +++ b/README.md @@ -19,11 +19,19 @@ Multi-Tenant-Konsole fuer Proxmox auf Basis von Go, Supabase Postgres/Auth, Redi 4. `.env.example` nach `.env` kopieren und lokale Werte setzen. 5. Abhaengigkeiten installieren: `npm install --prefix frontend`. 6. Go-Abhaengigkeiten installieren: `go work sync`. -7. Backend starten: `go run ./backend/cmd/api`. -8. Console-Proxy starten: `go run ./console-proxy/cmd/console-proxy`. -9. Frontend starten: `npm run dev --prefix frontend`. +7. Lokale Infrastruktur starten: wird mit der offiziellen Supabase-Self-Hosted-Konfiguration ergaenzt. +8. Backend starten: `go run ./backend/cmd/api`. +9. Console-Proxy starten: `go run ./console-proxy/cmd/console-proxy`. +10. Frontend starten: `npm run dev --prefix frontend`. -`make dev`, `make migrate`, `make test` und `make lint` werden mit E0-T02 angelegt, sobald die lokale Docker-Umgebung steht. +Aktuelle Targets: + +- `make test`: Go-Tests +- `make build`: Go-Builds +- `make frontend-build`: Frontend-Production-Build +- `make lint`: Go Vet und Frontend-ESLint +- `make verify`: Lint, Tests und Builds +- `make migrate`: Platzhalter bis E2-T01 `golang-migrate` einbindet ## Sicherheitsregeln diff --git a/TODO.md b/TODO.md index 0591e13..e519cc2 100644 --- a/TODO.md +++ b/TODO.md @@ -10,10 +10,16 @@ Arbeitsliste auf Basis von `proxmox-console-entwicklungsplan.md`. Die Entwurfsda - [x] Minimale Startpunkte fuer Backend, Worker, Console-Proxy und Frontend angelegt - [x] Lokale Toolchain geprueft: Go 1.26.4 ist im PATH - [x] Erste Build-/Test-Kommandos ausgefuehrt +- [ ] E0-T02: Lokale Dev-Umgebung mit offizieller Supabase-Self-Hosted-Konfiguration und Redis + - [x] `Makefile` mit `dev`, `migrate`, `test`, `lint`, `build`, `frontend-build`, `verify` angelegt + - [x] Reduzierten Supabase-Compose-Versuch entfernt + - [ ] Offizielle Supabase-Self-Hosted-Dateien einbinden + - [ ] Projekt-spezifische ENV-Datei aus offizieller Vorlage ableiten + - [ ] Infrastruktur testweise starten + - [ ] Healthchecks/Erreichbarkeit pruefen ## Naechste Aufgaben -- [ ] E0-T02: Lokale Dev-Umgebung mit Docker Compose, Supabase-nahem Postgres/Auth-Setup und Redis - [ ] E0-T03: CI-Pipeline mit Build, Lint, Tests und Secret-Scan - [ ] E0-T04: Konfigurations- und Logging-Layer fuer Go-Dienste - [ ] E2-T01: Migrations-Setup mit `golang-migrate` @@ -34,7 +40,7 @@ Arbeitsliste auf Basis von `proxmox-console-entwicklungsplan.md`. Die Entwurfsda ## Annahmen - Modulpfad vorlaeufig: `proxui`. Falls spaeter ein Git-Remote/Org-Name feststeht, wird der Go-Modulpfad angepasst. -- Bis die Supabase-CLI-Konfiguration festgelegt ist, startet die lokale Datenbank zuerst als normaler Postgres-Service plus Redis. +- Supabase wird lokal nicht mehr per reduziertem Eigenbau gestartet; naechster Ansatz ist die offizielle Self-Hosted-Konfiguration. - UI-Texte werden Deutsch, Code-Identifier Englisch. ## Verifikation @@ -44,3 +50,6 @@ Arbeitsliste auf Basis von `proxmox-console-entwicklungsplan.md`. Die Entwurfsda - 2026-06-09: `go build ./backend/cmd/api ./worker/cmd/worker ./console-proxy/cmd/console-proxy` erfolgreich. - 2026-06-09: `npm install --prefix frontend` erfolgreich; 0 Vulnerabilities. - 2026-06-09: `npm run build --prefix frontend` erfolgreich. +- 2026-06-09: `make verify` erfolgreich. +- 2026-06-09: Orbstack geprueft: Docker-Kontext `orbstack`, Engine `OrbStack`, Architektur `aarch64`, Docker `29.4.0`. +- 2026-06-09: Reduzierter Supabase-Compose-Versuch entfernt; lokale Container und Volumes per `docker compose down -v --remove-orphans` geloescht. diff --git a/frontend/eslint.config.js b/frontend/eslint.config.js new file mode 100644 index 0000000..5e05f6a --- /dev/null +++ b/frontend/eslint.config.js @@ -0,0 +1,22 @@ +import js from "@eslint/js"; +import tseslint from "typescript-eslint"; + +export default tseslint.config( + { + ignores: ["dist/**", "node_modules/**"] + }, + js.configs.recommended, + ...tseslint.configs.recommended, + { + files: ["src/**/*.{ts,tsx}", "*.ts"], + languageOptions: { + ecmaVersion: 2022, + sourceType: "module", + globals: { + document: "readonly", + console: "readonly", + window: "readonly" + } + } + } +);