Folder Structure
Understand the feature-based layout of your Tanship project...
Ever get lost trying to find a specific file? We've designed Tanship's folder structure to prevent that. Everything is organized into intuitive, feature-based modules, so you can spend less time searching for code and more time building. Here's a high-level overview of the project layout:
...
├── content/
│ └── docs/
├── public/
├── scripts/
│ └── reset/
├── src/
│ ├── components/
│ ├── features/
│ │ ├── auth/
│ │ ├── database/
│ │ ├── docs/
│ │ └── storage/
│ ├── lib/
│ ├── routes/
│ └── styles/
├── drizzle.config.ts
├── source.config.ts
└── ... (other config files)Key Directories & Files
Root Level
content/docs: This is where all your markdown files for documentation live. It's set up to work with Fumadocs, allowing you to easily create beautiful docs for your users or team.public: A standard directory for static assets like images, fonts, and favicons. Anything placed here is served directly.scripts/reset: Contains a handy script for seeding your database and storage with test data. Perfect for quickly resetting your local environment during development.
Source Directory
This is the heart of your application code.
src/components: Holds all your reusable UI components (e.g.,SignIn,Form) that are shared across different pages and features.src/features: This is where the core modular logic lives. Each feature is designed to be self-contained.auth: Handles everything related to user authentication—sign-in/up pages, session management, password reset flows, and API routes.database: Contains your Drizzle ORM schema, migration files, and any database helper functions.docs: Contains components and logic specifically for rendering the documentation pages from thecontent/docsfolder.storage: Contains the logic for handling file uploads and interacting with your S3-compatible storage service.
src/lib: A library for your helper functions and utility code that can be used anywhere in the app (e.g., date formatting, string manipulation).src/routes: This is where TanStack's File-Based Routing works its magic. The folder and file structure here directly maps to the URL routes in your application.src/styles: Your global stylesheets, Tailwind CSS configuration, and any other styling-related files go here.
Config Files
drizzle.config.ts: The configuration file for Drizzle ORM. This tells Drizzle how to connect to your database for generating and running migrations.source.config.ts: The configuration file for Fumadocs, which powers your documentation pages.