dev-tools 5 min read

Open SaaS v2 – Free Open-Source SaaS Boilerplate

Ship your SaaS in days, not months. Open SaaS v2 is a free, open-source boilerplate with authentication, payments, emails, and AI integrations ready to go.

By
Share: X in
Open SaaS v2 product banner

TL;DR

TL;DR: Open SaaS v2 is a free, open-source boilerplate that ships a production-ready SaaS with authentication, payments, emails, and AI integrations already wired up — deploy to Railway, Render, or Fly.io in minutes.

Source and Accuracy Notes

What Is Open SaaS?

Open SaaS v2 is an open-source SaaS starter kit built for developers who want to ship fast without reinventing the wheel. It bundles the most common SaaS features — user auth, Stripe payments, transactional email, and AI agent integration — into a single, deployable codebase.

Unlike commercial boilerplates that charge per seat or flat monthly fees, Open SaaS is completely free and MIT-licensed. The v2 release brought a rebuilt frontend, better AI agent integration, and one-command deploy targets.

Setup Workflow

Step 1: Clone and Install

git clone https://github.com/your-repo/opensaas-v2
cd opensaas-v2
npm install

Step 2: Configure Environment Variables

Copy the example env file and fill in your keys:

cp .env.example .env

Required variables typically include:

  • DATABASE_URL — PostgreSQL connection string
  • STRIPE_SECRET_KEY — Stripe API key
  • SENDGRID_API_KEY — Transactional email provider
  • OPENAI_API_KEY — For AI features

Step 3: Set Up the Database

npx prisma db push
npx prisma db seed

This runs Prisma migrations and seeds initial data.

Step 4: Deploy

Railway (recommended for zero-config deploy):

railway login
railway init
railway up

Render:

Connect your GitHub repo to Render, set the build command to npm run build, and start command to npm start.

Fly.io:

fly launch
fly deploy

Deeper Analysis

What’s Included Out of the Box

Authentication — Email/password and OAuth (Google, GitHub) via NextAuth.js or equivalent. Role-based access control for admin vs. regular users.

Payments — Stripe integration with subscription tiers, webhooks for managing billing events, and dunning logic for failed payments.

Email — Transactional emails via SendGrid or Resend. Templates for welcome emails, password resets, and billing receipts.

AI Agent Integration — A structured way to connect AI agents to your app’s data and workflows. The v2 release expanded support for multiple AI providers.

Admin Dashboard — User management, billing overview, and basic analytics built-in.

Design and UX

Open SaaS ships with a clean, modern UI. The frontend is scaffolded with Tailwind CSS, making customization straightforward. The default theme is professional without being generic — suitable for B2B or B2C products.

Deployment Flexibility

One of the strongest points of Open SaaS is deployment flexibility. It targets standard Node.js hosting ( Railway, Render, Fly.io, DigitalOcean App Platform) rather than requiring a specific platform. This avoids vendor lock-in and keeps hosting costs predictable.

Practical Evaluation Checklist

  • [ ] Cloned and ran locally without errors
  • [ ] Authentication flow works (sign up, login, OAuth, logout)
  • [ ] Stripe payment flow tested (checkout, webhook, cancellation)
  • [ ] Email templates render correctly
  • [ ] AI agent integration responds to queries
  • [ ] Admin dashboard shows user and billing data
  • [ ] Deployed to a live host successfully
  • [ ] Environment variables properly secured (not committed)
  • [ ] Build size is reasonable (check bundle analyzer output)
  • [ ] Database migrations run cleanly in production

Security Notes

  • Environment variables — Never commit .env files. Use your hosting platform’s secret management.
  • Stripe webhooks — Validate the Stripe signature on webhook handlers to prevent spoofed billing events.
  • OAuth — Ensure redirect URIs are restricted to your domain in the OAuth app settings.
  • Database — Use a strong connection string and enable SSL for production database connections.
  • Rate limiting — Implement rate limiting on auth endpoints to prevent brute-force attacks.

FAQ

Q: Is this actually free to use commercially? A: Yes. Open SaaS v2 uses the MIT license. You can use it for commercial products without paying royalties or license fees.

Q: Does it work without Stripe? A: Yes. Stripe is optional. The boilerplate includes a “free tier” mode where you can run without payment processing.

Q: Can I self-host it on my own VPS? A: Yes. Since it targets standard Node.js hosting, you can deploy it on any VPS with Node.js 18+ and a PostgreSQL database.

Q: What frontend framework does it use? A: Open SaaS v2 uses Next.js as the frontend framework, with Tailwind CSS for styling.

Q: Does it support other databases besides PostgreSQL? A: Prisma is the ORM. PostgreSQL is the default, but you can swap in MySQL, SQLite, or other supported Prisma backends with minimal changes.

Conclusion

Open SaaS v2 removes the tedious setup work from launching a SaaS. Instead of wiring up auth, payments, and email from scratch, you get a working foundation in under an hour. The MIT license, deployment flexibility, and included AI agent support make it a compelling choice for indie hackers and small teams.

If you are starting a new SaaS project this month, clone Open SaaS v2 first and build on top of it rather than from zero.