Project Structure
Overview of the Dirstarter file and folder organization
Dirstarter follows a modular architecture based on Next.js App Router. This page explains the key directories and files in the project.
Root Directory Structure
Key Directories
/components Directory
Components are organized by their purpose:
/server Directory
Server-side code is organized as one flat folder per entity, plus shared infrastructure:
Every entity folder holds the same set of files: queries.ts (Prisma reads), mutations.ts (Prisma writes), schema.ts (Zod schemas), and router.ts (the oRPC procedures that gate and expose them). The unified procedure builder, the can() permission evaluator, and the role definitions live in server/orpc; cross-entity schemas and helpers live in server/shared.
Key Files
prisma/schema.prisma: Defines your database schemaproxy.ts: Contains route protection logicnext.config.ts: Next.js configuration.env.example: Template for environment variables
Naming Conventions
Dirstarter follows these naming conventions:
- React Components: PascalCase (e.g.,
ToolCard.tsx) - Utility Functions: camelCase (e.g.,
formatDate.ts) - Server Actions: camelCase (e.g.,
createTool.ts) - Database Models: PascalCase in schema, camelCase in code
Next Steps
Now that you understand the project structure, explore these related topics:
Last updated on