ASP.NET Nano Solution Overview
Nano ASP.NET Boilerplate is a customizable project template for building SaaS applications and web applications with ASP.NET Core. Distributed as a NuGet package, it generates a structured .NET solution with application architecture, authentication, data access, and other common infrastructure already configured.
Unlike a rigid application framework, Nano generates code that you can understand, modify, and extend directly. The generated solution uses standard .NET development patterns without proprietary Nano framework dependencies, allowing you to adapt the architecture to your requirements and reuse the template across unlimited projects.
Overview
The Nano .NET solution follows the Clean Architecture pattern, separating application responsibilities into distinct layers: Domain, Application, and Infrastructure. A top-level presentation project, either WebApi or RazorApp, provides the application’s entry point and user-facing functionality.
This separation helps keep business logic independent of presentation concerns and infrastructure implementations. Each layer has a defined responsibility, making the application easier to maintain, test, and extend as it grows.
The WebApi project exposes REST API endpoints for functionality such as authentication, user management, tenant administration, and products. A Postman collection is included so you can test the available endpoints without requiring a frontend application.
Frontend UI Options
The full version of Nano provides three frontend options: React, Vue, and Razor Pages. Each option uses a different approach to presenting the application to users.
React and Vue
React and Vue are JavaScript frameworks used to build single-page applications (SPAs). Nano provides separate frontend projects that communicate with the .NET backend through REST API endpoints.
These frontends handle client-side navigation, application state, forms, authentication state, and other user interface functionality. The ASP.NET Core backend exposes the API and can serve the compiled frontend as static files when the application is deployed together.
Learn more in the React Setup Guide and Vue Setup Guide.
Razor Pages
Razor Pages provides a server-rendered alternative to the React and Vue frontends. Instead of running a separate JavaScript single-page application, the interface is rendered by ASP.NET Core on the server.
When you select the -ui razor option during project generation, Nano creates a solution with RazorApp as the presentation layer instead of WebApi. RazorApp includes Razor Page views alongside API controllers and uses cookie-based authentication for the server-rendered application.
See the Razor Pages Overview for more information.
The following sections focus on the backend architecture and the responsibilities of each project layer. The frontend documentation covers the implementation details specific to React, Vue, and Razor Pages.
Backend Architecture
The .NET solution is organized into four projects:
- WebApi or RazorApp — The application’s entry point and presentation layer.
- Application — Application services and business operations.
- Domain — Domain entities and core business models.
- Infrastructure — Concrete implementations of shared services, persistence, and external integrations.
Depending on the UI option selected when generating the project, the solution contains either WebApi or RazorApp, alongside the Application, Domain, and Infrastructure projects.
WebApi — Main Application
The WebApi project is the entry point for applications using a separate frontend, such as React or Vue. It contains Program.cs, which configures and starts the ASP.NET Core application, along with the REST API controllers that handle incoming HTTP requests.
The project also contains appsettings.json for application configuration and can serve the compiled frontend from its wwwroot directory.
WebApi connects incoming requests to the Application layer and returns the appropriate HTTP responses. It acts as the presentation layer without requiring the core business logic to reside in the controllers.
Continue to the WebApi Guide to explore the project’s structure and configuration.
RazorApp — Main Application
The RazorApp project is the entry point for applications using Razor Pages. Like WebApi, it contains Program.cs, application configuration, and API controllers. However, it also includes Razor Page views that render the user interface on the server.
Because Razor Pages uses a server-rendered application model, cookie-based authentication is used for the browser session rather than relying exclusively on JWT authentication in a separate SPA.
To generate a project with Razor Pages, specify the -ui razor option when creating the application.
See the Razor Pages Overview for details about its structure and how it differs from the WebApi configuration.
Application
The Application layer contains application services that coordinate business operations and implement use cases. These services connect the presentation layer to the Domain and Infrastructure layers without requiring controllers to implement the underlying business logic.
Nano includes a sample Product Service that demonstrates how application services are organized and implemented. You can use it as a reference when adding services for your own entities and business requirements.
Keeping application operations in this layer helps maintain a consistent structure and makes business functionality easier to test and reuse.
See the Application Services Documentation for more information.
Infrastructure
The Infrastructure layer contains concrete implementations of functionality required by the application. This includes persistence and database access, identity-related services, multi-tenancy, file uploads, and other supporting infrastructure.
For example, the Application layer can depend on an abstraction for a service, while Infrastructure provides the implementation that interacts with a database or external resource. Dependency injection connects these components at runtime.
This separation allows the application to use infrastructure services without coupling its core business logic directly to implementation details.
Explore the relevant documentation for Authentication and Authorization, Multi-Tenancy, and Persistence Infrastructure.
Domain
The Domain layer contains the application’s core entities and business models. These entities represent the data and concepts that the application works with, without depending on the presentation layer or database implementation.
In Nano, entities derive from a common base entity and can implement interfaces that provide additional behavior, such as tenant isolation, automatic auditing, and soft deletion.
The base entity supports different ID types. GUIDs are a common choice for application entities, while other types may be appropriate for static or reference data.
Keeping domain entities separate from infrastructure and presentation concerns helps make the application’s core model easier to understand and maintain.
Next Steps
Now that you understand the overall solution structure, continue to the WebApi Guide to examine the entry point of the application, its configuration, and how incoming API requests are handled.
You can then explore the Application Services and Persistence Infrastructure documentation to learn how business operations and data access are implemented.