This file provides guidance to Claude Code (claude.ai/code) when working with code in this repository.
This codebase is heavily inspired by and deeply appreciates shadcn/ui.
We monitor shadcn/ui updates and align our patterns accordingly. The ecosystem—registry system, directory structure, component architecture—follows shadcn conventions. However, we have our own enterprise-level architecture that extends beyond a simple component library.
| What We Do | shadcn/ui Equivalent | Notes |
|---|---|---|
| UI | shadcn/ui primitives | Radix-based, copied directly |
| Atoms | shadcn UI components | 2+ primitives combined, same pattern |
| Templates | shadcn Blocks | Full-page layouts, sections |
| Blocks | Beyond shadcn | UI with logic (tables, forms, data-driven) |
| Micro | Beyond shadcn | Mini micro-services |
| Apps | Beyond shadcn | Complete applications |
Key distinction: Our "Templates" = shadcn "Blocks". Our "Blocks" are something else entirely—reusable UI with embedded business logic.
We preserve some older shadcn/ui patterns that we love, even as shadcn has updated their homepage:
- PageHeader component - Our hero/heading pattern
- PageActions - Action button layouts
- A few other UI atoms from earlier shadcn versions
These are intentionally kept as they work well for our use cases.
- Follow shadcn patterns - Always check ui.shadcn.com for reference
- Component hierarchy - Understand UI → Atoms → Templates → Blocks → Micro progression
- Registry system - Use shadcn-style registry for component distribution
- Mirror-pattern - Every URL route maps 1:1 to
app/andcomponents/directories
- Framework: Next.js 16.1.1 with App Router (Turbopack default)
- Runtime: React 19.2.3, Node.js runtime only (Edge deprecated in Next.js 16)
- Database: PostgreSQL with Prisma ORM 6.19.0 (library engine)
- Authentication: NextAuth v5 (beta) with Prisma adapter
- Styling: Tailwind CSS v4 with OKLCH color tokens
- UI Components: Radix UI primitives + shadcn/ui
- Internationalization: Custom i18n (English, Arabic RTL)
- Documentation: Fumadocs MDX
- AI Integration: Vercel AI SDK (Anthropic, Groq, OpenAI)
pnpm dev # Development server (Turbopack default)
pnpm build # Production build
pnpm lint # ESLint
pnpm build:registry # Build component registry
pnpm generate:docs # Generate atom documentation
pnpm sync:shadcn # Sync shadcn/ui componentspnpm prisma generate # Generate client (runs on postinstall)
pnpm prisma db push # Push schema changes (development)
pnpm prisma studio # Database GUIFoundation: Radix UI → shadcn/ui → shadcn Ecosystem
Building: UI → Atoms → Templates → Blocks → Micro → Apps
- UI (
src/components/ui/) - shadcn/ui primitives, 54+ components - Atoms (
src/components/atom/) - 2+ UI primitives combined, 62+ components - Templates (
src/components/template/) - Full-page layouts (= shadcn blocks) - Blocks - UI with logic: reusable tables, forms, data-driven components
- Micro - Mini micro-services and micro-frontends
Every URL route produces two directories:
app/[lang]/abc/—page.tsx,layout.tsxcomponents/abc/—content.tsx,actions.ts,form.tsx,validation.ts,types.ts
Follows shadcn registry pattern:
__registry__/- Generated component indexsrc/registry/- Source definitions by style (default, new-york)public/r/- Published JSON files for CLI consumptionscripts/build-registry.mts- Registry build script
Next.js 16 renamed middleware.ts to proxy.ts. Located at src/proxy.ts:
- Authentication checks (cookie-based session verification)
- i18n locale detection and redirection
- Protected route enforcement
- Node.js runtime only (Edge not supported)
All dynamic APIs must be awaited:
export default async function Page(props: { params: Promise<{ lang: string }> }) {
const { lang } = await props.params;
}Never import @prisma/client in client components (breaks Turbopack):
// ❌ Bad
import { UserRole } from "@prisma/client";
// ✅ Good - local mirror
const UserRole = { ADMIN: "ADMIN", USER: "USER" } as const;// Server Component
import { currentUser } from "@/lib/auth";
const user = await currentUser();
// Client Component
import { useCurrentUser } from "@/components/auth/use-current-user";
const user = useCurrentUser();| File | Purpose |
|---|---|
src/proxy.ts |
Auth & i18n routing |
src/routes.ts |
Route protection rules |
src/auth.ts |
NextAuth configuration |
next.config.ts |
Next.js + MDX config |
prisma.config.ts |
Prisma directory config |
Required:
DATABASE_URL= # PostgreSQL (Neon)
AUTH_SECRET= # openssl rand -hex 32
NEXTAUTH_URL= # Production URLOAuth (optional):
GOOGLE_CLIENT_ID=
GOOGLE_CLIENT_SECRET=
FACEBOOK_CLIENT_ID=
FACEBOOK_CLIENT_SECRET=This codebase supports Vibe Coding—AI-powered development where you describe what you want in natural language and AI handles implementation details. See /docs/vibe-coding for prompting techniques and best practices.
- TypeScript errors ignored via
ignoreBuildErrors: truein next.config - Prisma requires Node.js runtime (add
export const runtime = "nodejs") next-authpeer dependency warning (expects Next.js 14/15, works with 16)
Production: https://cb.databayt.org (Vercel)
Always push changes to remote after committing.