---
url: /saas-starter/v0.10.0/guide/overview.md
---
# A generated app

::: tip 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](https://wolverinefx.net/) API on ASP.NET Core
and a React frontend (Vite, TypeScript, Tailwind CSS and [shadcn/ui](https://ui.shadcn.com/)), 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](./generate.md).

## Run it

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

```bash
docker compose up -d                  # PostgreSQL on localhost:5432
dotnet run --project src/ApiHost        # the API on http://localhost:5133
```

In a second terminal:

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

The 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](./troubleshooting.md).

::: info 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](./how-to/run-with-aspire.md)):

```bash
cd src/Client && npm install && cd ../..
dotnet run --project src/ApiHost.AppHost        # then open http://localhost:5173
```

:::

::: info With 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](https://mailpit.axllent.org/), 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, navigation, footer), home page, not-found page
  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 and the header's user menu                                                             (With accounts)
  features/admin/         Admin page (/admin): users, roles, locks and invitations                                             (With accounts)
  features/organisations/ The organisation switcher, /organisation (members, invitations) 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 |
|---|---|
|  Run the API tests (Docker must be running) | `dotnet test` |
| Run the client's unit tests | `npm test` in `src/Client` |
|  Run the end-to-end tests ([how](./testing.md#end-to-end-tests)) | `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` |
|  Add a database migration ([how](./how-to/add-a-migration.md)) | `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](./deployment.md)) | `dotnet publish src/ApiHost -c Release -o publish` |
