GithubHelp home page GithubHelp logo

cenny26 / techecommerce-server Goto Github PK

View Code? Open in Web Editor NEW
1.0 1.0 0.0 155 KB

A web application about a technology e-commerce that a back-side coding with ASP.NET Core Web API.

C# 100.00%
clear-architecture onion-architecture

techecommerce-server's Issues

Azure Key Vault (User Secrets)

Storing Confidential Information Using Azure Key Vault:
Azure Key Vault is a service used to securely store and manage confidential information. Here is a step-by-step guide on how to use it:

  • Create Azure Key Vault - first, create a Key Vault via Azure Portal and add all secret information there.
  • Add Azure SDK to Project - add Azure Key Vault SDK to project. We can use Microsoft.Extensions.Configuration.AzureKeyVault NuGet package.
  • Set Up Configuration - add Azure Key Vault to the configuration in the Program.cs or Startup.cs file:
public static IHostBuilder CreateHostBuilder(string[] args) =>
        Host.CreateDefaultBuilder(args)
            .ConfigureAppConfiguration((context, config) =>
            {
                var builtConfig = config.Build();
                var keyVaultEndpoint = builtConfig["AzureKeyVault:VaultUri"];
                
                if (!string.IsNullOrEmpty(keyVaultEndpoint))
                {
                    var azureServiceTokenProvider = new AzureServiceTokenProvider();
                    var keyVaultClient = new KeyVaultClient(
                        new KeyVaultClient.AuthenticationCallback(
                            azureServiceTokenProvider.KeyVaultTokenCallback));
                    
                    config.AddAzureKeyVault(keyVaultEndpoint, keyVaultClient, new DefaultKeyVaultSecretManager());
                }
            })
            .ConfigureWebHostDefaults(webBuilder =>
            {
                webBuilder.UseStartup<Startup>();
            });
  • Storing Azure Key Vault Information in Configuration - we can store Azure Key Vault information in the appsettings.json or appsettings.Development.json file:
{
  "AzureKeyVault": {
    "VaultUri": "https://your-key-vault-name.vault.azure.net/"
  }
}

Dependencies in the application layer

Dependencies in the Application layer must be refactored over time. In a project built on the Onion architecture, the Application layer must contain few dependencies. The dependencies must be coded under the service name in the appropriate layers and called in the handler classes in the CQRS pattern. Thus, the handler classes will be more readable, and the correct structure of our codes will be preserved in terms of architecture...

Azur Blob Storage Service

In the current project, I have built an architectural storage service using the benefits of object-oriented programming. It is possible to change the storage service in the project only with a configuration in the Program.cs file. I'd love to use the AzureService I've coded extensively here, as per the project's wishes, but the very high asking price for the Blob Storage Service in the Azure Portal discourages me from doing so. Therefore, until the end of the project, I will use LocalService out of necessity. Again, I have no doubt that I will use clean and meaningful naming for as many files as possible in the project. I'm hoping to use AzureService as storage in my project once I have an account in the Azure Portal at some point...

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.