Project root customization¶
If you don't specify any option during, you will have a solution like shown below:
- Remove unused technologies from
.sln
file and coderepository
.
You might be consider removing unnecessary technologies.
Move
angular
folder from solution directory to respective user interface repository under user interfaces project group. Project names must be identical
- Following project related basic files available for reuse.
File Name | Description |
---|---|
.dockerignore | Files to be ignore when copying docker content. |
.editorconfig | File format and collection of text editor plugins for maintaining consistent coding styles between different editors and IDEs. |
.gitattributes | The .gitattributes file allows you to specify the files and paths attributes that should be used by git when performing git actions, such as git commit, etc. One of these attributes is the eol (end of line) and is used to configure the line endings for a file. |
.trivyignore | Vulnerability case number to be ignored when dockers are scanning. |
CHANGELOG.md | Changelog file. |
CONTRIBUTING.md | Guidelines for contributing to the project, including coding standards, commit message conventions, and the pull request process. |
common.props | MSBuild properties file used to define shared configuration settings, build properties, and variables that are commonly used across multiple projects in a solution. |
COPYING.md | Copyright file. |
delete-bin-obj-folders.ps1 | Script for cleaning bin and obj folders. |
install-libs.ps1 | Install NPM Packages for MVC / Razor Pages and Blazor Server UI types. |
LICENSE.md | Software license file. |
NuGet.Config | Nuget configuration for gitlab artifactory. |
README.md | ReadMe file. |
renovate.json5 | Renovate bot configuration for project. |
sonarqube-analysis.xml | This file is used to configure and provide details about the code analysis that SonarQube will perform on your project. |
common.props | Contains .csproj settings valid for all layers. |
VERSION | Release tag tracker, required for release-it git lab template. |
- Update basic gitlab ci template
File Name | Description |
---|---|
.gitlab-ci.yml | Base ci/cd pipeline for gitlab projects. |
- Update module name at nupkg creation scripts
File Name | Description |
---|---|
nupkg\common.ps1 | Update |
....
# List of projects
$projects = (
# project packages
"src/GridLab.PSSX.<ModuleName>.Application",
"src/GridLab.PSSX.<ModuleName>.Application.Contracts",
"src/GridLab.PSSX.<ModuleName>.Domain",
"src/GridLab.PSSX.<ModuleName>.Domain.Shared",
"src/GridLab.PSSX.<ModuleName>.EntityFrameworkCore",
"src/GridLab.PSSX.<ModuleName>.HttpApi",
"src/GridLab.PSSX.<ModuleName>.HttpApi.Client",
# "src/GridLab.PSSX.<ModuleName>.MongoDB",
"src/GridLab.PSSX.<ModuleName>.Web"
)
...
- Update configuration of the
.csproj
for each layer. Layer project names can be found at below;
src:
- GridLab.PSSX.<ModuleName>.Application
- GridLab.PSSX.<ModuleName>.Application.Contracts
- GridLab.PSSX.<ModuleName>.Domain
- GridLab.PSSX.<ModuleName>.Domain.Shared
- GridLab.PSSX.<ModuleName>.EntityFrameworkCore
- GridLab.PSSX.<ModuleName>.HttpApi
- GridLab.PSSX.<ModuleName>.HttpApi.Client
- GridLab.PSSX.<ModuleName>.MongoDB
- GridLab.PSSX.<ModuleName>.Web
Set TargetFramework
latest available framework version. In this example we used .net8
Use TargetFrameworks
if multi-targeting is required.
<PropertyGroup>
<TargetFramework>net8.0</TargetFramework>
</PropertyGroup>
<PropertyGroup>
<TargetFrameworks>net7.0;net8.0</TargetFramework>
</PropertyGroup>
Modify Description
property according to each layer
Description:
- GridLab.PSSX.<ModuleName>.Application:
<PropertyGroup>
<Description>Mediates between the presentation and domain Layers. Orchestrates business objects to perform specific application tasks. Implements use cases as the application logic for the module</Description>
</PropertyGroup>
- GridLab.PSSX.<ModuleName>.Application.Contracts:
<PropertyGroup>
<Description>Contains the module application service interfaces and the DTOs used by these interfaces</Description>
</PropertyGroup>
- GridLab.PSSX.<ModuleName>.Domain:
<PropertyGroup>
<Description>Module business objects and the core (domain) business rules. This is the heart of the application</Description>
</PropertyGroup>
- GridLab.PSSX.<ModuleName>.Domain.Shared:
<PropertyGroup>
<Description>Thin module layer that contains some types those belong to the Domain Layer, but shared with all other layers</Description>
</PropertyGroup>
- GridLab.PSSX.<ModuleName>.EntityFrameworkCore:
<PropertyGroup>
<Description>Essential integration package for the EF Core. Application's DbContext, database mappings, implementations of the repositories and other EF Core related stuffs</Description>
</PropertyGroup>
- GridLab.PSSX.<ModuleName>.HttpApi:
<PropertyGroup>
<Description>Contains HTTP APIs defined by the module</Description>
</PropertyGroup>
- GridLab.PSSX.<ModuleName>.HttpApi.Client:
<PropertyGroup>
<Description>Useful when you have a C# application that needs to consume your HTTP APIs. Once the client application references this project, it can directly inject and use the Application Services</Description>
</PropertyGroup>
- GridLab.PSSX.<ModuleName>.MongoDB:
<PropertyGroup>
<Description>Essential integration package for the MongoDB</Description>
</PropertyGroup>
- GridLab.PSSX.<ModuleName>.Web:
<PropertyGroup>
<Description> ASP.NET Core MVC / Razor Pages application module. This is the only executable application that serves the application and the APIs</Description>
</PropertyGroup>
Create software documentation for GridLab.PSSX.<ModuleName>.HttpApi layer to be used in Swagger interface.
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|AnyCPU'">
<DocumentationFile>GridLab.PSSX.<ModuleName>.HttpApi.xml</DocumentationFile>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|AnyCPU'">
<DocumentationFile>GridLab.PSSX.<ModuleName>.HttpApi.xml</DocumentationFile>
</PropertyGroup>
- Install
dotnet tools
locally but not globally therefore we can restore lately.
A .NET tool is a special NuGet package that contains a console application. You can install a tool on your machine as a local tool. See more under .NET Tool
The .NET CLI uses manifest files to keep track of tools that are installed as local to a directory. When the manifest file is saved in the root directory of a source code repository, a contributor can clone the repository and invoke a single .NET CLI command to install all of the tools listed in the manifest file.
dotnet tool install volo.abp.studio.cli --version X.Y.Z
dotnet tool install dotnet-ef --version X.Y.Z
dotnet tool install cyclonedx --version X.Y.Z
Replace version number with latest available.
This is going to create dotnet-tools.json
file under .config
folder.
- Trim unused localizations at <ModuleName>DomainSharedModule, keep only en, tr and de-DE languages at
<ModuleName>DomainSharedModule.cs
.
- If there is a bug in the
.EntityFrameworkCore.Tests
project, fix it as follows.
Configure<AbpDbContextOptions>(options =>
{
options.Configure(configurationContext =>
{
configurationContext.DbContextOptions.UseSqlite(sqliteConnection);
});
});