FullForge Complete Installation & Setup Guide
Comprehensive guide to install and configure FullForge - the complete SaaS suite with admin dashboard, multi-tenancy, AI integration, and enterprise features.
FullForge Complete Installation & Setup Guide
Welcome to FullForge! This is the complete SaaS suite that includes everything in SaaSForge and AIForge, plus a dedicated admin dashboard and enterprise features.
Table of Contents
- What's Included in FullForge
- Architecture Overview
- Prerequisites
- Monorepo Setup
- Application Configuration
- Admin Dashboard Setup
- User Dashboard Setup
- Multi-Tenancy Configuration
- Enterprise Features
- Deployment Strategy
- Maintenance & Operations
What's Included in FullForge {#whats-included}
FullForge is a Turborepo monorepo containing:
Applications
| App | Description | Port |
| ------------ | --------------------- | ---- |
| apps/admin | Admin dashboard | 3001 |
| apps/web | User-facing app | 3000 |
| apps/api | Shared API (optional) | 3002 |
Packages
| Package | Description |
| ------------------- | --------------------------- |
| packages/database | Prisma schema & client |
| packages/ui | Shared UI components |
| packages/auth | Authentication utilities |
| packages/email | Email templates & queue |
| packages/ai | AI/LLM integrations |
| packages/config | Shared configuration |
| packages/types | TypeScript type definitions |
Features
Everything in SaaSForge and AIForge PLUS:
- ā Dedicated Admin Dashboard
- ā User Management & Impersonation
- ā Organization Management
- ā Revenue Analytics
- ā Feature Flags System
- ā Audit Logs
- ā Email Campaign Manager
- ā Support Ticket System
- ā API Usage Dashboard
- ā Real-time Metrics
- ā Role-based Admin Access
- ā Bulk Actions
Architecture Overview {#architecture}
fullforge/
āāā apps/
ā āāā admin/ # Admin dashboard (Next.js)
ā ā āāā app/
ā ā āāā components/
ā ā āāā lib/
ā āāā web/ # User application (Next.js)
ā ā āāā app/
ā ā āāā components/
ā ā āāā lib/
ā āāā api/ # Optional shared API
āāā packages/
ā āāā database/ # Prisma schema
ā ā āāā prisma/
ā ā ā āāā schema.prisma
ā ā āāā src/
ā āāā ui/ # Shared components
ā ā āāā src/
ā āāā auth/ # Auth utilities
ā āāā email/ # Email system
ā āāā ai/ # AI integrations
ā āāā config/ # Shared config
ā āāā types/ # TypeScript types
āāā turbo.json # Turborepo config
āāā package.json # Root package.json
āāā docker-compose.yml
Prerequisites
Required Software
| Software | Version | Notes | | ---------- | ------- | ---------------------------- | | Node.js | 20.x | Required for Turborepo | | pnpm | 8.x+ | Package manager for monorepo | | PostgreSQL | 14+ | Database | | Redis | 6+ | Caching & queues | | Docker | Latest | For local development |
Install pnpm
# Install pnpm globally
npm install -g pnpm
# Or with corepack
corepack enable
corepack prepare pnpm@latest --activate
Monorepo Setup {#monorepo-setup}
Step 1: Clone Repository
# Clone the repository
git clone git@github.com:FastSaaSCloud/fullforge.git
cd fullforge
Step 2: Install Dependencies
# Install all dependencies across workspaces
pnpm install
This installs dependencies for:
- Root workspace
- All apps (admin, web)
- All packages
Step 3: Environment Configuration
Create .env files for each app:
# Root environment (shared)
cp .env.example .env
# Admin app
cp apps/admin/.env.example apps/admin/.env
# Web app
cp apps/web/.env.example apps/web/.env
Step 4: Shared Environment Variables
Edit root .env:
# ========================================
# SHARED DATABASE
# ========================================
DATABASE_URL="postgresql://fullforge:fullforge_password@localhost:5432/fullforge"
# ========================================
# REDIS
# ========================================
REDIS_URL="redis://localhost:6379"
# ========================================
# AI PROVIDERS (for AIForge features)
# ========================================
OPENAI_API_KEY="sk-..."
ANTHROPIC_API_KEY="sk-ant-..."
Step 5: App-Specific Environment
Edit apps/admin/.env:
NEXTAUTH_URL="http://localhost:3001"
NEXTAUTH_SECRET="admin-secret-key-32-chars-minimum"
NEXT_PUBLIC_APP_URL="http://localhost:3001"
ADMIN_EMAIL="admin@yourcompany.com"
Edit apps/web/.env:
NEXTAUTH_URL="http://localhost:3000"
NEXTAUTH_SECRET="web-secret-key-32-chars-minimum"
NEXT_PUBLIC_APP_URL="http://localhost:3000"
Step 6: Database Setup
# Generate Prisma client
pnpm db:generate
# Run migrations
pnpm db:migrate
# Seed admin user
pnpm db:seed
Step 7: Start Development
# Start all apps in parallel
pnpm dev
# Or start specific apps
pnpm dev --filter=admin
pnpm dev --filter=web
Access:
- Admin Dashboard: http://localhost:3001
- User App: http://localhost:3000
Application Configuration
Turborepo Configuration
turbo.json defines build pipelines:
{
"$schema": "https://turbo.build/schema.json",
"globalDependencies": [".env"],
"pipeline": {
"build": {
"dependsOn": ["^build"],
"outputs": [".next/**", "dist/**"]
},
"dev": {
"cache": false,
"persistent": true
},
"db:generate": {
"cache": false
}
}
}
Workspace Scripts
Root package.json scripts:
{
"scripts": {
"dev": "turbo run dev",
"build": "turbo run build",
"lint": "turbo run lint",
"db:generate": "turbo run db:generate",
"db:migrate": "pnpm --filter database migrate",
"db:seed": "pnpm --filter database seed",
"db:studio": "pnpm --filter database studio"
}
}
Admin Dashboard Setup {#admin-dashboard}
Default Admin Account
After seeding, login with:
Email: admin@fullforge.com
Password: Admin123!
ā ļø Change these immediately in production!
Admin Features
1. User Management
- View all users
- Edit user details
- Suspend/activate accounts
- Impersonate users
- Bulk actions
2. Organization Management
- View all organizations
- Manage subscriptions
- Usage statistics
- Member oversight
3. Analytics Dashboard
- Revenue metrics
- User growth
- Churn rate
- MRR/ARR tracking
4. Feature Flags
// packages/config/feature-flags.ts
export const featureFlags = {
newPricing: {
enabled: true,
rolloutPercentage: 50,
allowedOrgs: ["org_123"],
},
betaFeature: {
enabled: false,
},
};
5. Audit Logs
All admin actions are logged:
model AuditLog {
id String @id @default(cuid())
action String // "user.delete", "org.suspend"
actor String // Admin user ID
target String // Affected resource ID
metadata Json?
ipAddress String?
createdAt DateTime @default(now())
}
Admin Role Permissions
const ADMIN_ROLES = {
SUPER_ADMIN: [
"users.*",
"organizations.*",
"analytics.*",
"settings.*",
"billing.*",
],
SUPPORT_ADMIN: [
"users.view",
"users.impersonate",
"organizations.view",
"tickets.*",
],
BILLING_ADMIN: ["billing.*", "organizations.view", "analytics.revenue"],
};
User Dashboard Setup {#user-dashboard}
The user app (apps/web) includes:
Features
- User authentication (NextAuth)
- Dashboard with analytics
- Organization/team management
- AI chat interface
- Settings & preferences
- Billing portal
Customizing User App
# Navigate to web app
cd apps/web
# Structure
app/
āāā (auth)/ # Auth pages
āāā (dashboard)/ # Protected dashboard
āāā (marketing)/ # Public pages
āāā api/ # API routes
Multi-Tenancy Configuration {#multi-tenancy}
Organization-Based Tenancy
model Organization {
id String @id @default(cuid())
name String
slug String @unique
plan Plan @default(FREE)
members OrganizationMember[]
invitations Invitation[]
// Tenant-specific data
projects Project[]
documents Document[]
apiKeys ApiKey[]
}
Data Isolation
All queries are scoped to organization:
// middleware/organization.ts
export async function withOrganization(req, handler) {
const org = await getCurrentOrganization(req);
if (!org) {
return redirect("/select-organization");
}
// Inject org into context
req.organization = org;
return handler(req);
}
// In API routes
const projects = await prisma.project.findMany({
where: {
organizationId: req.organization.id, // Always scoped!
},
});
Enterprise Features {#enterprise-features}
SSO Integration
# SAML SSO
SAML_ENTRY_POINT="https://idp.example.com/sso"
SAML_ISSUER="your-app-entity-id"
SAML_CERT="-----BEGIN CERTIFICATE-----..."
Custom Domains
// Per-organization custom domains
model OrganizationDomain {
id String @id
domain String @unique
verified Boolean @default(false)
organizationId String
organization Organization @relation(...)
}
SLA & Priority Support
const SLA_RESPONSE_TIMES = {
ENTERPRISE: { critical: "1h", high: "4h", normal: "24h" },
PRO: { critical: "4h", high: "24h", normal: "72h" },
FREE: { critical: "72h", high: "72h", normal: "168h" },
};
Deployment Strategy {#deployment}
Option 1: Single VPS (Combined)
Deploy both apps on one server:
# Build all apps
pnpm build
# Start with PM2
pm2 start ecosystem.config.js
ecosystem.config.js:
module.exports = {
apps: [
{
name: "fullforge-web",
cwd: "./apps/web",
script: "npm",
args: "start",
env: { PORT: 3000 },
},
{
name: "fullforge-admin",
cwd: "./apps/admin",
script: "npm",
args: "start",
env: { PORT: 3001 },
},
],
};
Option 2: Separate Servers
For better security, deploy admin on separate server:
Production Setup:
āāā app.yourdomain.com ā Web app (Port 3000)
āāā admin.yourdomain.com ā Admin (Port 3001, IP restricted)
āāā api.yourdomain.com ā Shared API (Optional)
Option 3: Docker Compose
# docker-compose.prod.yml
version: "3.8"
services:
web:
build:
context: .
dockerfile: apps/web/Dockerfile
ports:
- "3000:3000"
environment:
- DATABASE_URL=${DATABASE_URL}
admin:
build:
context: .
dockerfile: apps/admin/Dockerfile
ports:
- "3001:3001"
environment:
- DATABASE_URL=${DATABASE_URL}
postgres:
image: postgres:15
volumes:
- postgres_data:/var/lib/postgresql/data
redis:
image: redis:7
volumes:
- redis_data:/data
Nginx Configuration
# Web app
server {
server_name app.yourdomain.com;
location / {
proxy_pass http://localhost:3000;
proxy_http_version 1.1;
}
}
# Admin (with IP restriction)
server {
server_name admin.yourdomain.com;
# Restrict to office IPs
allow 1.2.3.4;
allow 5.6.7.8;
deny all;
location / {
proxy_pass http://localhost:3001;
}
}
Maintenance & Operations {#maintenance}
Database Backups
# Automated backup script
#!/bin/bash
BACKUP_DIR="/backups/fullforge"
DATE=$(date +%Y%m%d_%H%M%S)
pg_dump $DATABASE_URL > $BACKUP_DIR/fullforge_$DATE.sql
gzip $BACKUP_DIR/fullforge_$DATE.sql
# Keep last 30 days
find $BACKUP_DIR -mtime +30 -delete
Monitoring
# Health check endpoint
curl https://app.yourdomain.com/api/health
curl https://admin.yourdomain.com/api/health
Updates
# Pull latest changes
git pull origin main
# Install any new dependencies
pnpm install
# Run migrations
pnpm db:migrate
# Rebuild
pnpm build
# Restart
pm2 restart all
Getting Help
- Documentation: https://fastsaas.cloud/docs
- Discord: Community support
- Email: support@fastsaas.cloud
- Priority Support: Enterprise customers
Next Steps
Happy building! š