Documentation

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:

queries.ts — Prisma reads
mutations.ts — Prisma writes
schema.ts — Zod input/output schemas
router.ts — oRPC procedures
router.ts — root oRPC router

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 schema
  • proxy.ts: Contains route protection logic
  • next.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

On this page

Join hundreds of directory builders

Build your directory, launch, earn

Don't waste time on Stripe subscriptions or designing a pricing section. Get started today with our battle-tested stack and built-in monetization features.

Get Lifetime Access