Structure
How the codebase is organized. Feature-first architecture with clear boundaries.
Feature-first, not type-first
The codebase groups code by feature, not by file type. Auth code lives with auth code. Ideas code lives with ideas code. You never hunt across five directories to understand one feature.
Key directories
app/ is the Next.js App Router. Pages, layouts, and route handlers. Everything under protected/ requires authentication. The framework docs live under framework/docs/.
features/ is where the real code lives. Each feature has its own directory with components, hooks, data fetching functions, and types. The _shared/ directory holds components used across multiple features — the sidebar, the turnstile captcha widget, shared layouts.
lib/ contains the infrastructure. The oRPC client and server callers, the Supabase client variants (browser, server, admin, proxy), Stripe utilities, and auth helpers. You rarely need to touch this unless you are adding a new infrastructure layer.
components/ui/ holds the shadcn/ui component library. These are the base building blocks — buttons, cards, dialogs, tables. They are styled with the design token system and should not be modified directly.
supabase/migrations/ contains every database migration. The agents create new migrations when features need schema changes. Each migration is timestamped and runs in order.