Project Structure
Understand the folder organization and architecture of LaunchSaaS
Project Structure
LaunchSaaS follows Next.js App Router conventions with a well-organized structure for scalability and maintainability.
Root Directory
.
├── src/ # Application source code
├── content/ # MDX content (blog, docs, changelog)
├── public/ # Static assets
├── scripts/ # Utility scripts
├── drizzle/ # Database migrations
├── .env # Environment variables (not in git)
├── package.json # Dependencies and scripts
└── next.config.mjs # Next.js configurationSource Directory
App Router (src/app/)
src/app/
├── layout.tsx # Root layout
├── page.tsx # Homepage
├── globals.css # Global styles
│
├── (marketing)/ # Public marketing pages
│ ├── layout.tsx # Marketing layout with header/footer
│ ├── blog/ # Blog pages
│ ├── pricing/ # Pricing page
│ └── ... # Other marketing pages
│
├── (protected)/ # Protected routes (require auth)
│ ├── layout.tsx # Shared layout with sidebar
│ ├── loading.tsx # Loading skeleton
│ ├── dashboard/ # User dashboard
│ └── admin/ # Admin panel
│
├── auth/[path]/ # Authentication pages
├── docs/ # Documentation site
└── api/ # API routesRoute Groups
(marketing)/- Public pages with marketing layout (header, footer)(protected)/- Authenticated pages with shared sidebar layout
Components (src/components/)
src/components/
├── ui/ # Base UI components (shadcn/ui)
├── layout/ # Layout components
│ ├── site-header.tsx # Marketing header with nested nav
│ ├── site-footer.tsx # Marketing footer
│ ├── app-sidebar.tsx # Dashboard/Admin sidebar
│ ├── user-menu-button.tsx # User dropdown with role-based menu
│ ├── dynamic-breadcrumb.tsx # Auto-generated breadcrumb
│ └── ...
├── landing/ # Landing page sections
├── blog/ # Blog components
├── shared/ # Shared components
└── email-templates/ # Email templatesServer Actions (src/actions/)
Type-safe server actions organized by domain:
src/actions/
├── billing.ts # Payment and subscription actions
├── newsletter.ts # Newsletter subscription actions
├── storage.ts # File storage actions
└── user.ts # User management actionsConfiguration (src/configuration/)
Modular configuration files for easy customization:
src/configuration/
├── index.ts # Central exports
├── metadata.ts # Site name, title, description, SEO
├── navbar.ts # Navigation bar items and actions
├── sidebar.ts # Dashboard/Admin sidebar (role-based)
├── user-button.tsx # User dropdown menu (role-based)
├── fotoer.ts # Footer links and badges
├── social-links.ts # Social media links
└── product.ts # Pricing and product configurationLibraries (src/lib/)
Core utilities and integrations:
src/lib/
├── db.ts # Database client
├── auth/ # Better Auth configuration
├── stripe.ts # Stripe client
├── email.ts # Email sending
├── safe-action.ts # Type-safe server actions
├── session.ts # Session helpers
└── ... # Other utilitiesSchemas (src/schemas/)
src/schemas/
├── site-configuration.ts # Configuration type definitions
├── tables/ # Database table definitions
│ ├── auth.ts # Auth tables (auto-generated)
│ ├── payment.ts # Payment tables
│ └── index.ts # Re-exports
└── ... # Zod validation schemasEnvironment (src/env/)
src/env/
├── server.ts # Server-only environment variables
└── client.ts # Client-safe environment variablesContent Directory
content/
├── blog/ # Blog posts (MDX)
├── docs/ # Documentation (MDX)
└── changelog/ # Changelog entries (MDX)Key Files
| File | Description |
|---|---|
src/configuration/metadata.ts | Site name, title, description, logo |
src/configuration/navbar.ts | Navigation with nested menus |
src/configuration/sidebar.ts | Role-based sidebar for dashboard/admin |
src/configuration/product.ts | Pricing plans and products |
src/lib/auth/auth.ts | Better Auth configuration |
src/app/globals.css | Theme colors and global styles |
content/docs/meta.json | Documentation sidebar order |