# Balinyaar Client — Claude Code Guidelines ## Project Structure ``` client/ ├── messages/ # Translation files (add keys to BOTH files) │ ├── en.json │ └── fa.json ├── middleware.ts # next-intl routing middleware (locale detection + redirect) ├── next.config.mjs # createNextIntlPlugin wires i18n into Next.js └── src/ ├── app/ │ ├── layout.tsx # Root RSC: reads locale + cookie → sets HTML attrs │ ├── globals.css │ ├── fonts/ # Local font files (woff2) — Mikhak for fa │ └── [locale]/ │ ├── layout.tsx # RSC: setRequestLocale + NextIntlClientProvider + ThemeProvider + AppStoreProvider │ ├── (private-routes)/ │ │ ├── layout.tsx # 'use client' — wraps PrivateLayout │ │ └── page.tsx │ └── (public-routes)/ │ └── layout.tsx # 'use client' — wraps PublicLayout ├── components/ # Shared UI components (each with .test.tsx if imported >1 place) ├── i18n/ │ ├── routing.ts # defineRouting — locales: ['en', 'fa'], defaultLocale: 'fa' │ └── request.ts # getRequestConfig — loads messages/${locale}.json ├── layout/ │ ├── PrivateLayout.tsx # 'use client' — authenticated shell; uses useTranslations('nav') │ ├── PublicLayout.tsx # unauthenticated shell │ ├── TopBarAndSideBarLayout.tsx # 'use client' — TopBar + SideBar composition │ ├── config.ts │ ├── index.ts │ └── components/ │ ├── TopBar.tsx │ ├── SideBar.tsx │ ├── SideBarNavList.tsx │ ├── SideBarNavItem.tsx │ ├── DarkModeButton.tsx # 'use client' — only subscriber to useColorScheme() │ └── index.tsx ├── lib/ │ └── cookies/ # Cookie manager — strict server/client separation │ ├── constants.ts # COOKIE_NAMES, CookieOptions, COLOR_SCHEME_COOKIE_OPTIONS │ ├── server.ts # getServerCookie, getThemeMode, setServerCookie │ ├── client.ts # getClientCookie, setClientCookie, deleteClientCookie │ └── index.ts # Re-exports constants ONLY (never server/client) ├── store/ # AppStore (Redux-like client state) ├── theme/ │ ├── ColorSchemeScript.tsx # Inline