SaaS Forge is a pnpm workspace. Every app and package is a workspace, and Turborepo runs tasks across them.
Repository layout
saas-forge/
├── apps/
│ ├── web/ Next.js app: UI, tRPC API, REST routes, webhooks
│ ├── desktop/ Electron app
│ ├── mobile/ Expo app
│ └── backend/ FastAPI AI service (AI Agents module)
├── packages/
│ ├── ai/ AI SDK provider resolution, tools, token metering
│ ├── auth/ Better Auth server and clients, API key helpers
│ ├── database/ Prisma schema, client, seed script, docs MDX
│ ├── email/ Resend senders and React Email templates
│ ├── observability/ Winston logger, AI logger, signed fetch to the backend
│ ├── ui/ Shared components, blocks, providers, styles
│ ├── eslint-config/ Shared ESLint config
│ ├── typescript-config/ Shared tsconfig presets
│ └── create-saas-forge/ The CLI (open-source repo only)
├── scripts/ doctor, template sync, matrix, release tooling
├── scaffold-modules/ Module registry and manifests (open-source repo only)
├── scaffold-providers/ Provider registry and manifests (open-source repo only)
├── templates/ Managed starter source (open-source repo only)
├── template-overrides/ Starter-only differences (open-source repo only)
├── docker-compose.yml Local Postgres, Redis, web and backend
├── Dockerfile.web Production image for the web app
└── turbo.json Task pipeline
Inside apps/web
apps/web/
├── app/
│ ├── (auth)/ sign-in, sign-up, forgot/reset password, email verified, error
│ ├── (home)/ signed-in app: your product, admin, organization, AI, projects
│ ├── landing/ public pages: landing, doc/[slug], legal/*
│ ├── api/ REST routes, Better Auth handler, webhooks, tRPC handler
│ ├── sitemap.ts, robots.ts
│ └── layout.tsx theme, analytics, support widget, toaster
├── blocks/ page-level client components (landing, admin, docs, support)
├── components/ feature components (landing sections, admin tables, AI, orgs)
├── lib/ services and helpers: env validation, route policy, SEO, CMS
├── server/ server-only helpers: routeGuard, rate limits, Redis, uploads
├── trpc/ init (procedures), routers, client and server helpers
├── tests/ integration tests (route policy, doctor)
├── middleware.ts page gating and body-size limits from the route policy
└── instrumentation.ts boot-time env validation
Workspace imports
Packages are imported with the @workspace/ prefix, and app-local code in apps/web with @/:
import { auth } from "@workspace/auth/better-auth/auth";
import db from "@workspace/database/client";
import { Button } from "@workspace/ui/components/shadcn/button";
import { useTRPC } from "@/trpc/client";
What a downloaded project contains
A download is the same tree with these differences:
- No root-only tooling: no
create-saas-forge,scaffold-modules/,scaffold-providers/,templates/,template-overrides/, the download API or the project dashboard. - Only the platforms you chose:
apps/desktopandapps/mobileare removed when unselected. - Only the modules you chose: their routes, routers, components, Prisma files and migrations are gone, and code shared with other features has its module sections removed.
apps/web/app/(home)/page.tsxis an empty page where your product starts.SETUP.md,.boilerplate-versionand filled.envfiles are added at the root.
See Download a Boilerplate for the full list.
