M1: Plattform/Accounts — Auth, Tournament-CRUD, Generator, Import/Export - #2
Merged
Merged
Conversation
…t/export Implements milestone M1 from docs/PLAN.md across backend, frontend and the shared contract package. Built via an orchestrated multi-agent pass against a fixed contract, followed by a 5-lens adversarial review whose blocker + major findings are folded into this commit. Shared (packages/shared): - API DTO contracts (create/import inputs, summary/detail read-models, user, capability link) — single source of truth for Nest + the typed BFF client. - Enforce >= 2 participants at the schema boundary (no degenerate brackets). Backend (apps/api): - common: ZodValidationPipe, global ServiceTokenGuard (with @public bypass for health), CurrentActor decorator. Global PrismaModule. - bracket: own deterministic generator — single-elimination (mirror seeding + byes) and round-robin (circle method) correct; double-elim/swiss throw 501 (brackets-manager + Swiss land in M2/M3 per the plan's spike). - users: provider sync + /users/me. - tournaments: create (generate + persist normalized), list/get/delete, setup-only JSON export/import, guest->user claim, capability links. - main.ts: refuse to boot without BFF_SERVICE_TOKEN. Frontend (apps/web): - Auth.js v5 (Google + dev credentials) with JWT->Nest user sync. - BFF proxy hardened: strips/overwrites trust headers, only carries x-anon-token for guests, drops content-encoding/length + hop-by-hop on the response so decompressed bodies and SSE are not corrupted. - /api/claim bridges the guest cookie to the user server-side. - Dashboard/history, create form, read-only detail (export/delete), TanStack Query + SessionProvider via a single app-level provider, DE/EN messages. Security fixes from review: claim now derives the anon token from the trusted x-anon-token header (not the request body) — closes an account-takeover IDOR; pino redacts the service token, actor headers and cookies. Offline scaffold: not installed/compiled here. Run pnpm install + prisma migrate before first start; see docs/PLAN.md "M1 — Bekannte Follow-ups". Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This was referenced Jun 15, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Setzt Meilenstein M1 aus
docs/PLAN.mdum. Entstanden durch einen orchestrierten Multi-Agent-Build (6 Slices gegen einen fixen Contract) + ein adversariales 5-Perspektiven-Review; dessen Blocker + alle Majors sind hier eingearbeitet.Was drin ist
Shared (
packages/shared)participants.min(2)am Schema-Rand (keine degenerierten Brackets).Backend (
apps/api)common: ZodValidationPipe, globaler ServiceTokenGuard (mit@Public()-Bypass für/health), CurrentActor-Decorator, globales PrismaModule.bracket: eigener deterministischer Generator — Single-Elimination (Mirror-Seeding + Byes) und Round-Robin (Circle-Method) korrekt; Double-Elim/Swiss werfen501(brackets-manager + Swiss kommen im M2/M3-Spike).users: Provider-Sync +/users/me.tournaments: Create (generieren + normalisiert persistieren), List/Get/Delete, Setup-only JSON Export/Import, Gast→User-Claim, Capability-Links.main.ts: bootet nicht ohneBFF_SERVICE_TOKEN.Frontend (
apps/web)x-anon-tokennur für Gäste, stripptcontent-encoding/length+ hop-by-hop auf der Antwort (sonst doppeltes Gunzip / kaputtes SSE)./api/claimbridged das Gast-Cookie server-seitig zum User.Security-Fixes aus dem Review
x-anon-token-Header ab (aus dem eigenen httpOnly-Cookie), nicht mehr aus dem Request-Body.Bewusst auf M2+ verschoben (im Plan dokumentiert)
Capability-Link-Expiry/Typ-Gating, Link-Client-Funktionen, Response-Zod-Parse, Redirect-
Location-Strip.Für Reviewer /⚠️ vor dem ersten Start
Offline gebaut → nicht installiert/kompiliert. Vor dem Start nötig:
Besonders zur Laufzeit prüfen: Generator-Ausgabe, Auth.js-v5-Flow, BFF-SSE-Stream.
🤖 Generated with Claude Code