Project Structure
Project Structure
Generated projects separate responsibilities. Product pages live in app and
features, composition rules in core/modules, provider details in
adapters, and business code calls external capabilities through services.
Core directories
src/
├── app/ # Pages, layouts, APIs, webhooks, and health
├── core/modules/ # Module contract and validation
├── core/services/ # Payment, mail, storage, AI, jobs, and rate-limit contracts
├── modules/ # Registry for this generated project
├── adapters/ # Selected provider implementations
├── services/ # Business-facing service instances
├── features/ # Product feature modules
├── db/schema/ # Drizzle schema split by module
├── content/ # Docs, blog, and legal MDX
├── config/ # Site, navigation, pricing, and plans
└── test/ # Core logic and integration tests
Generated selection
| Path | Purpose |
|---|---|
nextdevtpl.generated.json | Effective modules, adapters, target, and catalog version |
src/modules/registry.ts | Modules visible to runtime code |
src/adapters/registry.ts | Selected adapter manifests and requirements |
.env.example | Variables retained for the selected combination |
The template repository also contains recipes/catalog.json,
templates/base/manifest.json, packages/create-nextdevtpl, and
tests/compatibility. Normal generated apps do not carry generator maintenance
files.
Routes
src/app/
├── [locale]/
│ ├── (marketing)/ # Home, pricing, blog, legal, and PSEO
│ ├── (auth)/ # Sign in, sign up, password reset
│ ├── (dashboard)/ # Workspace, credits, settings, and support
│ ├── (admin)/ # Admin area
│ └── docs/ # Fumadocs documentation
└── api/
├── auth/ # Better Auth
├── webhooks/payment # Shared endpoint for the selected payment adapter
├── upload/ # Presigned uploads
├── jobs/ # Protected cron handlers
└── health/ # Deployment health check
Routes belonging to unselected modules are removed. A 404 for one of those routes is expected.
Where changes belong
| Change | Location |
|---|---|
| Page or product flow | src/features/<module> and its src/app route |
| Provider API | src/adapters/<service> |
| Business-facing service | src/services/<service>.ts |
| New module declaration | src/features/<module>/manifest.ts |
| Database table | src/db/schema/<group>.ts |
| UI copy | messages/en.json, messages/zh.json |
| Documentation | src/content/docs/en, src/content/docs/zh |
| Deployment | deploy/, Dockerfile, compose.yaml, vercel.json, wrangler.jsonc |
Product code should depend on src/services and public module exports instead
of importing adapter internals across boundaries.