feat: Update CLAUDE.md files, add docs

This commit is contained in:
2026-02-08 08:36:29 +01:00
parent 9542d704e4
commit 935525067e
3 changed files with 342 additions and 4 deletions

View File

@@ -89,11 +89,18 @@ cd legalconsenthub && pnpm install && pnpm run dev
# Backend (port 8080)
cd legalconsenthub-backend && ./gradlew bootRun
# Generate API clients (after modifying api/legalconsenthub.yml)
pnpm run api:generate # Frontend client
./gradlew generate_legalconsenthub_server # Backend server stubs
# Generate API clients (REQUIRED after modifying api/legalconsenthub.yml)
cd legalconsenthub && pnpm run api:generate # Frontend TypeScript client
cd legalconsenthub-backend && ./gradlew generate_legalconsenthub_server # Backend Kotlin server stubs
```
**⚠️ CRITICAL: API Client Regeneration**
After ANY change to `api/legalconsenthub.yml`, you MUST regenerate BOTH clients:
1. Frontend: `pnpm run api:generate` (TypeScript client)
2. Backend: `./gradlew generate_legalconsenthub_server` (Kotlin server stubs)
Compilation/runtime will fail if clients are out of sync with the OpenAPI spec.
---
## Key Files
@@ -109,7 +116,12 @@ See subproject CLAUDE.md files for component-specific key files.
## Rules for AI
1. **API-first workflow** - Always modify OpenAPI spec first, then regenerate clients
1. **API-first workflow** - ALWAYS follow this sequence when modifying APIs:
a. Modify `api/legalconsenthub.yml` OpenAPI spec first
b. Regenerate frontend client: `cd legalconsenthub && pnpm run api:generate`
c. Regenerate backend stubs: `cd legalconsenthub-backend && ./gradlew generate_legalconsenthub_server`
d. Implement backend controller methods (they implement generated interfaces)
e. Use generated client in frontend (never write manual API calls)
2. **Organization context** - Always consider `organizationId` for multi-tenancy. Forms with empty/null organizationId are "global" forms visible to all organizations
3. **Form structure is 3-level** - Section → SubSection → Element
4. **Roles managed in Keycloak** - Not in application database