Skip to content
This repository has been archived by the owner on Jun 14, 2021. It is now read-only.
/ MilNet Public archive

MilNet provides a ready-to-use template for your ASP.NET Core applications

License

Notifications You must be signed in to change notification settings

amilochau/MilNet

Repository files navigation

Build Status

MilNet package project

MilNet is a set of .NET Core libraries. MilNet provides a ready-to-use template for your ASP.NET Core applications, with the following features:

  • Open API (Swagger)
  • Connection to basic services to send feedbacks, emails
  • Application contacts information
  • Application last release information
  • Authentication/Authorization management with IdentityServer4
  • Logging with ElasticSearch
  • Privacy and Cookies management (RGPD)
  • Basic healthchecks

Other utilities are included into MilNet:

  • Exceptions for Forbidden and Not Found responses
  • CSV-like files interpretation
  • Service to create HTTP requests with .NET Core Http Request Factory

MilNet works well with a vue.js Front application, using MilNode packages.

Warning! Watch the [Obsolete] attributes into the source code, they indicate features that will be deleted on the next major version!

Contribute

If you want to propose a feature or to report a bug, please create a new issue. If you want to propose code source changes, please follow the steps below.

  1. Installation process From your local computer, clone the repository.

    • dotnet restore to install all dependencies
    • dotnet run to build MilNet as a library
  2. GitFlow Please follow the GitHub Flow:

    • Create a branch from master
    • Commit your code changes
    • Create a Pull Request to merge into the master branch
  3. Conditions to complete Pull Request To ensure minimal quality, branch policies have been set up for pull requests to the master branch:

    • A new build must be validated before each pull request
    • A project administrator must validate the code changes

Installation and Usage

  1. Import MilNet in your ASP.NET Core project with Import-Package MilNet.Services.AspNetCore
  2. Create your IWebHostBuilder with the ConfigureMilNetServices extension, as in the Program.cs file:
    public static IWebHostBuilder CreateWebHostBuilder(string[] args) =>
        WebHost.CreateDefaultBuilder(args)
            .ConfigureMilNetServices()
            .UseStartup<Startup>();
  3. Configure your IServiceCollection with the AddMilNetServices extension, as in the Startup.cs file:
    public void ConfigureServices(IServiceCollection services)
    {
        services.AddMilNetServices(configuration.GetSection("Services");
        services.AddMvc().SetCompatibilityVersion(CompatibilityVersion.Version_2_2);
    }
  4. Configuration your IApplicationBuilder with the UseMilNetServices extension, as in the Startup.cs file:
    public void Configure(IApplicationBuilder app, IHostingEnvironment env)
    {
        app.UseMilNetServices();
        app.UseMvcWithDefaultRoute();
    }
  5. Configure MilNet in your appsettings.json file:
    {
      "ConnectionStrings": {
        "DefaultConnection": "XXX"
      },
      "Logging": {
        "LogLevel": {
          "Default": "Warning"
        }
      },
      "AllowedHosts": "*",
      "Services": {
        "ApplicationName": "MyAppName",
        "Log": {
          "ElasticSearchUrl": "http://localhost:9200"
        },
        "Contact": {
          "Business": {
            "Email": "business-support@mysite.com",
            "Place": "Paris, France",
            "Url": "http://mysite.com/business-support",
            "Users": [
              {
                "FirstName": "Antoine",
                "LastName": "Milochau",
                "Email": "antoine.milochau@mysite.com",
                "Place": "Paris, France"
              }
            ]
          },
          "Technical": {
            "Email": "technical-support@mysite.com",
            "Place": "Paris, France",
            "Url": "http://mysite.com/technical-support",
            "Users": []
          }
        },
        "Release": {
          "Definition": "Development",
          "Name": "No release"
        }
      }
    }

Obsolete features

Watch the [Obsolete] attributes into the source code, they indicate features that will be deleted on the next major version.

About

MilNet provides a ready-to-use template for your ASP.NET Core applications

Topics

Resources

License

Code of conduct

Stars

Watchers

Forks

Sponsor this project

 

Packages

No packages published

Languages