AEAl-Andalus⺢Experience
Sign in · Join
AEAl-Andalus⺢Experience
ProjectsGalleryAboutArticlesDashboardAPI
© 2026 — Modular content systems☕buy me a coffee
Framework Study Guide
ChaptersCardsLegendRoadmapRoute Map
Chapters
00 · Root Layout01 · Server Page (page.tsx)01a · Special Files (not-found, error, loading)02 · Client Component (UI & Interaction)02a · Client Boundaries & Islands03 · Entity Actions (actions/*.ts)04 · Server Actions ("use server")05 · Context Provider (context/*.tsx)06 · API Route (app/(api)/<entity>/route.ts)07 · TypeScript + Prisma08 · Entity-First Feature Design09 · Deployment, Docker & Cloud10 · Next 16 + Prisma 7 Upgrade11 · Prisma 7 (SQLite-first, App Router)12 · TypeORM (Entities + Migrations)13 · Drizzle ORM (SQL-first)11 · CSS, Mobile-First Flex, Tailwind12 · Libraries, Accelerators & Production Shortcuts14 · Next.js 16: cache, PPR, proxy, AI
→ cards/08-entity-first

Chapter

08 · Entity-First Feature Design

One folder = one entity. Logic lives with the entity, routes are UX-only.

Mental Model

  • Entity folder is a mini-repo: actions, components, context, types, lib.
  • Routes can move; entity internals stay portable and self-contained.

Canonical Structure

app/(index)/projects/
actions/
components/
context/
lib/
types/
page.tsx
layout.tsx
index.ts

Portability Rules

  • No cross-entity imports; expose a barrel if needed.
  • No hard-coded routes in internals; routes are UX concerns.
  • Public surface = actions + types; keep UI assumptions out.

Never Do

  • Nested routes dictating logic placement.
  • Shared state between entities; communicate via IDs/calls.
  • Cross-entity Prisma access; keep boundaries strict.