LibreSharp.Templates.SaasStarter
0.5.0
dotnet new install LibreSharp.Templates.SaasStarter@0.5.0
LibreSharp SaaS Starter
A dotnet new template for a SaaS app: organisations with members and invitations, plans,
trials and limits, Stripe subscriptions, and a back office. It has a WolverineFx
backend and a React frontend (Vite, TypeScript, Tailwind CSS, shadcn/ui with dark mode), built
and deployed as one ASP.NET Core app on PostgreSQL. --Auth identity or --Auth none give
smaller apps without organisations or accounts.
Formerly LibreSharp.Templates.WolverineFxReact (dotnet new wolverine-react).
It does the jobs often given to MediatR (in-process messaging) and MassTransit (message bus and transactional outbox) with Wolverine, using only free, open-source libraries. Part of LibreSharp, which collects free alternatives to .NET packages that went commercial. This is a community template, not an official WolverineFx/JasperFx package.
Get started
You need the .NET 11 SDK, Node.js 22.22 or later, and Docker with Compose.
dotnet new install LibreSharp.Templates.SaasStarter
dotnet new saas-starter -n MyApp
cd MyApp
docker compose up -d # Postgres and Mailpit
dotnet run --project src/MyApp # the API; leave it running
In a second terminal:
cd MyApp/src/Client
npm install
npm run dev # open http://localhost:5173
With accounts (--Auth identity or saas), log in as demo@example.com / Demo123! (created in Development only),
and read the app's emails in Mailpit at http://localhost:8025.
Options
| Option | Values | Default | |
|---|---|---|---|
--Persistence |
marten, efcore |
marten |
Marten (documents and event sourcing) or EF Core |
--Auth |
none, identity, saas |
saas |
identity: accounts with ASP.NET Core Identity and JWT, email confirmation, roles and a back office, Google/GitHub sign-in and passkeys. saas: accounts plus organisations, with members, roles and invitations, plans, trials, limits, Stripe billing and a back office for customers |
--IncludeTests |
true, false |
true |
Integration tests against a real Postgres |
What you get
- Wolverine HTTP endpoints in vertical slices, with FluentValidation returning
ProblemDetails. - Messaging with a transactional outbox: messages are saved with your data and handled in the background, surviving restarts.
- Event sourcing (Marten): event streams and Wolverine's aggregate handler workflow.
- Realtime updates with SignalR: every open tab refreshes, scoped to the signed-in user (or,
with
saas, their organisation). - Accounts (
--Auth identityorsaas): ASP.NET Core Identity with JWT access tokens and rotating refresh tokens; email confirmation, password reset and invitations sent through the outbox (MailKit, with Mailpit in development); account settings; lockout; roles and a back office (users, an audit log, and failed messages to replay); sign-in with Google and GitHub; and passkeys. - Organisations (
--Auth saas): multi-tenancy with Wolverine, so each organisation's data is kept apart in the data layer; every account gets its own organisation, and users create more, switch between them, and invite others by email; Owner, Admin and Member roles. - Billing (
--Auth saas): a plan catalogue with versions, a reverse trial, features and limits checked in one place (402 Payment Required), a pre-rendered pricing page, Stripe Checkout, the customer portal and webhooks through Wolverine's durable queues, and a back office with a revenue dashboard, organisations (give a plan, suspend, notes) and feature flags. - Integrations (
--Auth saas): API keys per organisation (hashed, scoped, rate limited, rotated), an MCP endpoint so AI assistants can use the app, outgoing webhooks signed the Standard Webhooks way with retries and a delivery log, encrypted secrets per organisation, and receiving webhooks. - Notifications and your data (with accounts): a live notifications list, emailed with one-click unsubscribe, and "Download your data" (GDPR, PDPA).
- UI: shadcn/ui components on every page, with dark mode that follows the operating system.
- Pre-rendered public pages (React Router's framework mode): the home page is real HTML for
search engines and link previews, with real 404s,
robots.txtandsitemap.xml. - Security by default: strict security headers, HTTPS in production, rate limiting and lockout on sign-in, one-time email links built from the configured address, and a Security page in the generated docs.
- Deployment: a container image, a production
docker-composewith PostgreSQL and Caddy for HTTPS, health checks and OpenTelemetry. - A typed API client generated from the OpenAPI document.
- Production-ready publish:
dotnet publishpre-generates Wolverine's code and bundles the React app, so production starts fast with no runtime compilation. - Tests with xUnit, Alba and Testcontainers, covering endpoints, messaging, SignalR and, with accounts, every account and organisation feature including passkeys; and end-to-end tests with Playwright.
Every option combination is built, tested and published in CI on each change.
Changes in 0.5.0
- Integrations with
--Auth saas: API keys, an MCP endpoint for AI assistants, outgoing and incoming webhooks, and encrypted secrets. - Notifications and Download your data with accounts. The realtime connection is now
shared by the whole page (
lib/realtime.ts). EF Core: new migrations.
Changes in 0.4.1
- Renamed from
LibreSharp.Templates.WolverineFxReact: create projects withdotnet new saas-starter, and--Authnow defaults tosaas(--Auth nonefor the previous default). Uninstall the old package withdotnet new uninstall LibreSharp.Templates.WolverineFxReact. - Billing and a back office with
--Auth saas: plans, a reverse trial, limits, Stripe subscriptions, and admin pages for organisations, feature flags, an audit log and failed messages. - shadcn/ui and dark mode on every page. With accounts, the admin page is now a back office with sections, and the user menu is a dropdown.
Changes in 0.4.0
--Identityis replaced by--Auth:--Auth identityfor--Identity true,--Auth nonefor--Identity false, and the new--Auth saasfor organisations.- With accounts, production needs
App__ClientUrl, the app's public address (such ashttps://app.example.com): email links are built from it, and the app won't start without it outside Development. The productiondocker-composesets it fromDOMAIN.
Links
- Source, issues and full documentation: https://github.com/LibreSharp/saas-starter
- Roadmap: https://github.com/LibreSharp/saas-starter/blob/main/ROADMAP.md
- LibreSharp: https://libresharp.github.io
-
.NETStandard 2.0
- No dependencies.
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.