diff --git a/client/CLAUDE.md b/client/CLAUDE.md index 1810573..e55bdde 100644 --- a/client/CLAUDE.md +++ b/client/CLAUDE.md @@ -39,11 +39,27 @@ client/ │ ├── DarkModeButton.tsx # 'use client' — only subscriber to useColorScheme() │ └── index.tsx ├── lib/ + │ ├── api/ + │ │ ├── client.ts # clientFetch — throws ApiError on error; use in hooks/client components + │ │ ├── server.ts # serverFetch — throws ApiError on error; use in RSCs/Server Actions + │ │ └── errors.ts # ApiError class (status, message, code) + │ ├── query/ + │ │ ├── queryClient.ts # makeQueryClient factory + getQueryClient() SSR-safe singleton + │ │ └── QueryProvider.tsx # 'use client' — QueryClientProvider + ReactQueryDevtools │ └── cookies/ # Cookie manager — strict server/client separation - │ ├── constants.ts # COOKIE_NAMES, CookieOptions, COLOR_SCHEME_COOKIE_OPTIONS + │ ├── constants.ts # COOKIE_NAMES, CookieOptions, AUTH_*_COOKIE_OPTIONS │ ├── server.ts # getServerCookie, getThemeMode, setServerCookie │ ├── client.ts # getClientCookie, setClientCookie, deleteClientCookie │ └── index.ts # Re-exports constants ONLY (never server/client) + ├── services/ # Domain services — no top-level barrel; import directly from the file + │ └── {domain}/ + │ ├── types.ts # Request/response types for this domain + │ ├── keys.ts # React Query key factory + │ ├── apis/ + │ │ ├── clientApi.ts # Namespace object wrapping clientFetch calls + │ │ └── serverApi.ts # Namespace object wrapping serverFetch calls (only when needed) + │ └── hooks/ + │ └── use{Action}.ts # One hook per file — useQuery or useMutation ├── store/ # AppStore (Redux-like client state) ├── theme/ │ ├── ColorSchemeScript.tsx # Inline