Getting Started

Configuration

Learn how to configure your application using the configuration files.

The Pro Next.js Drizzle starter kit uses a modular configuration system that allows you to customize your application to your needs. Configuration is split into separate files in the config/ directory, making it easy to manage different aspects of your application.

Configuration Structure

Configuration files are located in the config/ directory:

Project Structure
config/
├── app.config.ts      # App-wide settings (name, themes, site sections)
├── auth.config.ts     # Authentication settings (redirects, CORS, signup)
├── billing.config.ts  # Billing and plans configuration
└── storage.config.ts  # Storage bucket configuration

Using Configuration

Configuration objects are exported from each file and can be imported where needed:

lib/utils.ts
import { appConfig } from '@/config/app.config';

export function getAppName() {
  return appConfig.appName;
}

Configuration Principles

Type Safety

All configuration objects use TypeScript's satisfies keyword to ensure type safety while preserving literal types. This gives you autocomplete and type checking.

Environment Variables

Configuration files can read from environment variables using the env object from @/lib/env. This keeps sensitive values out of your code.

Modular Design

Each configuration file focuses on a specific domain (app, auth, billing, storage), making it easy to find and modify settings.

Default Values

Configuration files provide sensible defaults, but you can override them to match your needs.

Common Use Cases

Disable Marketing Site

If you want to deploy only the SaaS application without the marketing site:

config/app.config.ts
export const appConfig = {
  // ... other config
  site: {
    marketing: {
      enabled: false // Disables marketing routes
    },
    saas: {
      enabled: true
    }
  }
};

Disable SaaS Application

If you want to deploy only the marketing site:

config/app.config.ts
export const appConfig = {
  // ... other config
  site: {
    marketing: {
      enabled: true
    },
    saas: {
      enabled: false // Disables SaaS routes
    }
  }
};

Invitation-Only Signup

To restrict signups to invitation-only:

config/auth.config.ts
export const authConfig = {
  // ... other config
  enableSignup: false // Only invited users can sign up
};

Restrict Organization Creation

To allow only admins to create organizations:

config/app.config.ts
export const appConfig = {
  // ... other config
  organizations: {
    allowUserCreation: false // Only admins can create organizations
  }
};

Next Steps

Explore the individual configuration files to learn more about each area: