Skip to content

Get started ​

The template is on nuget.org as LibreSharp.Templates.SaasStarter. It creates a complete app that you then own: there's no runtime package to update, and the code is yours to change.

What you need ​

  • The .NET 11 SDK. Check with dotnet --list-sdks. If you installed it with the dotnet-install script, it's in ~/.dotnet, which isn't on your PATH by default: add export DOTNET_ROOT=$HOME/.dotnet and export PATH=$DOTNET_ROOT:$PATH to your shell profile.
  • Node.js 22.22 or later, with npm.
  • Docker with the Compose plugin. PostgreSQL and Mailpit run in Docker for development, and the tests start their own PostgreSQL. Check with docker compose version. On Ubuntu, Debian and Mint, the docker.io package doesn't include Compose: also install docker-compose-v2, and add yourself to the docker group (sudo usermod -aG docker $USER, then sign out and in).

Create an app ​

bash
dotnet new install LibreSharp.Templates.SaasStarter
dotnet new saas-starter -n MyApp
cd MyApp
git init && git add -A && git commit -m "Generated from LibreSharp.Templates.SaasStarter"
ToRun
Update the template to the latest versiondotnet new update
Install a specific versiondotnet new install LibreSharp.Templates.SaasStarter@0.8.0
See the template's optionsdotnet new saas-starter --help
Uninstall itdotnet new uninstall LibreSharp.Templates.SaasStarter

Commit the app as generated, before changing it. Upgrading to a later version of the template works best when that first commit is in your history.

Run it ​

bash
docker compose up -d                 # PostgreSQL and Mailpit
dotnet run --project src/MyApp       # the API; leave it running

In a second terminal:

bash
cd src/Client
npm install
npm run dev                          # open http://localhost:5173

With accounts, sign in as demo@example.com with the password Demo123!: it's created in Development only, already confirmed and an admin, and the login form is filled in with it. Change it under DevelopmentUser in appsettings.Development.json and in src/Client/.env.development. The emails the app sends in Development land in Mailpit at http://localhost:8025.

With --Aspire true, dotnet run --project src/MyApp.AppHost starts all of it instead.

If something doesn't start, Troubleshooting has the usual causes, by the message you see.

Choose the options ​

OptionValuesDefault
--Persistencemarten, efcoremartenMarten (documents and event sourcing) or EF Core, both on PostgreSQL
--Authnone, identity, saassaasidentity: accounts, with sign-in, passkeys, two-factor and a back office. saas: accounts plus organisations, with members, plans, trials, limits, Stripe billing and a back office for customers
--IncludeTeststrue, falsetrueAPI tests against a real PostgreSQL, client unit tests and Playwright end-to-end tests
--Aspiretrue, falsefalseAn Aspire AppHost that starts everything for development

For example, an app with accounts but no organisations, on EF Core:

bash
dotnet new saas-starter -n MyApp --Persistence efcore --Auth identity

Keep a note of the options you chose (in the first commit's message, say): you'll need them to upgrade.

Next ​

The same guides are in your app's docs/ folder, with only the parts for the options you chose.

For AI coding assistants

The whole site is available as plain Markdown: llms.txt lists the pages, and llms-full.txt has them all in one file. Every page also has a .md copy at its address. In your app, AGENTS.md points assistants at the app's own docs/.

Documentation for v0.9.0. Released under the MIT licence.