git clone [email protected]:shengyu-kmust/SnailAspNetCoreFramework.git
git clone [email protected]:shengyu-kmust/Snail.git
cd SnailAspNetCoreFramework
dotnet build
The following is a demonstration diagram based on the v1.0 version
--ApplicationCore // The core abstraction layer adopts clear architecture mode and does not depend on other layers. The other three projects all rely on this type of library and are responsible for public definitions of interfaces, constants, enumerations, dtos, entities, etc.
----Const // Constant definition, such as configuration constants, event name constants
----Dtos // all dtos
----Entities // All entities
----Enums // enumeration
----IServices //Abstract definition of Service layer
----Utilities // Help class
--Infrastructure //The infrastructure layer provides data services to the upper layers (such as service layer and application layer).
----Data/config // Database entityframework fluent api configuration
----EFValueConverter // Conversion between entityframework database type and clr type, such as enumeration conversion
----Migrations //Generate directory for migration of entityframework code first
--Service // Service layer, used to implement the service interface in ApplicationCore, the main layer for the application logic implementation
----Cache // Cache implementation, which will be removed and extracted to the Snail project later.
----Interceptor //Interceptor implemented by default
----BaseService.cs //The base class of each service contains the common methods of each service, such as CRUD
----InitDatabaseService.cs // Responsible for database data initialization
----InterceptorService.cs //Interceptor base class
--Web // Responsible for all related processing of input and output of interface parameters (such as parameter verification, output format reservation, etc.)
----AutoFacModule // autofac injection configuration
----AutoMapperProfiles // automapper configuration
----ClientApp // Front-end project
------build // Output directory generated by front-end compilation
------mock // Front-end mock
------src // Front-end core code
----CodeGenerater //T4 module and related logic for code generation
----ConfigureServicesExtensions // ServiceProvider injection extensions to avoid writing them in the startup file
----Controllers //Controllers
----docs // Document set
----Dto // The dto class will only be used in the web layer
----Filter // filter
----Hubs // signalr
----Permission //Default implementation of permissions
----staticFile // Used to store uploaded files
DDD is used, but different technologies of DDD must be applied according to the size of the project. Generally speaking, it is divided into the following projects
Domain driven, if it depends on other layers, it depends on the interface of the corresponding layer rather than the implementation.
Use repository and unit of work modes, but use the repository mode that comes with EF.
1. git clone this project 2. Configure codeGenerate.json 3. Run this project, and after logging in to swagger, run the codeGenerate interface 4. Run add-migration 5. Start the project
SnailAspNetCoreFramework Framework Series Blog
1. Introduction and general design ideas of each project and directory within the framework - SnailAspNetCoreFramework rapid development framework
2. Interface input verification, output format, and exception handling—SnailAspNetCoreFramework rapid development framework backend design
3. Universal permission design - SnailAspNetCoreFramework rapid development framework back-end design
4. How to provide good interface documents (Swagger) to the front-end - SnailAspNetCoreFramework rapid development framework back-end design
5. Cache usage in various scenarios—SnailAspNetCoreFramework rapid development framework backend design
6. Castle-based AOP design and common cache, performance, log interceptor implementation - SnailAspNetCoreFramework rapid development framework back-end design
7. Introduction to dependency injection - autofac - SnailAspNetCoreFramework rapid development framework back-end design
8. Why use Eventbus and how to use it - SnailAspNetCoreFramework rapid development framework back-end design
9. Introduction to Nlog, the log component - SnailAspNetCoreFramework rapid development framework back-end design
10.Mediatr introduction - SnailAspNetCoreFramework rapid development framework back-end design
11. Universal CRUD design for controller, service, and dal layers—SnailAspNetCoreFramework rapid development framework backend design
12. Object mapping tool automapper - SnailAspNetCoreFramework rapid development framework back-end design
13. How to monitor the sql statements generated by EF - SnailAspNetCoreFramework rapid development framework back-end design
14. Introduction to several deployment methods of .net core - SnailAspNetCoreFramework rapid development framework back-end design
15. real-time communication signalr - SnailAspNetCoreFramework rapid development framework back-end design
16. How to use ef code first to continuously iterate the database version of the project - SnailAspNetCoreFramework rapid development framework back-end design
17. Introduction to the automatic code generation function—SnailAspNetCoreFramework rapid development framework back-end design
18. How to monitor whether each function of the project is normal (HealthCheck) - SnailAspNetCoreFramework rapid development framework back-end design
19. Introduction to hangfire for scheduled tasks—SnailAspNetCoreFramework rapid development framework backend design
20. Overall introduction to the front-end—SnailAspNetCoreFramework rapid development framework front-end design
21. No more begging for back-end interfaces (use of MOCK) - SnailAspNetCoreFramework rapid development framework front-end design
22. Front-end permission control - SnailAspNetCoreFramework rapid development framework front-end design
23. How to avoid repeatedly writing front-end CRUD code (introduction and use of various SnailXXX components in the front-end) - SnailAspNetCoreFramework rapid development framework front-end design
24. Introduction to request proxy - SnailAspNetCoreFramework rapid development framework front-end design