Skip to content

A Microservice System template repository based on Clean Architecture and ASP.NET Core Blazor Web Assembly

License

Notifications You must be signed in to change notification settings

CleanMicroservice/CleanMicroserviceSystem

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

CleanMicroserviceSystem

Clean Microservice System

A Microservice System template repository based on Clean Architecture and ASP.NET Core Blazor Web Assembly.

Documents

Read The Docs

Status

Nuget Packages

## Generate Database Migrations code file
  1. Select CleanMicroserviceSystem.Tethys.WebAPI or your specified project as Startup project;
  2. Open Package Manager Console in Visual Studio;
  3. Select CleanMicroserviceSystem.Tethys.Infrastructure as Default project in Package Manager Console;
  4. Input below commands and execute;

Screenshots

Commands

Command Description
Get-Help entityframework Displays information about entity framework commands.
Add-Migration Creates a migration by adding a migration snapshot.
Remove-Migration Removes the last migration snapshot.
Update-Database Updates the database schema based on the last migration snapshot.
Script-Migration Generates a SQL script using all the migration snapshots.
Scaffold-DbContext Generates a DbContext and entity type classes for a specified database. This is called reverse engineering.
Get-DbContext Gets information about a DbContext type.
Drop-Database Drops the database.

For examples:

## To generate database migration code files automatically
Add-Migration AddGenericOption_WebAPILog
## To execute database migration code files and apply modifications to current connected database file
Update-Database

Layouts

WebUI

This layer is a web application. This layer depends on both the Application and Infrastructure layers, however, the dependency on Infrastructure is only to support dependency injection. Therefore only Startup.cs should reference Infrastructure.

Infrastructure

This layer contains classes for accessing external resources such as file systems, web services, smtp, and so on. These classes should be based on interfaces defined within the application layer.

Application

This layer contains all application logic. It is dependent on the domain layer, but has no dependencies on any other layer or project. This layer defines interfaces that are implemented by outside layers. For example, if the application need to access a notification service, a new interface would be added to application and an implementation would be created within infrastructure.

Domain

This will contain all entities, enums, exceptions, interfaces, types and logic specific to the domain layer.

Overview

  • Web UI/API
  • Infrastructure
    • Common
    • Extension
    • Identity
    • Persistence
      • DBContext
      • Migrations
    • Services
    • ConfigureServices.cs
  • Applications
    • Common
      • Behavious
        • IPipelineBehavior implementations of MediatR
      • Exceptions
      • Mappings
      • Models (DTO)
      • Attribute
    • Configurations
    • Interfaces
      • Repositories
    • Extensions
    • Exceptions
    • Features
      • {BusinessDomainEntity}
        • Commands
          • [Create/Update/Delete/Import]{Entity}
            • Command.cs
              • Inject Reader
              • Inject Writer
            • CommandValidator.cs
        • Queries
          • Get{Entity}WithPagination
            • Query.cs
              • Inject Reader
            • QueryValidator.cs
        • EventHandlers
    • ConfigureServices.cs
  • Domain
    • Common
      • BaseAuditableEntity.cs
      • BaseEntity.cs
      • BaseEvent.cs
      • ValueObject.cs
    • Entities
    • Enums
    • Events
    • Exceptions
    • ValueObjects

TODO List

  • Tethys - TemplateService
    • 泰西斯,Oceanus的妻子。是希腊神话中的海之女神。她是希腊第一位、最初的海洋女神,因此在希腊语中,泰西斯也是“祖母”的意思,在早期神话中,她是一位创世女神。她与大洋神俄刻阿诺斯生下的众多子女里,每一个孩子都代表着小溪、河流或者大海。
  • Oceanus - CommonLibrary
    • 俄刻阿诺斯,Tethys 的丈夫。十二提坦神,水神大洋神,他是那条环绕着宇宙转动的河流腰带,故而他的结尾也是开端:这条宇宙之河自我组成一个圆圈在转动。
  • Uranus - Gateway
    • 乌拉诺斯,第一代神王、天空之神。从大地之神盖亚的指端诞生,最初作为宇宙统治者的第一代众神之王、即天空的神格化。象征希望与未来,并代表天空。十二泰坦巨神。
  • Prometheus - LogService
    • 普罗米修斯曾与智慧女神雅典娜共同创造了人类,普罗米修斯负责用泥土雕塑出人的形状,雅典娜则为泥人灌注灵魂,并教会了人类很多知识。普罗米修斯还反抗宙斯,将火种带到人间。
  • Themis - IdentityServer
    • 忒弥斯(Θεμις / Themis,“法律”)是法律和正义的象征。忒弥斯是宙斯最尊重最信任的妻子。是秩序的创造者、守护者。
  • Aphrodite - WebUI
    • 阿佛洛狄忒,是古希腊神话中爱情与美丽的女神,同时也是性欲女神,奥林匹斯十二主神之一。因其诞生于海洋,所以有时还被奉为航海的庇护神。阿佛洛狄忒生于海中浪花,拥有白瓷般的肌肤、金发碧眼和古希腊女性完美的身材和相貌,象征女性的美丽,被认为是女性身体美的最高象征。
  • Astra - NuGet
    • 阿斯特拉,星辰之神,阿斯特赖俄斯与厄俄斯诸子,数量不定。

About

A Microservice System template repository based on Clean Architecture and ASP.NET Core Blazor Web Assembly

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages