Add per-folder CLAUDE.md for key packages

Signed-off-by: Bryan Frimin <bryan@getprobo.com>
This commit is contained in:
Bryan Frimin
2026-03-15 14:05:23 +01:00
parent ecba352307
commit 7a4101185b
7 changed files with 459 additions and 0 deletions

57
apps/console/CLAUDE.md Normal file
View File

@@ -0,0 +1,57 @@
# apps/console
React 19 + Vite + TypeScript + Relay + TailwindCSS. Port 5173.
## Commands
| Command | Purpose |
|---------|---------|
| `npm run dev` | Start dev server (port 5173) |
| `npm run build` | Production build |
| `npx relay-compiler` | Regenerate Relay artifacts |
## Routes
Defined in `src/routes.tsx` with feature-specific route files (e.g. `src/routes/assetRoutes.ts`).
- Lazy-loaded via `lazy()` from `@probo/react-lazy`
- Data loading: `loaderFromQueryLoader()` + `loadQuery()` (Relay)
- Type: all routes `satisfies AppRoute[]`
- Fallback: `PageSkeleton` or `Fallback` components during loading
- Error boundaries per route group
## Relay
Queries, fragments, and mutations are **colocated** in the component that uses them — never in separate `hooks/graph/` files.
Always use **fragments** to define data requirements. Never create custom TypeScript types for API data — let Relay generate types from fragments.
### Mutations
Use `@appendEdge` / `@deleteEdge` directives for Relay store updates:
```typescript
const createAssetMutation = graphql`
mutation AssetCreateMutation($input: CreateAssetInput!, $connections: [ID!]!) {
createAsset(input: $input) {
assetEdge @appendEdge(connections: $connections) {
node { id name }
}
}
}
`;
```
## Permissions
Inline permission queries in Relay fragments:
```graphql
canCreate: permission(action: "core:asset:create")
```
## Components
- Form fields: `src/components/form/`
- Dialogs: modal components with mutation handling
- Shared UI: `@probo/ui` package

15
apps/trust/CLAUDE.md Normal file
View File

@@ -0,0 +1,15 @@
# apps/trust
React 19 + Vite + TypeScript + Relay + TailwindCSS. Port 5174.
Same frontend stack as `apps/console/` — see its CLAUDE.md for Relay query patterns, mutation hooks, and component conventions.
## Trust-specific differences
- Public-facing trust center app (not an internal dashboard)
- Path-prefix routing: `/trust/{slug}` for Probo-hosted, `/` for custom domains
- Routes: `/overview`, `/documents`, `/subprocessors`, `/updates`
- Auth flow: `/connect`, `/verify-magic-link`, `/full-name`
- Content routes (`/overview`, `/documents`, `/subprocessors`, `/updates`) wrapped in `MainLayout`
- Auth routes (`/connect`, `/verify-magic-link`, `/full-name`) wrapped in `AuthLayout`
- All route groups use `RootErrorBoundary`