SaaSForge Complete Installation & Setup Guide

Comprehensive step-by-step guide to install, configure, and deploy your SaaSForge boilerplate after purchase. Includes authentication, payments, database, and deployment.

December 27, 2024
8 min read
By FastSaaS Team

SaaSForge Complete Installation & Setup Guide

Congratulations on purchasing SaaSForge! This comprehensive guide will walk you through every step to get your SaaS application up and running.

Table of Contents

  1. Prerequisites
  2. Getting Repository Access
  3. Local Development Setup
  4. Database Configuration
  5. Authentication Setup
  6. Payment Integration
  7. Email Configuration
  8. Two-Factor Authentication
  9. Internationalization (i18n)
  10. Customization Guide
  11. Deployment to Production
  12. Post-Deployment Checklist

Prerequisites

Before starting, ensure you have:

Required Software

| Software | Version | Download | | ----------- | ------------ | ------------------------------------------------------ | | Node.js | 18.x or 20.x | nodejs.org | | npm or pnpm | Latest | Comes with Node.js | | Git | Latest | git-scm.com | | PostgreSQL | 14+ | postgresql.org | | VS Code | Latest | code.visualstudio.com |

Recommended VS Code Extensions

- Prisma
- ESLint
- Prettier
- Tailwind CSS IntelliSense
- Thunder Client (API testing)

Optional (but recommended)

  • Docker Desktop for containerized development
  • Redis for email queues and caching
  • GitHub account for OAuth and repository access

Getting Repository Access

After your purchase is confirmed:

Step 1: Check Your Email

You will receive an email with:

  • GitHub repository invitation link
  • Your license key
  • Download links for documentation

Step 2: Accept GitHub Invitation

  1. Click the invitation link in your email
  2. Log into GitHub (or create an account)
  3. Accept the repository invitation
  4. You now have access to the private SaaSForge repository

Step 3: Clone the Repository

# Clone via HTTPS
git clone https://github.com/FastSaaSCloud/saasforge.git

# OR clone via SSH (recommended)
git clone git@github.com:FastSaaSCloud/saasforge.git

# Navigate to the project
cd saasforge

Local Development Setup

Step 1: Install Dependencies

# Using npm
npm install

# OR using pnpm (faster)
pnpm install

Step 2: Environment Configuration

Copy the example environment file:

cp .env.example .env

Step 3: Configure Environment Variables

Open .env and configure these essential variables:

# ========================================
# DATABASE
# ========================================
DATABASE_URL="postgresql://username:password@localhost:5432/saasforge"

# ========================================
# AUTHENTICATION
# ========================================
NEXTAUTH_URL="http://localhost:3000"
NEXTAUTH_SECRET="generate-with-openssl-rand-base64-32"

# ========================================
# APPLICATION
# ========================================
NEXT_PUBLIC_APP_URL="http://localhost:3000"
NEXT_PUBLIC_APP_NAME="Your SaaS Name"

Generate Secure Secret

# Generate NEXTAUTH_SECRET
openssl rand -base64 32

Step 4: Database Setup

# Generate Prisma Client
npx prisma generate

# Run migrations
npx prisma migrate dev --name init

# (Optional) Seed sample data
npx prisma db seed

Step 5: Start Development Server

npm run dev

🎉 Your application is now running at http://localhost:3000


Database Configuration

Option 1: Local PostgreSQL

Install PostgreSQL locally and create a database:

-- Connect to PostgreSQL
psql -U postgres

-- Create database
CREATE DATABASE saasforge;

-- Create user (optional)
CREATE USER saasuser WITH PASSWORD 'your_password';
GRANT ALL PRIVILEGES ON DATABASE saasforge TO saasuser;

Update your .env:

DATABASE_URL="postgresql://saasuser:your_password@localhost:5432/saasforge"

Option 2: Docker PostgreSQL

# Start PostgreSQL with Docker
docker run --name saasforge-db \
  -e POSTGRES_DB=saasforge \
  -e POSTGRES_USER=saasforge \
  -e POSTGRES_PASSWORD=saasforge_secret \
  -p 5432:5432 \
  -d postgres:15

# Your DATABASE_URL
DATABASE_URL="postgresql://saasforge:saasforge_secret@localhost:5432/saasforge"

Option 3: Docker Compose (Recommended)

Use the included docker-compose.yml:

docker-compose up -d

This starts PostgreSQL and Redis automatically.

Database Management

# View database in browser
npx prisma studio

# Reset database
npx prisma migrate reset

# Create new migration
npx prisma migrate dev --name your_migration_name

Authentication Setup

SaaSForge includes NextAuth.js v5 with multiple providers.

Email/Password Authentication

Enabled by default. Users can:

  • Register with email/password
  • Login with email/password
  • Reset password via email
  • Verify email address

OAuth Providers

Google OAuth

  1. Go to Google Cloud Console
  2. Create a new project or select existing
  3. Navigate to APIs & Services > Credentials
  4. Click Create Credentials > OAuth client ID
  5. Choose Web application
  6. Add Authorized redirect URIs:
    • http://localhost:3000/api/auth/callback/google (development)
    • https://yourdomain.com/api/auth/callback/google (production)
  7. Copy Client ID and Secret
GOOGLE_CLIENT_ID="your-google-client-id"
GOOGLE_CLIENT_SECRET="your-google-client-secret"

GitHub OAuth

  1. Go to GitHub Developer Settings
  2. Click New OAuth App
  3. Fill in:
    • Application name: Your SaaS Name
    • Homepage URL: http://localhost:3000
    • Authorization callback URL: http://localhost:3000/api/auth/callback/github
  4. Copy Client ID and generate Client Secret
GITHUB_ID="your-github-client-id"
GITHUB_SECRET="your-github-client-secret"

Payment Integration

PayPal Setup

1. Create PayPal Developer Account

  1. Go to developer.paypal.com
  2. Log in with your PayPal Business account
  3. Navigate to Apps & Credentials

2. Create Sandbox App (Testing)

  1. Click Create App
  2. Select Merchant type
  3. Name it "YourSaaS Sandbox"
  4. Copy Client ID and Secret
# Sandbox (Testing)
NEXT_PUBLIC_PAYPAL_CLIENT_ID="sandbox-client-id"
PAYPAL_CLIENT_SECRET="sandbox-secret"
PAYPAL_MODE="sandbox"

3. Create Live App (Production)

  1. Switch to Live tab
  2. Create a new Live app
  3. Copy Client ID and Secret
# Live (Production)
NEXT_PUBLIC_PAYPAL_CLIENT_ID="live-client-id"
PAYPAL_CLIENT_SECRET="live-secret"
PAYPAL_MODE="live"

Stripe Setup (Optional)

  1. Create account at stripe.com
  2. Get API keys from Dashboard
  3. Configure webhooks
STRIPE_SECRET_KEY="sk_live_..."
NEXT_PUBLIC_STRIPE_PUBLISHABLE_KEY="pk_live_..."
STRIPE_WEBHOOK_SECRET="whsec_..."

Email Configuration

Using Resend (Recommended)

  1. Create account at resend.com
  2. Add and verify your domain
  3. Get API key
RESEND_API_KEY="re_..."

Email Templates

SaaSForge includes templates for:

  • Welcome emails
  • Password reset
  • Email verification
  • Purchase confirmation
  • Team invitations

Templates are in /lib/email/templates/.

Email Queue (BullMQ + Redis)

For production, enable the email queue:

REDIS_URL="redis://localhost:6379"

Two-Factor Authentication

SaaSForge includes TOTP-based 2FA.

Enable 2FA for Users

  1. User goes to Settings > Security
  2. Click Enable Two-Factor Authentication
  3. Scan QR code with authenticator app (Google Authenticator, Authy)
  4. Enter verification code
  5. Save backup codes securely

Configuration

2FA is enabled by default. To customize:

// lib/auth/two-factor.ts
export const TWO_FACTOR_CONFIG = {
  issuer: "Your SaaS Name",
  algorithm: "SHA1",
  digits: 6,
  period: 30,
};

Internationalization (i18n)

SaaSForge includes next-intl with 3 languages.

Supported Languages

  • English (en) - Default
  • Spanish (es)
  • French (fr)

Translation Files

Located in /messages/:

messages/
├── en.json
├── es.json
└── fr.json

Adding a New Language

  1. Create translation file:
cp messages/en.json messages/de.json
  1. Translate the content

  2. Update locale config:

// i18n.config.ts
export const locales = ["en", "es", "fr", "de"] as const;

Customization Guide

Branding

Logo

Replace files in /public/:

  • logo.svg - Main logo
  • logo-dark.svg - Dark mode logo
  • favicon.ico - Favicon

Colors

Edit tailwind.config.ts:

theme: {
  extend: {
    colors: {
      primary: {
        50: '#your-color',
        // ... 100-900
      },
    },
  },
},

Fonts

Update in /app/layout.tsx:

import { Inter } from "next/font/google";
// Change to your preferred font

Landing Page

Edit /app/page.tsx and components in /components/landing/:

  • Hero section
  • Features
  • Pricing
  • Testimonials
  • FAQ

Dashboard

Customize /app/dashboard/ layouts and components.


Deployment to Production

Option 1: VPS (Recommended for Control)

1. Server Requirements

  • Ubuntu 22.04 LTS
  • 2GB+ RAM
  • 25GB+ SSD

2. Install Dependencies

# Update system
sudo apt update && sudo apt upgrade -y

# Install Node.js 20
curl -fsSL https://deb.nodesource.com/setup_20.x | sudo -E bash -
sudo apt install -y nodejs

# Install PM2
sudo npm install -g pm2

# Install Nginx
sudo apt install nginx -y

# Install PostgreSQL
sudo apt install postgresql postgresql-contrib -y

3. Deploy Application

# Clone repository
git clone git@github.com:FastSaaSCloud/saasforge.git /var/www/saasforge
cd /var/www/saasforge

# Install dependencies
npm install --production

# Build application
npm run build

# Start with PM2
pm2 start npm --name "saasforge" -- start
pm2 startup
pm2 save

4. Configure Nginx

# /etc/nginx/sites-available/saasforge
server {
    listen 80;
    server_name yourdomain.com;

    location / {
        proxy_pass http://localhost:3000;
        proxy_http_version 1.1;
        proxy_set_header Upgrade $http_upgrade;
        proxy_set_header Connection 'upgrade';
        proxy_set_header Host $host;
        proxy_cache_bypass $http_upgrade;
    }
}

5. SSL with Certbot

sudo apt install certbot python3-certbot-nginx -y
sudo certbot --nginx -d yourdomain.com

Option 2: Vercel (Easiest)

npm install -g vercel
vercel

Option 3: Docker

docker build -t saasforge .
docker run -p 3000:3000 saasforge

Post-Deployment Checklist

Security

  • [ ] Generate unique NEXTAUTH_SECRET
  • [ ] Enable HTTPS/SSL
  • [ ] Set secure cookie options
  • [ ] Enable rate limiting
  • [ ] Configure CORS properly

Performance

  • [ ] Enable caching with Redis
  • [ ] Set up CDN (Cloudflare)
  • [ ] Optimize images
  • [ ] Enable gzip compression

Monitoring

  • [ ] Set up error tracking (Sentry)
  • [ ] Configure health checks
  • [ ] Set up uptime monitoring
  • [ ] Enable logging

Backups

  • [ ] Configure database backups
  • [ ] Test backup restoration
  • [ ] Document recovery procedures

Getting Help

Documentation

  • Full docs: https://fastsaas.cloud/docs
  • API Reference: https://fastsaas.cloud/docs (Swagger tab)

Community

Support

  • Email: support@fastsaas.cloud
  • Response time: Within 24 hours

Next Steps

After installation, explore these guides:

  1. Building Your First Feature
  2. PayPal Payment Integration
  3. Multi-Tenancy Architecture
  4. Email Queue System

Happy building! 🚀