Quickstart
Clone, configure, and run the app locally.
Quickstart
1) Clone the repo
git clone https://github.com/saasblueprint/saas-blueprint.git
cd saasblueprint
2) Install dependencies
npm install
3) Run database migrations (local)
npm run db:migrate:local
4) Configure Stripe + CLI (sandbox)
- Create a Stripe sandbox in your stripe account.
- Add at least one product and price.
- Enable customer emails on successful payments (optional, but highly recommended)
- In another terminal, run:
stripe login
npm run stripe-cli --workspace workers/app
Note the webhook secret for the next step.
5) Configure environment variables
Create workers/app/.env.local by copying env.example and adding the following information.
BETTER_AUTH_SECRET=super-secret
BETTER_AUTH_URL=http://localhost:3000
NEXT_PUBLIC_STRIPE_PUBLISHABLE_KEY=pk_test_...
STRIPE_SECRET_KEY=sk_test_...
STRIPE_WEBHOOK_SECRET=whsec_...
MAILGUN_API_KEY=...
MAILGUN_DOMAIN=...
The Mailgun secrets can be omitted initially if you are using a different provider. Just note that notifications like welcome, reset password etc will silently fail.
Tip
Cloudflare recommends *.dev.vars, but Next.js does not.
Use .env files for build-time variables and access them via process.env.
See the OpenNext documentation.
6) Run the app
npm run dev --workspace workers/app
What "working" looks like
- Marketing pages load (home, pricing, docs).
- You can sign up, sign in, and reach the dashboard.
- Checkout loads with Stripe Elements (test cards).
Next Steps
It’s usually best to start with a clean Git history while still keeping the original code around for reference. You can do this by resetting the repository and preserving the existing work in a separate branch.
From inside your repo and starting with your main brain - the one you cloned from SaaS Blueprint:
git branch -m saasblueprint
git checkout --orphan main
git commit -a -m 'Initial commit'
This preserves the starting code in a branch named saasblueprint and creates a new main branch with a single commit.