Quickstart
Get started with the SaaS Boilerplate by installing it via CLI or manually, then setting up your local development environment.
Welcome to the SaaS Boilerplate! This guide will walk you through getting the project up and running on your local machine. Whether you're new to the project or looking to contribute, we'll cover two installation methods: using our CLI tool for a streamlined setup, or manually cloning the repository for more control. By the end, you'll have a fully functional application with a database, authentication, and built-in documentation.
Before You Begin
Ensure you have the following installed on your system:
- Node.js 22+: Required for running the application and its dependencies.
- Docker Desktop: Needed to run PostgreSQL locally for the database.
- Stripe Account (optional): Only if you plan to test billing and payment flows.
Installation
Choose your preferred method to get the SaaS Boilerplate code on your machine. The CLI method is recommended for new projects as it automates much of the initial setup.
The CLI tool simplifies the process by creating a new project directory, installing dependencies, and setting up initial configuration files.
Create a new project
Run the following command in your terminal:
npx saas-boilerplate@latest create my-saas-appReplace my-saas-app with your desired project name. This command will guide you through an interactive setup process.
Follow the CLI prompts
The CLI will ask you a series of questions to configure your project:
What is the name of your project? (Required)? my-app
Choose GitHub authentication method (HTTPS or SSH)? https, ssh
Choose your preferred package manager? npm, yarn, pnpm, bun
Do you want to configure Stripe for payments now? No / Yes
Configure Code Agents (LIA) now? No / Yes
Start the development server now? No / YesVerify Your Setup
To confirm everything is working:
- The app should be accessible at
http://localhost:3000. - Documentation is available at
http://localhost:3000/docs. - Your database is populated with initial tables; run
npm run db:studioto open Prisma Studio and inspect the data.
Troubleshooting
- Database connection issues: Ensure Docker Desktop is running and the
DATABASE_URLin.envmatches the PostgreSQL service indocker-compose.yml. - Missing environment variables: Double-check that you've copied
.env.exampleto.envand filled in all required keys. Next.js will show errors if critical variables are missing. - Stripe webhook errors: Re-run
npm run stripe:webhookand ensure you've set the webhook secret provided by Stripe CLI in your.envfile.