Skip to content

abpframework/modular-monolith-demo

Repository files navigation

Shopularity

About This Solution

This is an example modular monolith application built with ABP Framework and .NET.

This project is in progress and not ready yet. Once it is ready, it will be announced.

Pre-requirements

Before Running the Application

Initializing the Application

You can run the initialize-project.ps1 in the root directory which runs all the necessary steps before running the application. These steps are migrating the database, installing client-side libraries and generating a signing certificate. You can also do these steps manually with the below sections.

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 when you created the solution, 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:

dotnet dev-certs https -v -ep openiddict.pfx -p c2aeb07f-c57f-4df6-9819-daacd6811c9a

c2aeb07f-c57f-4df6-9819-daacd6811c9a 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: OpenIddict Certificate Configuration

Also, see the Configuring OpenIddict documentation for more information.

Install Client-Side libraries

Run the following command in your solution directory. This step is automatically done when you create a new solution, if you didn't especially disabled it. However, you should run it yourself if you have first cloned this solution from your source control, or added a new client-side package dependency to your solution.

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.

Migrating the Database

The application needs a database. Run the following command in the Shopularity project directory to migrate the database and seed the initial data. This step is automatically done when you create a new solution, if you didn't especially disable it.

dotnet run --migrate-database

This command will create and seed the initial database. Then you can run the application with any IDE that supports .NET.

Default Credentials

The admin user credentials are:

  • USERNAME: admin
  • PASSWORD: 1q2w3E*

How to Run?

There are 2 projects to run:

  • Shopularity.Admin: Firstly run this project because Shopularity.Public project depends on this project.
  • Shopularity.Public: Secondly run this project. It's the public facing website.

run-apps.ps1 in the root directory helps you to run both projects.

Deploying the Application

Deploying an ABP application follows the same process as deploying any .NET or ASP.NET Core application. However, there are important considerations to keep in mind. For detailed guidance, refer to ABP's deployment documentation.

How to Deploy on Docker?

The application provides the related Dockerfiles and docker-compose file with scripts. You can build the docker images and run them using docker-compose. The necessary database, DbMigrator, and the application will be running on docker with health checks in an isolated docker network.

Creating the Docker images

Navigate to etc/build folder and run the build-images-locally.ps1 script. You can examine the script to set image tag for your images. It is latest by default.

Running the Docker Images using Docker-Compose

Navigate to etc/docker folder and run the run-docker.ps1 script. The script will generate developer certificates (if it doesn't exist already) with dotnet dev-certs command to use HTTPS. Then, the script runs the provided docker-compose file on detached mode.

Not: Developer certificate is only valid for localhost domain. If you want to deploy to a real DNS in a production environment, use LetsEncrypt or similar tools.

Stopping the Docker Containers

Navigate to etc/docker folder and run the stop-docker.ps1 script. The script stops and removes the running containers.

Additional resources

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

About

Modular Monolith Demo Application with .NET and ABP Framework

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 4

  •  
  •  
  •  
  •