Skip to content

Project root customization

Depending on development journey, you will have a solution like shown below:

  • Remove unused technologies from .sln file and code repository.

You might be consider removing unnecessary technologies.

  • 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.
docker-compose.infrastructure.yml This file defines the core infrastructure services required for the project to function. It includes services such as databases, message brokers, caching systems, and other dependencies that are essential for the application to run.
docker-compose.infrastructure.override.yml This file is used to extend the base configuration of infrastructure services for specific environments or use cases.
docker-compose.migrations.yml Docker Compose configuration file specifically designed to manage database migrations for the application.
docker-compose.yml Docker Compose configuration file specifically for the application.
docker-compose-only.ps1 Only composes docker stack without building existing dotnet core projects.
docker-infrastructure-run.ps1 Starts all infrastructure services defined in the docker-compose.infrastructure file.
docker-infrastructure-stop.ps1 Stops all infrastructure services defined in the docker-compose.infrastructure file.
docker-run.ps1 Builds projects after that creates docker images by using Docker.Local file and last compose docker containers.
docker-stop.ps1 Stops composed stack with docker-run.ps1.
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.
  • 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 DomainModule, keep only en, tr and de-DE languages at PSSXAuthServerModule.cs.
public override void ConfigureServices(ServiceConfigurationContext context)
{
    Configure<AbpLocalizationOptions>(options =>
    {
        options.Languages.Add(new LanguageInfo("en", "en", "English"));
        options.Languages.Add(new LanguageInfo("tr", "tr", "Türkçe"));
        options.Languages.Add(new LanguageInfo("de-DE", "de-DE", "Deutsche"));
    });
}

Delete unused language .json files under Localization\PSSX folder in GridLab.PSSX.Domain.Shared layer.

  • Remove IdentityDataSeeder and IdentityDataSeedContributor which is part of the Volo.Abp.Identity module at DomainModule.
public override void ConfigureServices(ServiceConfigurationContext context)
{
    IEnumerable<ServiceDescriptor> identityDataSeeders = context.Services.ToList().Where(service => service.ImplementationType == typeof(IdentityDataSeeder));
    if (identityDataSeeders.Any())
    {
        foreach (var dataSeeder in identityDataSeeders.ToArray())
        {
            bool result = context.Services.Remove(dataSeeder);
        }
    }

    IEnumerable<ServiceDescriptor> identityDataSeedContributors = context.Services.ToList().Where(service => service.ImplementationType == typeof(IdentityDataSeedContributor));
    if (identityDataSeedContributors.Any())
    {
        foreach (var contributor in identityDataSeedContributors.ToArray())
        {
            bool result = context.Services.Remove(contributor);
        }
    }
}
  • Configure Emailing module at DomainModule.
public override void ConfigureServices(ServiceConfigurationContext context)
{
    Configure<EmailOptions>(options =>
    {
        options.FromAddress = configuration["Email:FromAddress"];
        options.UserName = configuration["Email:UserName"];
    });
}
  • Add PSSXHangfireDbContext, PSSXHangfireDbContextFactory, PSSXHangfireDbContextSchemaMigrator and PSSXHangfireModelCacheKeyFactory database context and related build time related services to EntityFrameworkCore.

  • Add PSSXMiniProfilerDbContext and PSSXMiniprofilerDbContextSchemaMigrator database context and related build time related services to EntityFrameworkCore.

  • Separate Host and Tenant's database context as PSSXTenantDbContext and PSSXTenantDbContext at EntityFrameworkCore.

  • Add custom PSSXIdentityDataSeeder for seeding new platform admin and tenant admin.

public async virtual Task<IdentityDataSeedResult> SeedAdminAsync(string adminEmail, string adminPassword, string? adminUserName = null, Guid? tenantId = null)
{
    Check.NotNullOrWhiteSpace(adminEmail, nameof(adminEmail));
    Check.NotNullOrWhiteSpace(adminPassword, nameof(adminPassword));

    using (CurrentTenant.Change(tenantId))
    {
        await IdentityOptions.SetAsync();

        var result = new IdentityDataSeedResult();

        // default admin user name ise adrian
        if (adminUserName == null)
            adminUserName = "adrian";

        var adminUser = await UserRepository.FindByNormalizedUserNameAsync(
            LookupNormalizer.NormalizeName(adminUserName)
        );

        if (adminUser != null)
        {
            return result;
        }

        adminUser = new IdentityUser(
            GuidGenerator.Create(),
            adminUserName,
            adminEmail,
            tenantId
        )
        {
            Name = adminUserName
        };

        adminUser.SetShouldChangePasswordOnNextLogin(true); // Force user to change password on next login

        (await UserManager.CreateAsync(adminUser, adminPassword, validatePassword: false)).CheckErrors();
        result.CreatedAdminUser = true;

        //"admin" role
        const string adminRoleName = "admin";
        var adminRole = await RoleRepository.FindByNormalizedNameAsync(LookupNormalizer.NormalizeName(adminRoleName));
        if (adminRole == null)
        {
            adminRole = new IdentityRole(
                GuidGenerator.Create(),
                adminRoleName,
                tenantId
            )
            {
                IsStatic = true,
                IsPublic = true
            };

            (await RoleManager.CreateAsync(adminRole)).CheckErrors();
            result.CreatedAdminRole = true;
        }

        (await UserManager.AddToRoleAsync(adminUser, adminRoleName)).CheckErrors();

        return result;
    }
}