Project structure
Understand the boundaries and responsibilities in a generated Nextron application.
Structure at a glance
my-app/
├── src/
│ ├── app/ # Next.js routes and route handlers
│ ├── modules/ # Selected feature modules
│ ├── shared/ # Cross-module utilities and types
│ └── env.ts # Typed environment validation
├── AGENTS.md # Project context for coding agents
├── CLAUDE.md # Equivalent context for Claude Code
├── nextron.config.ts # Recorded generator choices
├── .env.example # Required environment variable template
└── package.jsonRoutes stay thin
Files under src/app connect URLs to feature modules. Business logic, UI views, and provider clients live under src/modules, which keeps route files easy to inspect and replace.
For example, a generated dashboard route exports the module view rather than rebuilding it inside page.tsx.
Modules own features
Each feature may use the following folders:
| Folder | Responsibility |
|---|---|
server | Server-only clients, queries, and service functions |
client | Browser clients and client-side providers |
ui | Feature components, layouts, and views |
@types | Feature-specific exported types |
Not every module needs every folder. Generated modules contain only the files required for the selected provider.
Shared code remains explicit
Use src/shared for code used by multiple modules. Keep provider-specific helpers inside their module so changing authentication, database, or payment providers does not create hidden dependencies across the project.
Configuration is a record, not a runtime
nextron.config.ts records the selections used to generate the project. The nextron add command reads it when applying another module. Your application does not need Nextron running in production.