This page sets up the open-source repository. If you downloaded a boilerplate, follow Download a Boilerplate instead; the steps after unzipping are the same.
1. Clone and install
git clone https://github.com/anoopkarnik/saas-forge.git my-saas
cd my-saas
corepack enable # uses the pnpm version pinned in package.json
pnpm install
On Linux, pnpm sometimes skips Electron's binary download. If the desktop app later fails with "Electron failed to install correctly", run:
node node_modules/electron/install.js
2. Configure the environment
pnpm doctor
The doctor creates apps/web/.env from apps/web/.env.example, asks for each missing value, generates BETTER_AUTH_SECRET, checks every configured service with a live call, and writes packages/database/.env plus the desktop and mobile env files. Values you skip can be added later. See Setup Doctor.
Prefer to do it by hand?
cp apps/web/.env.example apps/web/.env
cp packages/database/.env.example packages/database/.env
cp apps/desktop/.env.example apps/desktop/.env # optional
cp apps/mobile/.env.example apps/mobile/.env # optional
At minimum, set NEXT_PUBLIC_SAAS_NAME, NEXT_PUBLIC_URL, DATABASE_URL (in both apps/web/.env and packages/database/.env) and BETTER_AUTH_SECRET (openssl rand -base64 32). With NEXT_PUBLIC_AUTH_EMAIL=true you also need NEXT_PUBLIC_EMAIL_CLIENT=resend, RESEND_API_KEY and NEXT_PUBLIC_SUPPORT_MAIL, or set NEXT_PUBLIC_AUTH_EMAIL=false while you get started.
3. Set up the database
The doctor offers to run these for you when the database is empty:
pnpm generate # generates the Prisma client
pnpm migrate # applies migrations to the DATABASE_URL in packages/database/.env
pnpm seed # loads landing content, these docs, AI prompts and the demo guest user
pnpm seed reads NEXT_PUBLIC_SAAS_NAME from apps/web/.env and stores the landing page under that name. The app looks content up by the same name, so seed again if you rename the product.
No hosted database yet? Start one locally:
# Compose reads secrets from a .env file next to docker-compose.yml, even for one service
printf 'BETTER_AUTH_SECRET=%s\nBACKEND_HMAC_SECRET=%s\n' "$(openssl rand -base64 32)" "$(openssl rand -hex 32)" > .env
docker compose up -d postgres redis
# DATABASE_URL="postgresql://postgres:postgres@localhost:5433/saas_forge"
4. Start the apps
pnpm dev
This starts every app through Turborepo. To run only the web app:
pnpm --dir apps/web dev
Open http://localhost:3000 and sign up. The first account becomes the admin. See Local Development for ports, the demo account and day-to-day commands.
5. Make it yours
- Set your name, description, theme and logos: Branding & Themes.
- Replace the landing content and these docs: Content Management.
- Remove what you do not need, such as the root-only download platform: Project Structure.
- Build your first feature: Adding a Feature.
