You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
-[Lưu trử file media bằng Minio](#lưu-trử-file-media-bằng-minio)
28
+
-[Tự động dịch message](#tự-động-dịch-message)
29
+
-[Sơ lượt về Cấu trúc :mag_right:](#so-luot-ve-cau-truc)
30
+
-[Bắt đầu thôi nào](#bắt-đầu-thôi-nào)
31
+
-[Cách để chạy ứng dụng](#cách-để-chạy-ứng-dụng)
32
+
-[Hướng dẫn sử dụng](#hướng-dẫn-sử-dụng)
33
+
-[Authorize](#authorize)
34
+
-[Thêm một quyền mới vào ứng dụng](#thêm-một-quyền-mới-vào-ứng-dụng)
35
+
-[Bộ lọc](#bộ-lọc)
36
+
-[Phân trang](#phân-trang)
37
+
-[Công nghệ](#công-nghệ)
38
+
-[Hỗ trợ](#hỗ-trợ)
39
+
-[Lời cảm ơn](#lời-cảm-ơn)
40
+
-[Cấp phép](#cấp-phép)
41
+
7
42
# Mô Hình Kiến Trúc Sạch (Clean Architecture)
8
43
9
44
Template này được thiết kế dành cho các bạn backend làm việc với ASP.NET Core. Nó cung cấp một cách hiệu quả để xây dựng các ứng dụng enterprise một cách đơn giản bằng cách tận dụng lợi thế từ kiến trúc Clean Architecture và .NET Core framework.
10
45
11
46
Với template này, bạn sẽ có được zero configuration, không cần quan tâm đến cấu trúc, cài đặt, môi trường hoặc các thông lệ tốt nhất cho web API, vì tất cả đã được thiết lập :smiley:.
12
47
48
+
<divid='cho-minh-1sao-nhe'/>
49
+
13
50
# Cho mình 1 ⭐ nhé
14
51
15
52
Nếu bạn thấy template này hữu ích và học được điều gì đó từ nó, hãy cân nhắc cho mình một :star:.
@@ -43,7 +80,9 @@ Quy tắc phụ thuộc nói rằng các thành phần phụ thuộc hướng t
43
80
-**_Nguy cơ về cấu trúc quá phức tạp_**: Đối với các ứng dụng nhỏ, các tầng bổ sung có thể không cần thiết và dẫn đến sự phức tạp hóa.
44
81
-**_Hiệu năng bị suy giảm_**: Sự trích dẫn và trừa tượng(interface) giữa các tầng có thể giảm hiệu năng, tuy nhiên thường là không đáng kể.
45
82
46
-
# Features :rocket:
83
+
<divid='tinh-nang'/>
84
+
85
+
# Tính năng :rocket:
47
86
48
87
Có gì đặc biệt khiến cho template này trở nên khác biệt so với những template khác có trên Github?
-[8.1. Run .NET Core Clean Architecture Project](#81-run-net-core-clean-architecture-project)
30
+
-[8.2. Basic Usage](#82-basic-usage)
31
+
-[8.2.1. Authorize](#821-authorize)
32
+
-[8.2.2. Create role with permissions:](#822-create-role-with-permissions)
33
+
-[8.2.3. How to add new permissions in your app](#823-how-to-add-new-permissions-in-your-app)
34
+
-[8.2.4. Filtering](#824-filtering)
35
+
-[8.2.5. Pagination](#825-pagination)
36
+
-[9. Technology](#9-technology)
37
+
-[10. Support](#10-support)
38
+
-[11. Credits](#11-credits)
39
+
-[12. Licence](#12-licence)
40
+
41
+
42
+
# 2. .NET Core Clean Architecture The Template Introduction
8
43
9
44
This template is designed for backend developer working with ASP.NET Core. It provides you an efficient way to build enterprise applications effortlessly by leveraging advantages of clean architecture structre and .NET Core framework.
10
45
11
46
With this template, You'll benefit from zero configuration, and don't need to worry about struture, settings, environments or best practices for web APIs, because everything is already set up :smiley:.
12
47
13
-
# Give a Star! ⭐
48
+
# 3. Give a Star! ⭐
14
49
15
50
If you find this template helpful and learn something from it, please consider giving it a :star:.
16
51
17
52
Your support motivates me to deliver even better features and improvements in future versions.
18
53
19
-
# What is Clean Architecture?
54
+
# 4. What is Clean Architecture?
20
55
21
56
Clean Architecture is a software design philosophy introduced by Robert C. Martin (Uncle Bob). It emphasizes the separation of concerns and promotes the organization of code into layers, each with distinct responsibilities. The architecture's primary goal is to create systems that are independent of frameworks, UI, databases, and external agencies, allowing flexibility, scalability, and testability.
22
57
@@ -26,7 +61,7 @@ At its core, Clean Architecture organizes code into concentric circles, with eac
26
61
27
62
The dependency rule states that code dependencies should only point inward, ensuring that inner layers remain isolated from external layers.
28
63
29
-
### Advandtage
64
+
### 4.0.1 Advandtage
30
65
31
66
-**_Seperation of Concerns_**: Each layer is responsible for a specific aspect of the application, making the code easier to understand and maintain.
32
67
-**_Testability_**: Since business logic is decoupled from frameworks and UI, unit testing becomes simpler and more reliable.
@@ -35,15 +70,15 @@ The dependency rule states that code dependencies should only point inward, ensu
35
70
-**_Scalability_**: The clear structure supports growth and the addition of new features without significant refactoring.
36
71
-**_Framework Independence_**: Avoids being locked into a specific framework, making it easier to migrate to newer technologies.
37
72
38
-
### Disadvandtage
73
+
### 4.0.2. Disadvandtage
39
74
40
75
-**_Complexity_**: The layered structure can add complexity, especially for smaller projects where simpler architectures might suffice.
41
76
-**_Initial Overhead_**: Setting up Clean Architecture requires additional effort to organize layers and follow strict design principles.
42
77
-**_Learning Curve_**: Developers unfamiliar with the principles may take time to grasp the structure and its benefits.
43
78
-**_Over-Engineering Risk_**: For small-scale applications, the additional layers might be unnecessary and lead to over-complication.
44
79
-**_Performance Overhead_**: The abstraction and indirection between layers can introduce slight performance trade-offs, though typically negligible.
45
80
46
-
# Features :rocket:
81
+
# 5. Features :rocket:
47
82
48
83
What makes this Clean Architecture template stand out from the rest?
**_Domain_**: Domain layer serves as the core of clean architecture application and contains key elements such as:
153
188
@@ -261,9 +296,9 @@ _It depends on Application and Infrastructure layer_
261
296
262
297
**_Contract_** : Contains shared components for Application, Infrastructure and API layer.
263
298
264
-
# Getting started
299
+
# 8. Getting started
265
300
266
-
## Run .NET Core Clean Architecture Project
301
+
## 8.1. Run .NET Core Clean Architecture Project
267
302
268
303
The following prerequisites are required to build and run the solution:
269
304
@@ -362,9 +397,9 @@ dotnet run
362
397
363
398
Congrat! you are all set up :tada::tada::tada::clap:
364
399
365
-
## Basic Usage
400
+
## 8.2. Basic Usage
366
401
367
-
### Authorize:
402
+
### 8.2.1. Authorize
368
403
369
404
To Achieve this, let's add AuthorizeBy attribute on controller
370
405
@@ -382,7 +417,7 @@ To Achieve this, let's add AuthorizeBy attribute on controller
382
417
}
383
418
```
384
419
385
-
### Create role with permissions:
420
+
### 8.2.2. Create role with permissions:
386
421
387
422
Json payload is like
388
423
@@ -403,7 +438,7 @@ Json payload is like
403
438
}
404
439
```
405
440
406
-
### How to add new permissions in your app
441
+
### 8.2.3. How to add new permissions in your app
407
442
408
443
To get this, let's navigate to constants folder in Infrastructure layer, then open Credential.cs file and pay your attention on PermissionGroups Dictionary
409
444
@@ -467,7 +502,7 @@ public static class ObjectPermission
467
502
468
503
Define your new one, then push it into PermissionGroups dictionary, and restart application.
469
504
470
-
### Filtering
505
+
### 8.2.4. Filtering
471
506
472
507
To do filter in this template, we use LHS Brackets.
473
508
@@ -567,7 +602,7 @@ To Apply dynamic filter, you just call any list method at Repository class
567
602
);
568
603
```
569
604
570
-
### Pagination
605
+
### 8.2.5. Pagination
571
606
572
607
This template supports offset pagination and cursor pagination.
573
608
@@ -672,7 +707,7 @@ To Enable cursor pagination just add this line
672
707
```
673
708
674
709
675
-
# Technology
710
+
# 9. Technology
676
711
677
712
- .NET 8
678
713
- EntityFramework core 8
@@ -681,15 +716,18 @@ To Enable cursor pagination just add this line
681
716
- Medator
682
717
- XUnit, FluentAssertion, Respawn
683
718
- OpenTelemetry
719
+
- PostgreSQL
684
720
- Redis
685
721
- ElasticSearch
686
722
- Serilog
723
+
- Docker
724
+
- Github Workflow
687
725
688
-
# Support
726
+
# 10. Support
689
727
690
728
If you are having problems, please let me know by issue section.
691
729
692
-
# Credits
730
+
# 11. Credits
693
731
694
732
:heart: Thank you guys so much :heart::pray:.
695
733
@@ -711,6 +749,6 @@ If you are having problems, please let me know by issue section.
711
749
-[Clean testing by Jayson Taylor](https://github.com/jasontaylordev/CleanArchitecture/tree/main/tests)\
712
750
An inspiring repository of testing best practices, showcasing how to write robust and meaningful tests to ensure the reliability of clean architecture-based projects.
713
751
714
-
# Licence
752
+
# 12. Licence
715
753
716
754
This project is licensed with the [MIT license](LICENSE).
0 commit comments