Sefism is free for learners. We are here to help you grow, one step at a time.Join for free
Sefism.

Project structure · Full stack

Blazor web app project structure

Opens with credits

A full stack C# web app built from the .NET 10 dotnet new blazor template with interactive Auto mode: a server project that prerenders pages and owns the database, and a .Client project for components that can run in the browser as WebAssembly. For students who know some C# and want to build web UI without a JavaScript framework, and want to know where the database code, the shared contracts and the bUnit tests go as the app grows.

Curated by Tauseef FayyazIntermediate156 files and folders.NET 10 (LTS), ASP.NET Core 10, Blazor Web App templateChecked October 2026
Explore the filesPick any file to see what it is, why it exists and when you add it.

How it grows

Each stage opens the explorer there

  1. 1Day 1What the scaffold and your first hour give you46 files and folders
  2. 2GrowingWhat a real app with features and tests adds+57 files and folders
  3. ProductionWhat running it for real users adds+27 files and foldersOpens with credits
  4. ExpertWhat a team needs to keep it healthy for years+26 files and foldersOpens with credits

How it is organised

  • Static server rendering is the default; add interactivity only where a page needs it. Each page picks a render mode with `@rendermode`: Interactive Server for staff and admin screens, Interactive WebAssembly or Auto for screens used all day or on shaky connections.
  • Know which project code runs in. ClinicApp only ever runs on the server. ClinicApp.Client is downloaded by browsers, so it holds no secrets, no connection strings and no database code. A component that may run as WebAssembly must live in the client project.
  • Components talk to interfaces, never to the database directly. The server implements `IAppointmentService` with EF Core; the client implements it with HttpClient against a small API. The same component then works in every render mode.
  • Group by feature, not by file type: `Features/Appointments` on the server, `Pages/Appointments` in the client. A change to booking touches a few files that sit together.
  • Use `IDbContextFactory` and a new, short-lived DbContext per operation. A Blazor circuit can live for hours, much longer than the unit of work a DbContext is designed for.
  • Never send EF Core entities to components. DTOs in `Contracts` are the boundary, with validation attributes that run in the browser for feedback and again on the server for safety.
  • Every API endpoint and every page that shows private data has an explicit authorization rule. Hiding a link is not security.
  • Test in layers: bUnit for components and rules at Growing, integration tests on real PostgreSQL and a few Playwright journeys at Production, architecture and load tests at Expert.

At the top of the project

Open one in the explorer for the full story

Learn more on Sefism

Roadmaps, cheat sheets and projects that go with Blazor web app.

See 12 more
Checked against 16 official sources, October 2026. If something has changed, the docs win.Show sources

Picked from the other libraries by shared topics.

Work with me

Stuck on something specific?

Writing only gets you so far. If you want an answer to your situation rather than the general case, book a session and we will work through it together. Sessions are free for approved Sefism members, and a few slots open each week.

  • 1:1 Mentorship
  • Fresh Graduate Mentorship
  • Career Guidance

Brand deals, promos and partnerships: tauseeffayyaz@gmail.com