diff --git a/.claude/settings.local.json b/.claude/settings.local.json index 0e5a8e6..c7161c2 100644 --- a/.claude/settings.local.json +++ b/.claude/settings.local.json @@ -5,7 +5,35 @@ "Bash(rm -f server/CleanArcTemplate.nuspec)", "Bash(rm -f server/.github/workflows/package.yml)", "Bash(rmdir server/.github/workflows)", - "Bash(rmdir server/.github)" - ] + "Bash(rmdir server/.github)", + "Bash(npm -v)", + "Bash(dotnet --version)", + "Bash(npm install *)", + "Bash(node -e \"const p=require\\('./node_modules/next/package.json'\\).version; const m=require\\('./node_modules/@mui/material/package.json'\\).version; const r=require\\('./node_modules/react/package.json'\\).version; const e=require\\('./node_modules/eslint/package.json'\\).version; const mn=require\\('./node_modules/@mui/material-nextjs/package.json'\\).version; console.log\\('next',p\\);console.log\\('@mui/material',m\\);console.log\\('@mui/material-nextjs',mn\\);console.log\\('react',r\\);console.log\\('eslint',e\\);\")", + "Bash(node -e ' *)", + "Bash(npx tsc *)", + "Bash(echo \"TYPE_EXIT=$?\")", + "Bash(npm run *)", + "PowerShell(ls \"c:\\\\Users\\\\Lenovo\\\\Desktop\\\\balinyaar\\\\client\\\\node_modules\\\\@mui\\\\material\" | Select-Object Name | Where-Object { $_.Name -match \"Color|Init|Css\" })", + "PowerShell(node -e \"const v = require\\('c:/Users/Lenovo/Desktop/balinyaar/client/node_modules/@testing-library/jest-dom/package.json'\\).version; console.log\\('@testing-library/jest-dom', v\\)\")", + "WebFetch(domain:www.nuget.org)", + "Bash(xargs grep -l \"Route\\\\|ApiVersion\\\\|Controller\")", + "PowerShell(cd \"c:\\\\Users\\\\Lenovo\\\\Desktop\\\\balinyaar\\\\server\"; dotnet build 2>&1 | Select-String -Pattern \"error|warning|Build succeeded|Build FAILED\" | Where-Object { $_ -notmatch \"NETSDK1057\" })", + "Read(//c/Users/Lenovo/Desktop/balinyaar/server/src/API/Baya.Web.Api/Controllers/V1/**)", + "Bash(cd /c/Users/Lenovo/Desktop/balinyaar/client && find . -type f -name \"*.ts\" -o -name \"*.tsx\" -o -name \"*.json\" -o -name \"*.mjs\" | head -50)", + "Read(//c/c/Users/Lenovo/Desktop/balinyaar/**)", + "Bash(xargs grep -l \"getLocale\\\\|setRequestLocale\\\\|requestLocale\")", + "Bash(node -e \"const p=require\\('c:/Users/Lenovo/Desktop/balinyaar/client/package.json'\\); console.log\\(JSON.stringify\\({scripts:p.scripts,next:p.dependencies?.next},null,2\\)\\)\")", + "Bash(node -e \"const p=require\\('c:/Users/Lenovo/Desktop/balinyaar/client/node_modules/next/package.json'\\); console.log\\(p.version\\)\")", + "Bash(node -e \"const d=JSON.parse\\(require\\('fs'\\).readFileSync\\('/dev/stdin','utf8'\\)\\); const keys=Object.keys\\(d.exports||{}\\).filter\\(k=>k.includes\\('middleware'\\)||k.includes\\('server'\\)\\); console.log\\(keys.slice\\(0,20\\)\\)\")", + "Bash(xargs grep -l \"middleware\")", + "Bash(node -e \"const p=require\\('c:/Users/Lenovo/Desktop/balinyaar/client/node_modules/next-intl/package.json'\\); const exp=p.exports; const keys=Object.keys\\(exp||{}\\).filter\\(k=>k.includes\\('middleware'\\)\\); keys.forEach\\(k=>console.log\\(k,JSON.stringify\\(exp[k]\\)\\)\\)\")", + "PowerShell(Select-String -Path \"c:\\\\Users\\\\Lenovo\\\\Desktop\\\\balinyaar\\\\client\\\\node_modules\\\\next\\\\dist\\\\lib\\\\constants.js\" -Pattern \"MIDDLEWARE_FILENAME|MIDDLEWARE_LOCATION\" | ForEach-Object { $_.Line.Substring\\(0, [Math]::Min\\(300, $_.Line.Length\\)\\) })", + "Bash(node -e \"const p = require\\('c:/Users/Lenovo/Desktop/balinyaar/client/node_modules/next-intl/package.json'\\); console.log\\(JSON.stringify\\(p.exports['./plugin'] || p.exports, null, 2\\).substring\\(0, 1000\\)\\);\")", + "Bash(xargs grep -l \"HEADER_LOCALE_NAME\\\\|X-NEXT-INTL\")", + "Bash(xargs ls)", + "Bash(xargs grep \"AppStoreProvider\")" + ], + "defaultMode": "bypassPermissions" } } diff --git a/client/CLAUDE.md b/client/CLAUDE.md new file mode 100644 index 0000000..1810573 --- /dev/null +++ b/client/CLAUDE.md @@ -0,0 +1,287 @@ +# 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