Stable framework
Next.js, with the complete FSD structure
Use the Next.js App Router with thin route wrappers, reusable FSD page slices, and client-side providers for the selected stack. The CLI downloads a dedicated template repository and saves your choices in fsd.config.json for subsequent generation.
Create a project
npx create-fsd-architecture@latest my-next-app --framework nextjsnpx create-fsd-architecture@latest my-next-app --framework nextjs --yes --no-start
cd my-next-app
npm run devThe first command offers interactive stack choices. The second accepts the defaults below, installs dependencies with npm, and leaves starting the development server to you. Interactive creation also supports pnpm, Yarn, and Bun. React Query and forms can be disabled.
Default stack
Framework
Next.js 16 + React 19
API client
Axios by default; native Fetch optional
Server state
TanStack React Query
Client state
Zustand by default; Redux Toolkit or none optional
Forms
React Hook Form + Zod
Styling
Tailwind CSS 4 and shared UI
Quality
TypeScript, Biome, Steiger, Husky, Commitlint
Architecture and routing
src/
├── app/ # Bootstrap, providers, routing, and styles
├── pages/ # FSD page compositions
├── widgets/ # Large reusable UI blocks
├── features/ # User interactions and business actions
├── entities/ # Business entities
└── shared/ # API, assets, config, utilities, types, and UIThis template configures pageExtensions in next.config.ts to recognize route.tsx, route.ts, route.jsx, and route.js. Keep that configuration: FSD files in src/pages are compositions, not Pages Router endpoints.
src/pages/account/ui/account-page.tsx # FSD page
src/pages/account/index.ts # Public API
src/app/account/page.route.tsx # App Router wrapper for /accountGenerated interactive modules include the client directive where needed. Keep server-only code and secrets outside client modules; generating an auth UI does not provide a backend or route protection.
Generate slices and routes
Run these commands inside your generated project. The saved configuration controls the output without repeating stack prompts.
npx create-fsd-architecture@latest --generate feature checkout
npx create-fsd-architecture@latest --generate entity product
npx create-fsd-architecture@latest --generate widget navbar
npx create-fsd-architecture@latest --generate page account
npx create-fsd-architecture@latest --generate feature authReact components, API modules, state, and form integrations follow the selected capabilities. Connect generated API and auth flows to your own backend before using them with real users.
API configuration
Generated clients read NEXT_PUBLIC_API_URL, falling back to /api. Set the public backend base URL in your environment and restart the dev server. Public variables are not a place for secrets; the fallback does not create backend endpoints.
NEXT_PUBLIC_API_URL=https://api.example.comQuality commands
npm run fsd:check
npm run lint
npm run typecheck
npm run build
npm run ciUse the equivalent commands for your selected package manager. New scaffolds receive template and CLI fixes; existing projects are not automatically migrated by running a newer CLI.