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.
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
- Prerequisites
- Getting Repository Access
- Local Development Setup
- Database Configuration
- Authentication Setup
- Payment Integration
- Email Configuration
- Two-Factor Authentication
- Internationalization (i18n)
- Customization Guide
- Deployment to Production
- 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
- Click the invitation link in your email
- Log into GitHub (or create an account)
- Accept the repository invitation
- 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
- Go to Google Cloud Console
- Create a new project or select existing
- Navigate to APIs & Services > Credentials
- Click Create Credentials > OAuth client ID
- Choose Web application
- Add Authorized redirect URIs:
http://localhost:3000/api/auth/callback/google(development)https://yourdomain.com/api/auth/callback/google(production)
- Copy Client ID and Secret
GOOGLE_CLIENT_ID="your-google-client-id"
GOOGLE_CLIENT_SECRET="your-google-client-secret"
GitHub OAuth
- Go to GitHub Developer Settings
- Click New OAuth App
- Fill in:
- Application name: Your SaaS Name
- Homepage URL:
http://localhost:3000 - Authorization callback URL:
http://localhost:3000/api/auth/callback/github
- 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
- Go to developer.paypal.com
- Log in with your PayPal Business account
- Navigate to Apps & Credentials
2. Create Sandbox App (Testing)
- Click Create App
- Select Merchant type
- Name it "YourSaaS Sandbox"
- 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)
- Switch to Live tab
- Create a new Live app
- 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)
- Create account at stripe.com
- Get API keys from Dashboard
- Configure webhooks
STRIPE_SECRET_KEY="sk_live_..."
NEXT_PUBLIC_STRIPE_PUBLISHABLE_KEY="pk_live_..."
STRIPE_WEBHOOK_SECRET="whsec_..."
Email Configuration
Using Resend (Recommended)
- Create account at resend.com
- Add and verify your domain
- 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
- User goes to Settings > Security
- Click Enable Two-Factor Authentication
- Scan QR code with authenticator app (Google Authenticator, Authy)
- Enter verification code
- 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
- Create translation file:
cp messages/en.json messages/de.json
-
Translate the content
-
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 logologo-dark.svg- Dark mode logofavicon.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
- Discord: Join our Discord
- GitHub Issues: Report bugs on the repository
Support
- Email: support@fastsaas.cloud
- Response time: Within 24 hours
Next Steps
After installation, explore these guides:
- Building Your First Feature
- PayPal Payment Integration
- Multi-Tenancy Architecture
- Email Queue System
Happy building! 🚀