Project Structure
Overview of the TanStarter template file and folder organization
TanStarter follows a modular architecture based on TanStack Router with file-based routing, focusing on scalability and maintainability.
Root Directory Structure
Key Files
vite.config.ts: Vite configuration with TanStack Start, Cloudflare, Tailwind CSS, and Content Collections pluginswrangler.jsonc: Cloudflare Workers configuration including D1 database and R2 storage bindingscontent-collections.ts: Content Collections configuration for blog, legal pages, and changelogdrizzle.config.ts: Drizzle ORM configuration for the databasebiome.json: Biome linter and formatter configuration.env.example: Template for environment variables
Key Directories
/src/api Directory
Server-side API logic organized by feature:
/src/lib Directory
Core application logic and utilities:
/src/routes Directory
The routes directory follows TanStack Router file-based routing convention:
/src/components Directory
Components are organized by feature and purpose for better maintainability:
Shared Components
Shared components are reusable across the application and organized in dedicated directories:
Feature Components
The components directory is organized by feature, making it easy to locate and maintain components related to specific features like authentication, blog, dashboard, etc.
Next Steps
Now that you understand the project structure, explore these related topics:
TanStarter Docs