Back to templates

Template details

LastSaaS

MIT-licensed Go + React SaaS boilerplate with multi-tenancy, Stripe billing, webhooks, analytics, and an MCP server for AI admin access.

About this template

LastSaaS is an MIT-licensed, self-hosted SaaS boilerplate that pairs a Go backend with a React 19 + TypeScript frontend, giving you multi-tenant accounts, Stripe billing, white-label branding, and admin tooling out of the box so you can build product features instead of plumbing.

What is LastSaaS?

LastSaaS is a production-ready SaaS starter kit written in Go (gorilla/mux) and React 19 with TypeScript, Vite 7, and Tailwind CSS 4, backed by MongoDB. It is released under the MIT license by Metavert LLC and was built entirely through conversation with Claude Code. Forking the repository and running the setup script produces a working multi-tenant application with authentication, billing, admin dashboards, and API documentation that you customize for your own product.

Key Features

  • Authentication stack — bcrypt email/password with email verification via Resend, Google/GitHub/Microsoft OAuth, magic links, TOTP MFA with recovery codes, and JWT access tokens (30 min) plus rotating refresh tokens (7 days).
  • Genuine multi-tenancy — tenant-scoped data isolation with three-tier RBAC (owner/admin/user), team invitations, ownership transfer, and per-tenant activity logs.
  • Stripe billing — subscriptions with monthly/annual pricing, flat-rate or per-seat models, free trials, credit bundles, Checkout, Billing Portal, Stripe Tax, invoices with sequential numbers and PDF export, and promotion codes.
  • Dual credit buckets — subscription credits (reset or accrue) alongside purchased credits, with billing-enforcement and entitlement middleware to gate features.
  • Outgoing webhooks — 19 event types across billing, team, user, and security tiers, HMAC-SHA256 signed with whsec_ secrets and delivery tracking.
  • API keys — lsk_-prefixed keys with admin or user authority scopes, SHA-256 hashed storage, and last-used timestamps.
  • Admin interface — user/tenant management, impersonation, plan and credit configuration, branding editor, CSV export, and system log viewer.
  • Health and analytics — 60-second CPU/memory/disk/HTTP/MongoDB metric collection with 8 Recharts dashboards, plus a product analytics tab with conversion funnel, MRR/ARR/churn KPIs, retention cohorts, and a telemetry Go SDK.
  • MCP server — 26 read-only tools that let Claude Desktop or Claude Code query your instance in natural language via an API key.

Who is it for?

  • Technical founders building a SaaS from scratch: fork the repo, run ./scripts/setup.sh, and skip weeks of auth and billing scaffolding.
  • Go developers tired of Node monoliths: get compiled-binary deployment in a roughly 14MB Alpine container with the React SPA served directly from the Go binary.
  • Teams shipping an AI-assisted codebase: the consistent patterns and structure were designed for Claude Code to keep extending.
  • Platform builders needing customer-facing integrations: webhooks, scoped API keys, and self-hosted API docs are wired in from day one.

What can you do with LastSaaS?

  • Launch a per-seat B2B product: configure plans with included seats and min/max limits in the admin UI, and Stripe Products and Prices are created automatically at checkout.
  • Sell usage-based features: call telemetry.Track() or the credit middleware to meter consumption and deduct from subscription or purchased credit buckets.
  • Offer white-label workspaces: set custom app name, logo, colors, fonts, landing page HTML, custom /p/{slug} pages, CSS injection, and favicon per deployment.
  • Operate with an AI assistant: connect the MCP server with a root-tenant API key and ask about ARR trends, critical logs, or webhook delivery history in plain language.

How does LastSaaS work?

Clone the repository and run the interactive setup script, which prompts for your MongoDB URI, generates JWT secrets, and writes a .env plus config files. Start the Go backend on port 4290 and the Vite dev server on port 4280, then run lastsaas setup to create the root tenant and owner account. Stripe keys and a webhook endpoint subscribing to eight events are optional but required for paid subscriptions.

Pricing

LastSaaS is free and open source under the MIT license. There are no license fees; you pay only for your own hosting and third-party services such as MongoDB Atlas, Stripe, and Resend.

Alternatives

  • ShipFast — a Next.js boilerplate sold for $169 with no multi-tenancy.
  • Supastarter — a Next.js/Nuxt starter priced from $299.
  • MakerKit — a Next.js starter priced $199–599.
  • SaaS Pegasus — a Django-based boilerplate charging $249/year.
  • Gravity — a Node + React boilerplate priced under $1K.

FAQ

Is LastSaaS really free?

Yes. LastSaaS is MIT-licensed, so you can fork it, modify it, and ship it commercially without paying a license fee. You still cover your own infrastructure and any paid third-party services like MongoDB Atlas, Stripe, or Resend.

What stack does LastSaaS use?

The backend is Go 1.25 with gorilla/mux, and the frontend is React 19, TypeScript, Vite 7, and Tailwind CSS 4. Data lives in MongoDB, billing runs through stripe-go v82, email goes through Resend, and charts use Recharts.

Does LastSaaS support multi-tenancy?

Yes. LastSaaS provides tenant-scoped data isolation with three roles (owner, admin, user), team invitations, ownership transfer, per-tenant activity logs, and per-tenant billing — more than the basic team features offered by competing boilerplates.

Can I use an AI assistant to manage my LastSaaS instance?

The built-in MCP server exposes 26 read-only tools covering dashboards, users, tenants, financials, logs, health, plans, and webhooks. It requires a root-tenant API key and runs over stdio, so it works with Claude Desktop and Claude Code.

Where does LastSaaS deploy?

LastSaaS ships with a multi-stage Dockerfile and a fly.toml for Fly.io, building backend and frontend into a single Alpine container that serves the SPA from the Go binary on port 8080. The container runs on any platform with MongoDB access.

Screenshot of LastSaaS