Skip to content

About

LibreSharp SaaS Starter: a free dotnet new template for .NET SaaS apps with WolverineFx, React and PostgreSQL. Accounts, organisations, billing and cheap Docker deployment, with no commercial licences.

Topics

Resources

Contributing

Security policy

Stars

5 stars

Watchers

1 watching

Forks

Latest commit

 

History

139 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

LibreSharp SaaS Starter

NuGet CI Docs License: MIT

A free, open-source dotnet new template for a SaaS app. One command gives you a working app with organisations and invitations, plans and Stripe billing, accounts with passkeys and two-factor authentication, and a back office, on WolverineFx, PostgreSQL and React, deployed as a single ASP.NET Core app.

dotnet new install LibreSharp.Templates.SaasStarter
dotnet new saas-starter -n MyApp

Documentation · Get started · Features · Upgrading an app · Roadmap

What you get

A generated app with --Auth saas (the default), in light and dark mode:

Todos, with live updates and reminders The back office's dashboard
An organisation: its plan, trial and limits, and members Pricing, from the plan catalogue

Why this template

  • What paid starter kits sell, for free. Organisations, billing, a back office, and accounts done properly, on MIT, Apache-2.0 and PostgreSQL-licensed packages only. No licence keys, no "community edition" limits.
  • Messaging you can rely on, without a broker. Wolverine handles HTTP endpoints, background messages, retries and scheduling, with a transactional outbox in PostgreSQL: the jobs usually given to MediatR and MassTransit, in one free library.
  • Cheap to run. One container and PostgreSQL. A production docker-compose with Caddy for HTTPS runs on a small VPS, with a step-by-step guide.
  • Yours to change. The code is generated into your repository, with docs that explain each pattern and a guide for upgrading when the template moves on.

Why this template goes through what paid starter kits sell, and where each is in this one.

  • Tested in every shape. CI builds, tests and runs all 12 option combinations against a real PostgreSQL on every change, with end-to-end tests in a real browser.

How it fits together

flowchart LR
    browser["Browser<br/>React, Vite, shadcn/ui"]
    subgraph host["One ASP.NET Core app"]
        endpoints["Wolverine HTTP endpoints"]
        handlers["Background message handlers"]
        hub["SignalR"]
    end
    db[("PostgreSQL<br/>data and messages")]

    browser -- "/api" --> endpoints
    endpoints -- "changes and messages,<br/>one transaction" --> db
    db -- "durable queues" --> handlers
    handlers --> hub
    hub -- "live updates" --> browser
Loading

Every app has the architecture explained in its docs/ folder, with a worked example of each pattern, and a tutorial that builds a feature from start to finish. AI coding assistants can read the documentation as llms.txt.

Try it

You need the .NET 11 SDK, Node.js 22.22 or later, and Docker with Compose (details).

dotnet new install LibreSharp.Templates.SaasStarter
dotnet new saas-starter -n MyApp
cd MyApp
docker compose up -d                 # PostgreSQL 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

Sign in as demo@example.com with Demo123! (Development only), and read the app's emails in Mailpit at http://localhost:8025.

Choose the kind of app

Option Values Default
--Auth saas, identity, none saas saas: organisations, billing and accounts. identity: accounts without organisations. none: no accounts
--Persistence marten, efcore marten Marten (documents and event sourcing) or EF Core, both on PostgreSQL
--IncludeTests true, false true API, client and end-to-end tests
--Aspire true, false false An Aspire AppHost that starts everything for development
--DisplayName text the -n name The name people see (page titles, the sidebar, emails, authenticator apps), such as "Hairy Notes"

For example: dotnet new saas-starter -n MyApp --Auth identity --Persistence efcore.

What's in it

Organisations (saas) Every account gets one; members, Owner/Admin/Member roles, email invitations, a switcher, and data kept apart by Wolverine's multi-tenancy
Billing (saas) A plan catalogue with versions, a reverse trial, features and limits checked in one place, Stripe Checkout, the customer portal and webhooks
Back office (identity, saas) Users, an audit log and failed messages to replay; with saas, also organisations, revenue and feature flags
Accounts (identity, saas) ASP.NET Core Identity with JWT and rotating refresh tokens, email confirmation, Google and GitHub, passkeys, two-factor authentication, sessions, security emails and lockout
Integrations (saas) API keys, an MCP endpoint for AI assistants, signed outgoing webhooks with retries, incoming webhooks, and encrypted secrets
Messaging A transactional outbox, durable queues, scheduled messages, and live updates over SignalR
Data Marten with event sourcing, or EF Core; file storage on disk, S3-compatible stores or Azure Blob Storage
Frontend React, React Router, TanStack Query, Tailwind CSS and shadcn/ui, dark mode, pre-rendered public pages, and a typed API client
Privacy Cookie consent for analytics; with accounts, download your data, account deletion and versioned terms
Production A container image, Docker Compose with Caddy, health checks, OpenTelemetry, strict security headers and rate limits
Security Reviewed against OWASP ASVS level 2, requirement by requirement; security events in the logs
Accessibility WCAG 2.2 AA on every page, light and dark, checked by axe in the end-to-end tests
Tests xUnit v3, Alba and Testcontainers against a real PostgreSQL; Vitest; Playwright end to end

Every item, in detail, is on the Features page.

Roadmap and release notes

Contributing

Issues and pull requests are welcome.

  • docs/CONTRIBUTING.md: how the template is laid out, conditional code, testing a change, regenerating the client's API types, EF Core migrations, and the docs site.
  • docs/releasing.md: publishing a version to nuget.org.
  • docs/decisions.md: why things are the way they are.
  • SECURITY.md: how to report a vulnerability, privately.

To try unreleased changes, install the template from a clone: dotnet new install ./ (and dotnet new uninstall ./ to remove it). The nuget.org page shows nuget/README.md.

About

Part of LibreSharp, which collects free alternatives to .NET packages that went commercial. A community template, not an official WolverineFx or JasperFx package. Up to 0.4.0 it was LibreSharp.Templates.WolverineFxReact (dotnet new wolverine-react). MIT licence.

About

LibreSharp SaaS Starter: a free dotnet new template for .NET SaaS apps with WolverineFx, React and PostgreSQL. Accounts, organisations, billing and cheap Docker deployment, with no commercial licences.

Topics

Resources

Contributing

Security policy

Stars

5 stars

Watchers

1 watching

Forks

Releases

Packages

Used by

Contributors

Languages