Next.js — App Router, Folder Structure, Rendering and Full Stack with SQL Server
Folder conventions
app/ routes · page.tsx · layout.tsx · loading.tsx · error.tsx · not-found.tsx · route.ts (API) · [id] dynamic · [...slug] catch-all · (group) · _private · proxy.ts (middleware) · public/ static.
Components
Server by default (async, DB, secrets, zero JS) · "use client" for state/events · keep client components small · import "server-only" for DB code.
Rendering
Static + generateStaticParams · ISR revalidate · on-demand revalidatePath/Tag · dynamic per request · streaming Suspense · Cache Components "use cache" (16).
SQL Server
mssql pool on globalThis · Node runtime · env vars (no NEXT_PUBLIC_) · parameterised queries · or Prisma sqlserver · or call an ASP.NET Core API.
Deploy
Vercel (git push) · output: "standalone" for Docker/Azure/IIS (reverse proxy) · output: "export" for static sites.