A generated app
What this page covers
Every choice of --Persistence, --Auth, --IncludeTests and --Aspire: a label says which options a part is for. The copy in your app's docs/ folder has only the parts for yours. ApiHost stands for your app's name.
What dotnet new saas-starter creates: a Wolverine API on ASP.NET Core and a React frontend (Vite, TypeScript, Tailwind CSS and shadcn/ui), with data in PostgreSQL. In production the API also serves the built React app, so it deploys as one service. Which features it has depends on the options you generated it with: see Generate an app.
Run it
You need the .NET 11 SDK, Node.js 22.22 or later, and Docker with the Compose plugin.
docker compose up -d # PostgreSQL on localhost:5432
dotnet run --project src/ApiHost # the API on http://localhost:5133In a second terminal:
cd src/Client
npm install
npm run dev # open http://localhost:5173The Vite dev server forwards /api (including the SignalR WebSocket) to the API, so the browser only talks to one origin. If something doesn't start, see Troubleshooting.
With Aspire
Or with Aspire: one command starts the database, the API and the dev server, and opens a dashboard with their logs and traces (how):
cd src/Client && npm install && cd ../..
dotnet run --project src/ApiHost.AppHost # then open http://localhost:5173With accounts
Log in as demo@example.com / Demo123!. This user is created at startup in Development only, is an admin (so /admin works), and the dev server pre-fills the login form with it. Change it under DevelopmentUser in src/ApiHost/appsettings.Development.json and in src/Client/.env.development.
docker compose up -d also starts Mailpit, which catches every email the app sends in Development (confirmation, password reset, invitations): read them at http://localhost:8025. New accounts must confirm their email before they can log in; the demo user is already confirmed.
To try the API without the UI, open src/ApiHost/ApiHost.http in Visual Studio, Rider, or VS Code with the REST Client extension, and run the requests in order. Or browse the interactive API reference at http://localhost:5133/scalar (Development only), generated from the OpenAPI document at /openapi/v1.json.
Project layout
src/ApiHost/
Program.cs All wiring: Wolverine, persistence, validation, SignalR, auth (With accounts)
Program.cs All wiring: Wolverine, persistence, validation, SignalR (Without accounts)
Features/Todos/ The example feature: endpoints, messages, handler, model
Features/Auth/ Log in (password, Google/GitHub, passkey, two-factor code), register, confirm email, reset password (With accounts)
Features/Account/ The signed-in user: profile, password, sign-in methods, passkeys, two-factor, delete account (With accounts)
Features/Admin/ Admin endpoints: users, roles, locks and invitations (With accounts)
Features/Organisations/ Organisations: switching, members and roles, invitations, joining (With organisations)
Organisations/ The organisation model, its store, and choosing a session's organisation (With organisations)
Realtime/AppHub.cs SignalR hub that pushes messages to browsers
Storage/ File storage (IFileStorage): local disk, S3-compatible or Azure Blob
Analytics/ Google Tag Manager settings, for the client's cookie banner
Data/Marten/ Marten setup: event store, projections, indexes (Marten)
Data/EfCore/ AppDbContext, migrations, and migrate-on-startup (EF Core)
Identity/ Users, JWT and refresh tokens, roles, lockout, two-factor, rate limits (used by the features) (With accounts)
Identity/Email/ Account emails: messages, their handler, and the SMTP sender (MailKit) (With accounts)
Identity/External/ Google and GitHub set-up, and linking a provider's account to a user (With accounts)
Identity/Passkeys/ Passkey set-up (Identity's WebAuthn support) (With accounts)
src/ApiHost.AppHost/ Aspire AppHost: starts everything for development, with the dashboard (With Aspire)
src/Client/src/
root.tsx, App.tsx The HTML document (with the description and link-preview tags), and the page frame
routes.ts, routes/ Each URL and the route module for its page, with the page's title
pages.ts Every page's path, and which are public: pre-rendered, and in sitemap.xml
components/ Layout (header or sidebar, navigation, footer), Page, home and not-found pages
features/todos/ Todo page, TanStack Query hooks, SignalR hook (useTodoRealtime)
features/auth/ Login, register, email confirmation and password reset pages, route guards (With accounts)
features/account/ Settings page, the sidebar's navigation and user menu (With accounts)
features/admin/ Admin page (/admin): users, roles, locks and invitations (With accounts)
features/organisations/ The organisation switcher, /organisation and its tabs (general, members, billing), and /join (With organisations)
lib/api/ Typed API client generated from the OpenAPI document
test/ Unit test setup: the fake API (MSW) and render helpers
docs/ Documentation and how-to guides
deploy/ Production docker-compose, Caddy, and a server guide
tests/ApiHost.Tests/ Integration tests against a real PostgreSQL (With the tests)
tests/e2e/ End-to-end tests in a real browser (Playwright) (With the tests)Common tasks
| Task | Command |
|---|---|
| With the tests Run the API tests (Docker must be running) | dotnet test |
| Run the client's unit tests | npm test in src/Client |
| With the tests Run the end-to-end tests (how) | npm test in tests/e2e, with the app running |
| Update the client's API types | npm run gen:api in src/Client, with the API running |
| Lint the client | npm run lint in src/Client |
| EF Core Add a database migration (how) | dotnet ef migrations add <Name> --project src/ApiHost --output-dir Data/EfCore/Migrations |
| List the app's command-line tools (code generation, database, diagnostics) | dotnet run --project src/ApiHost -- help |
| Publish for production (deployment) | dotnet publish src/ApiHost -c Release -o publish |