## Modular Monolith Application Development Tutorial
# Modular Monolith Application Development Tutorial
ABP provides a great infrastructure and tooling to build modular software solutions. In this tutorial, you will learn how to create application modules, compose and communicate them to build a monolith modular web application.
Follow the [Get Stared](../../get-started/layered-web-application.md) guide to create a new layered web application with [ABP Studio](../../studio/index.md) the following configuration:
Follow the [Get Stared](../../get-started/layered-web-application.md) guide to create a new layered web application with the following configuration:
* **Solution name**: `ModularCrm`
* **UI Framework**: ASP.NET Core MVC / Razor Pages
@ -8,7 +8,7 @@ Follow the [Get Stared](../../get-started/layered-web-application.md) guide to c
You can select the other options based on your preference.
> **Please complete the [Get Stared](../../get-started/layered-web-application.md) guide and run the web application.**
> **Please complete the [Get Stared](../../get-started/layered-web-application.md) guide and run the web application before going further.**
The initial solution structure should be like the following in ABP Studio's *Solution Explorer*:
@ -20,4 +20,6 @@ Initially, you see a `ModularCrm` solution and a `ModularCrm` module under that
`ModularCrm` module is your main application, which is a layered .NET solution that consists of several packages (.NET projects). You can expand the `ModularCrm` module to see its packages:
We've created the initial layered monolith solution. In the next part, we will learn how to create an application module, build functionality inside it and install it to the main application.
In this part, you will create a new module for product management and add it to the main application.
In this part, you will build a new module for product management and install it to the main CRM application.
You can create folders and sub-folders in *Solution Explorer* to better organize your solution. Right-click to the solution root on the *Solution Explorer* panel, and select Add -> New Folder command:
## Creating Solution Folders
You can create solution folders and sub-folders in *Solution Explorer* to better organize your solution components. Right-click to the solution root on the *Solution Explorer* panel, and select *Add* -> *New Folder* command:
Create `main` and `modules` folder using the *New Folder* command, then move the `ModularCrm` module into the `main` folder (simply by drag & drop). The *Solution Explorer* panel should look like below now:
Create `main` and `modules` folder using the *New Folder* command, then move the `ModularCrm` module into the `main` folder (simply by drag & drop). The *Solution Explorer* panel should look like the following figure now:
* May not contain a UI part to leave the UI development to the final application.
* May not contain a UI and leaves the UI development to the final application.
* May contain a single UI implementation that is typically in the same technology with the main application.
* May contain more than one UI implementation if you want to create a reusable application module and you want to make that module usable by different applications with different UI technologies. For example, all of [pre-built ABP modules](https://abp.io/modules) support multiple UI options.
In this tutorial, we are selecting the MVC UI since we are building that module only for our `ModularCrm` solution and we are using the MVC UI in the main application. So, select the MVC UI and click the *Next* button.
In this tutorial, we are selecting the MVC UI since we are building that module only for our `ModularCrm` solution and we are using the MVC UI in our application. So, select the MVC UI and click the *Next* button.
### Selecting the Database Provider
The next step is to select the database provider (or providers) you want to support with your module:
@ -47,6 +57,8 @@ The next step is to select the database provider (or providers) you want to supp
Since our main application is using Entity Framework Core and we will use the `ModularCrm.Products` module only for that main application, we can select the *Entity Framework Core* option and click the *Create* button.
### Exploring the New Module
After adding the new module, the *Solution Explorer* panel should look like the following figure:
As seen in the preceding figure, the `ModularCrm.Product` solution consists of several layers, each has own responsibility.
As seen in the preceding figure, the `ModularCrm.Product` solution consists of several layers, each has own responsibility.
### Installing the Product Module to the Main Application
A module does not contain an executable application inside. The `Modular.Products.Web` project is just a class library project, not an executable web application. A module should be installed to an executable application in order to run it.
The product module has no relation to the main application yet. Right-click to the `ModularCrm` module (inside the `main` folder) and select the *Import Module* command:
Select the `ModularCrm.Products` module and check the *Install this module* option. If you don't check that option, it only imports the module but doesn't setup project dependencies. Importing a module without installation can be used to manually setup your project dependencies. Here, we want to make it automatically, so checking the *Install this module* option.
When you click the OK button, ABP Studio opens the *Install Module* dialog: