Configuration

Detailed configuration options for your NestSaaS installation

This section covers the detailed configuration options for NestSaaS, helping you set up and customize your installation to meet your specific requirements.

Configuration Overview

NestSaaS is designed to be highly configurable while maintaining sensible defaults. Most configuration is done through:

  1. Environment variables (.env file)
  2. Configuration files in the config directory
  3. The admin interface

Essential Configuration

Environment Variables

The .env file contains critical configuration settings. Key variables include:

# Database
DATABASE_URL="postgresql://username:password@localhost:5432/nestsaas"
 
# Authentication
NEXTAUTH_SECRET="your-secret-key"
NEXTAUTH_URL="http://localhost:3000"
 
# Email
EMAIL_SERVER="smtp://username:password@smtp.example.com:587"
EMAIL_FROM="noreply@yourdomain.com"
 
# Storage
MEDIA_STORAGE_PROVIDER="local" # Options: local, S3, R2

Learn more about environment variables

Database Setup

NestSaaS uses Prisma ORM and supports PostgreSQL (recommended), MySQL, and SQLite.

# Run migrations
pnpm prisma migrate dev
 
# Seed the database
pnpm prisma db seed

Learn more about database configuration

Authentication

NestSaaS supports multiple authentication providers:

  • Email/Password
  • OAuth (Google, GitHub, etc.)
  • Magic Links

Configuration is done through NextAuth.js settings.

Learn more about authentication setup

Additional Configuration

Email

Configure email services for:

  • User notifications
  • Password resets
  • System alerts

Learn more about email configuration

Newsletter

Integrate with newsletter services like:

  • Mailchimp
  • ConvertKit
  • Custom solutions

Learn more about newsletter integration

Storage

Configure file storage for media uploads:

  • Local storage
  • Amazon S3
  • Cloudflare R2

Learn more about storage configuration

Payment Gateways

Set up payment processing with:

  • Stripe
  • PayPal
  • Other providers

Learn more about payment configuration

Analytics

Integrate analytics tools:

  • Google Analytics
  • Plausible
  • Fathom
  • Custom solutions

Learn more about analytics integration

Advanced Configuration

Custom Server Middleware

Add custom server middleware for specialized functionality.

API Customization

Extend the built-in API endpoints or create new ones.

Performance Optimization

Configure caching, CDN integration, and other performance enhancements.

Configuration Files

Key configuration files include:

  • config/site.ts - General site settings
  • config/spaces.ts - Space definitions
  • config/auth.ts - Authentication settings
  • config/blog.ts - Blog configuration

Next Steps

On this page