Back to Abp

MyCompanyName.MyProjectName

templates/app/aspnet-core/README.md

10.3.08.0 KB
Original Source

MyCompanyName.MyProjectName

About this solution

This is a layered startup solution based on Domain Driven Design (DDD) practises. All the fundamental ABP modules are already installed.

Pre-requirements

Configurations

The solution comes with a default configuration that works out of the box. However, you may consider to change the following configuration before running your solution:

<TEMPLATE-REMOVE IF-NOT='TIERED'> * Check the `ConnectionStrings` in `appsettings.json` files under the `MyCompanyName.MyProjectName.AuthServer`, `MyCompanyName.MyProjectName.HttpApi.Host` and `MyCompanyName.MyProjectName.DbMigrator` projects and change it if you need. </TEMPLATE-REMOVE> <TEMPLATE-REMOVE IF='TIERED'> <TEMPLATE-REMOVE IF-NOT='ui:mvc'> * Check the `ConnectionStrings` in `appsettings.json` files under the `MyCompanyName.MyProjectName.Web` and `MyCompanyName.MyProjectName.DbMigrator` projects and change it if you need. </TEMPLATE-REMOVE> <TEMPLATE-REMOVE IF-NOT='ui:blazor-server'> * Check the `ConnectionStrings` in `appsettings.json` files under the `MyCompanyName.MyProjectName.Blazor` and `MyCompanyName.MyProjectName.DbMigrator` projects and change it if you need. </TEMPLATE-REMOVE> <TEMPLATE-REMOVE IF-NOT='ui:blazor'> * Check the `ConnectionStrings` in `appsettings.json` files under the `MyCompanyName.MyProjectName.HttpApi.Host` and `MyCompanyName.MyProjectName.DbMigrator` projects and change it if you need. </TEMPLATE-REMOVE> <TEMPLATE-REMOVE IF-NOT='ui:angular'> * Check the `ConnectionStrings` in `appsettings.json` files under the `MyCompanyName.MyProjectName.HttpApi.Host` and `MyCompanyName.MyProjectName.DbMigrator` projects and change it if you need. </TEMPLATE-REMOVE> </TEMPLATE-REMOVE>

Before running the application

Generating a Signing Certificate

In the production environment, you need to use a production signing certificate. ABP Framework sets up signing and encryption certificates in your application and expects an openiddict.pfx file in your application.

This certificate is already generated by ABP CLI, so most of the time you don't need to generate it yourself. However, if you need to generate a certificate, you can use the following command:

bash
dotnet dev-certs https -v -ep openiddict.pfx -p 00000000-0000-0000-0000-000000000000

00000000-0000-0000-0000-000000000000 is the password of the certificate, you can change it to any password you want.

It is recommended to use two RSA certificates, distinct from the certificate(s) used for HTTPS: one for encryption, one for signing.

For more information, please refer to: https://documentation.openiddict.com/configuration/encryption-and-signing-credentials.html#registering-a-certificate-recommended-for-production-ready-scenarios

Also, see the Configuring OpenIddict documentation for more information.

Install Client-Side Libraries

Run the following command in the directory of your final application:

bash
abp install-libs

This command installs all NPM packages for MVC/Razor Pages and Blazor Server UIs and this command is already run by the ABP CLI, so most of the time you don't need to run this command manually.

Create the Database

Run MyCompanyName.MyProjectName.DbMigrator to create the initial database. This should be done in the first run. It is also needed if a new database migration is added to the solution later.

Solution structure

This is a layered monolith application that consists of the following applications:

  • MyCompanyName.MyProjectName.DbMigrator: A console application which applies the migrations and also seeds the initial data. It is useful on development as well as on production environment. <TEMPLATE-REMOVE IF-NOT='TIERED'>
  • MyCompanyName.MyProjectName.AuthServer: ASP.NET Core MVC / Razor Pages application that is integrated OAuth 2.0(OpenIddict) and account modules. It is used to authenticate users and issue tokens.
  • MyCompanyName.MyProjectName.HttpApi.Host: ASP.NET Core API application that is used to expose the APIs to the clients. <TEMPLATE-REMOVE IF-NOT='ui:mvc'>
  • MyCompanyName.MyProjectName.Web: ASP.NET Core MVC / Razor Pages application that is the essential web application of the solution. </TEMPLATE-REMOVE>
<TEMPLATE-REMOVE IF-NOT='ui:blazor-server'> * `MyCompanyName.MyProjectName.Blazor`: ASP.NET Core Blazor Server application that is the essential web application of the solution. </TEMPLATE-REMOVE> <TEMPLATE-REMOVE IF-NOT='ui:blazor'> * `MyCompanyName.MyProjectName.Blazor`: ASP.NET Core Blazor WASM application that is a single page application that runs on the browser. </TEMPLATE-REMOVE> <TEMPLATE-REMOVE IF-NOT='ui:angular'> * `angular`: Angular application. </TEMPLATE-REMOVE> </TEMPLATE-REMOVE> <TEMPLATE-REMOVE IF='TIERED'> <TEMPLATE-REMOVE IF-NOT='ui:mvc'> * `MyCompanyName.MyProjectName.Web`: ASP.NET Core MVC / Razor Pages application that is the essential web application of the solution. </TEMPLATE-REMOVE> <TEMPLATE-REMOVE IF-NOT='ui:blazor-server'> * `MyCompanyName.MyProjectName.Blazor`: ASP.NET Core Blazor Server application that is the essential web application of the solution. </TEMPLATE-REMOVE> <TEMPLATE-REMOVE IF-NOT='ui:blazor'> * `MyCompanyName.MyProjectName.HttpApi.Host`: ASP.NET Core API application that is used to expose the APIs to the clients. * `MyCompanyName.MyProjectName.Blazor`: ASP.NET Core Blazor Server application that is the essential web application of the solution. </TEMPLATE-REMOVE> <TEMPLATE-REMOVE IF-NOT='ui:angular'> * `MyCompanyName.MyProjectName.HttpApi.Host`: ASP.NET Core API application that is used to expose the APIs to the clients. * `angular`: Angular application. </TEMPLATE-REMOVE> </TEMPLATE-REMOVE>

Deploying the application

Deploying an ABP application is not different than deploying any .NET or ASP.NET Core application. However, there are some topics that you should care about when you are deploying your applications. You can check ABP's Deployment documentation before deploying your application.

Additional resources

You can see the following resources to learn more about your solution and the ABP Framework:

<TEMPLATE-REMOVE IF-NOT='BASIC'> * [ASP.NET Core MVC / Razor Pages: The Basic Theme](https://abp.io/docs/latest/framework/ui/mvc-razor-pages/basic-theme) </TEMPLATE-REMOVE> <TEMPLATE-REMOVE IF-NOT='LEPTONXLITE'> * [LeptonX Lite MVC UI](https://abp.io/docs/latest/ui-themes/lepton-x-lite/asp-net-core) </TEMPLATE-REMOVE> </TEMPLATE-REMOVE> <TEMPLATE-REMOVE IF-NOT='ui:blazor-server'> <TEMPLATE-REMOVE IF-NOT='BASIC'> * [Blazor UI: Basic Theme](https://abp.io/docs/latest/framework/ui/blazor/basic-theme?UI=BlazorServer) </TEMPLATE-REMOVE> <TEMPLATE-REMOVE IF-NOT='LEPTONXLITE'> * [LeptonX Lite Blazor UI](https://abp.io/docs/latest/ui-themes/lepton-x-lite/blazor?UI=BlazorServer) </TEMPLATE-REMOVE> </TEMPLATE-REMOVE> <TEMPLATE-REMOVE IF-NOT='ui:blazor'> <TEMPLATE-REMOVE IF-NOT='BASIC'> * [Blazor UI: Basic Theme](https://abp.io/docs/latest/framework/ui/blazor/basic-theme?UI=Blazor) </TEMPLATE-REMOVE> <TEMPLATE-REMOVE IF-NOT='LEPTONXLITE'> * [LeptonX Lite Blazor UI](https://abp.io/docs/latest/ui-themes/lepton-x-lite/blazor?UI=Blazor) </TEMPLATE-REMOVE> </TEMPLATE-REMOVE> <TEMPLATE-REMOVE IF-NOT='ui:angular'> <TEMPLATE-REMOVE IF-NOT='BASIC'> * [Angular UI: Basic Theme](https://abp.io/docs/latest/framework/ui/angular/basic-theme) </TEMPLATE-REMOVE> <TEMPLATE-REMOVE IF-NOT='LEPTONXLITE'> * [LeptonX Lite Angular UI](https://abp.io/docs/latest/ui-themes/lepton-x-lite/angular) </TEMPLATE-REMOVE> </TEMPLATE-REMOVE>