Get Started with Nano: Generating a .NET SaaS Application
If you’re ready to streamline your .NET development process with the Nano Boilerplate, this step-by-step guide will walk you through setup, connection strings, and running your application effectively.
Step 1: Installing the Nano Boilerplate NuGet Package
In the past, the Nano boilerplate was distributed as a project solution. The issue was that you needed to rename the project manually, and would have some unused code depending on your UI and multi-tenancy needs. We still include the full project, but with the CLI tool you can now generate the entire solution named as you need it, with only the relevant code. The generated code itself has no proprietary dependencies.
- Locate the NuGet File:
After downloading the zip file, navigate to thedotnet
folder and move theNano.Boilerplate
NuGet package (Nano.Boilerplate.2.3.0.nupkg
) to a convenient directory on your computer. - Open Developer PowerShell:
In your Integrated Development Environment (IDE), open a Developer PowerShell terminal and navigate to the directory containing the NuGet file:
cd <path-to-your-nuget-file>
- Install the NuGet Package:
Run the following command to install the project templates globally:
dotnet new install .\Nano.Boilerplate.2.3.0.nupkg
This will install the project templates globally (you don’t need to keep the NuGet file). New versions can be installed in the same way. To uninstall use command: dotnet new uninstall Nano.Boilerplate.
Step 2: Scaffold New Projects:
You can now create new projects using the Nano Boilerplate template.
- Command Line: Use
dotnet new
to scaffold projects directly. - Visual Studio: Select Nano Boilerplate from the project templates list.
The CLI commands can be used within projects to scaffold new services and API controllers. For more information about using the CLI tool, check out the next section.
While the CLI tool is the best way to use Nano, a full solution file is also included.
Step 3: Setting Up Your Connection String
Nano Boilerplate simplifies database configuration. A connection string is pre-generated in the appsettings.json
file with the same name as your project. This can be edited in the ConnectionStrings “DefaultConnection” section.
"ConnectionStrings": {
"DefaultConnection": "Data Source=(localdb)\\mssqllocaldb;Database=MyApplicationDb;Trusted_Connection=True;MultipleActiveResultSets=true"
},
Step 4: Running Your Application
Initial migrations are already created. Running the application will apply any pending migrations automatically. If no database exists, Entity Framework will create a database, seeding it with a root tenant and default root-level user with the following credentials:
User: admin@email.com
Password: Password123!
The application will run at:
https://localhost:7250/
When you navigate to the localhost:7250 address, the client-side app will appear. This instance is served from the static files found within the wwwroot folder of the WebApi project. This is the ‘build’ version of the Vue / React client. When you work with a client project, it will run the ‘development’ version on a different port (localhost:3000).
Step 5: Leverage CLI for Additional Scaffolding
For advanced scaffolding, Nano Boilerplate provides a powerful CLI tool to create services and API controllers. Detailed usage instructions are covered in the next section.
Next Steps
Learn about using the CLI tool, in the next section.