Nano ASP.NET SaaS Boilerplate
Admin credentials (all tenants): admin@email.com / Password123!
Sample data resets every hour
Nano ASP.NET SaaS Boilerplate
General
.NET Solution
Vue UI
React UI
Razor Pages
.NET Solution

ASP.NET Nano Solution Overview

The Nano Boilerplate is a customizable project template distributed as a NuGet package. After the template is installed, it will show up as an option in the new project dialogue in Visual Studio. The CLI commands are also available and can be used to generate projects, services, and controllers. Unlike ABP which is an opinionated framework, the code generated with the Nano boilerplate contains no proprietary NuGet dependencies. Its completely unopinionated customizable code which can be used on unlimited projects.

The .NET solution follows clean architecture pattern, with code layered into Domain, Infrastructure, and Application class libraries. WebApi is the entry point of the application and serves as the presentation layer of the project. This solution overview guide goes over the project structure.

The WebApi contains REST controllers for Authorization, Identity, Tenants, and Products. A Postman collection with all of the endpoints is included so testing can be done without any reliance on a UI.

The full version Nano boilerplate provides multiple front-end options. Two of these options are JavaScript single page applications, built with React and Vue. These projects are completely separate and interact with the back-end .NET solution via REST API controller endpoints exposed by the WebAPI. The UI itself is served from static files. Learn more about the UI projects in the React and Vue documentation.

Razor pages is another UI option. Razor pages, like MVC, are multi-page, server-rendered pages, which work more like a ‘traditional’ web application. Choosing Razor as the UI option will generate a .NET solution with RazorApp as the presentation layer in the instead of WebAPI.

The following .NET solution guides will focus on back-end topics. To learn more about the front-end projects, refer to their own guides.

The project follows clean architecture and is divided into the following layers:

  • WebApi / RazorApp
  • Application
  • Domain
  • Infrastructure

Depending on the UI parameter specified when creating the project, only WebApi or RazorApp will be present.

The WebApi project is the top-level project and contains the entry point of the application, program.cs. The WebApi can serve static UI files and exposes RESTful API controllers. It contains appsettings.json which is used to configure app-wide settings. The next guide will begin by examining this top-level project.

The RazorApp project is a top-level project and can be used to build an application with Razor pages. RazorApp differs from WebApi in that it contains Razor page views in addition to RESTful API controllers. These views serve as the UI for the user and since this a multi-page architecture; Cookies are used instead of JWT tokens for authentication. These differences are explained further in the Razor pages documentation. Use the parameter option -ui razor to create a new project with razor pages.

The Application layer houses application services which contain business logic. The Nano boilerplate provides one sample service, the Product Service, which can serve as a guide for creating your own application services. Check the application services documentation for more info.

Generic functionality can be found in the Infrastructure layer. Services such as identity, multi-tenancy, file upload, persistence, etc. have concrete implementations in the infrastructure layer. These services are provided to the application via dependency injection. This is to maintain a separation of concerns and follow clean architecture.

The Domain layer exists at the lowest level in the application and contains the entity classes. Entities can implement interfaces which provide different behavior such as tenant isolation, audit automation, and soft delete. All entities derive from a base entity. The base entity can use any type for an ID, but GUIDs are generally preferred for most things except static data.

The next guide will focus on the WebApi, the presentation layer and entry point of the application.