Skip to content

Commit 6ab14e9

Browse files
chore: update ci, readme,docker -compose file
1 parent 3f1fceb commit 6ab14e9

4 files changed

Lines changed: 57 additions & 60 deletions

File tree

β€Ž.github/workflows/github-cicd.ymlβ€Ž

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -100,8 +100,8 @@ jobs:
100100
with:
101101
images: ${{ vars.REGISTRY }}/${{ github.actor }}/${{ vars.IMAGE_NAME }}
102102
tags: |
103-
type=sha,format=long
104-
type=raw,value=latest,enable={{is_default_branch}}
103+
type=raw,value=${{ github.ref_name }}-${{ github.sha }}
104+
type=raw,value=${{ github.ref_name }}
105105
- name: Build and push
106106
uses: docker/build-push-action@v6
107107
with:
@@ -128,7 +128,8 @@ jobs:
128128
port: 22
129129
script: |
130130
echo "${{ secrets.PWD_TOKEN }}" | docker login ${{ vars.REGISTRY }} -u ${{ github.actor }} --password-stdin
131-
docker pull ${{ vars.REGISTRY }}/${{ github.actor }}/${{ vars.IMAGE_NAME }}:latest
131+
docker pull ${{ vars.REGISTRY }}/${{ github.actor }}/${{ vars.IMAGE_NAME }}:${{ github.ref_name }}
132132
cd ${{ secrets.APP_PATH }}
133-
docker compose down
134-
docker compose up -d --build
133+
docker compose up -d
134+
docker image prune -f
135+
docker logout ${{ vars.REGISTRY }}

β€ŽREADME-VIETNAMESE.mdβ€Ž

Lines changed: 48 additions & 51 deletions
Original file line numberDiff line numberDiff line change
@@ -144,85 +144,83 @@ CΓ³ gΓ¬ Δ‘αΊ·c biệt khiαΊΏn cho template nΓ y trở nΓͺn khΓ‘c biệt so vα»›i
144144

145145
```
146146
/Domain
147-
β”œβ”€β”€ /Aggregates/ # Domain aggregates (entities with business rules)
148-
└── /Common/ # Shared domain logic
147+
β”œβ”€β”€ /Aggregates/ # CΓ‘c Aggregate trong Domain (entity chα»©a quy tαΊ―c nghiệp vα»₯)
148+
└── /Common/ # Logic domain dΓΉng chung
149149
```
150150

151151
```
152152
/Application
153153
β”œβ”€β”€ /Common
154-
β”‚ β”œβ”€β”€ /Auth/ # Authentication & authorization helpers (policy builders, claim extractors)
154+
β”‚ β”œβ”€β”€ /Auth/ # Tiện Γ­ch xΓ‘c thα»±c & phΓ’n quyền (xΓ’y dα»±ng policy, trΓ­ch xuαΊ₯t claim)
155155
β”‚ β”œβ”€β”€ /Behaviors/ # MediatR pipeline behaviors (logging, validation, transaction, caching)
156-
β”‚ β”œβ”€β”€ /ErrorCodes/ # Centralized error code definitions for the whole app
157-
β”‚ β”œβ”€β”€ /Errors/ # Error result & problem details mappings
158-
β”‚ β”œβ”€β”€ /Interfaces/ # Application-level interfaces (services, repos, abstractions)
159-
β”‚ β”œβ”€β”€ /RequestHandler/ # Parsing, validating & normalizing request
160-
β”‚ β”œβ”€β”€ /Security/ # Security helpers (permission attributes, role metadata)
161-
β”‚ └── /Validators/ # Global validators used across features
156+
β”‚ β”œβ”€β”€ /ErrorCodes/ # Định nghΔ©a mΓ£ lα»—i tαΊ­p trung cho toΓ n bα»™ α»©ng dα»₯ng
157+
β”‚ β”œβ”€β”€ /Errors/ # Ánh xαΊ‘ kαΊΏt quαΊ£ lα»—i & problem details
158+
β”‚ β”œβ”€β”€ /Interfaces/ # Interface tαΊ§ng Application (service, repository, abstraction)
159+
β”‚ β”œβ”€β”€ /RequestHandler/ # PhΓ’n tΓ­ch, validate & chuαΊ©n hΓ³a query parameters
160+
β”‚ β”œβ”€β”€ /Security/ # Tiện Γ­ch bαΊ£o mαΊ­t (attribute phΓ’n quyền, metadata role)
161+
β”‚ └── /Validators/ # Lα»›p abstract FluentValidation dΓΉng chung
162162
β”‚
163-
β”œβ”€β”€ /Features # Vertical slices styles (CQRS + MediatR)
164-
β”‚ β”œβ”€β”€ /AuditLogs/ # Commands & queries to manage audit logs
165-
β”‚ β”œβ”€β”€ /Permissions/ # Permission management
166-
β”‚ β”œβ”€β”€ /QueueLogs/ # Query logs for background queue jobs
167-
β”‚ β”œβ”€β”€ /Regions/ # Region-based CQRS handlers
168-
β”‚ β”œβ”€β”€ /Roles/ # Role CRUD + role-permission commands
169-
β”‚ └── /Users/ # User CRUD + account actions
163+
β”œβ”€β”€ /Features # Phong cΓ‘ch Vertical Slice (CQRS + MediatR)
164+
β”‚ β”œβ”€β”€ /AuditLogs/ # Command & Query quαΊ£n lΓ½ audit log
165+
β”‚ β”œβ”€β”€ /Permissions/ # QuαΊ£n lΓ½ permission
166+
β”‚ β”œβ”€β”€ /QueueLogs/ # Log truy vαΊ₯n cho background queue jobs
167+
β”‚ β”œβ”€β”€ /Regions/ # CQRS xα»­ lΓ½ theo khu vα»±c (region)
168+
β”‚ β”œβ”€β”€ /Roles/ # CRUD role + command role-permission
169+
β”‚ └── /Users/ # CRUD user + cΓ‘c thao tΓ‘c tΓ i khoαΊ£n
170170
β”‚
171-
β”œβ”€β”€ /SharedFeatures # Common CQRS components reused across multiple features.
172-
β”‚ β”œβ”€β”€ /Mapping/ # Shared mapping used by multiple features.
173-
β”‚ β”œβ”€β”€ /Projections/ # Common read-side DTO builders or lightweight view models.
174-
β”‚ β”œβ”€β”€ /Requests/ # Shared command/query models (e.g., Upsert commands used by multiple operations).
175-
β”‚ └── /Validations/ # Reusable FluentValidation rules shared across commands/queries.
171+
β”œβ”€β”€ /SharedFeatures # CΓ‘c thΓ nh phαΊ§n CQRS dΓΉng chung cho nhiều feature
172+
β”‚ β”œβ”€β”€ /Mapping/ # Mapping dΓΉng chung giα»―a nhiều feature
173+
β”‚ β”œβ”€β”€ /Projections/ # DTO phΓ­a read-side hoαΊ·c view model nhαΊΉ dΓΉng chung
174+
β”‚ β”œβ”€β”€ /Requests/ # Command/Query dΓΉng chung (vΓ­ dα»₯: Upsert dΓΉng cho nhiều nghiệp vα»₯)
175+
β”‚ └── /Validations/ # Rule FluentValidation tΓ‘i sα»­ dα»₯ng giα»―a nhiều command/query
176176
β”‚
177-
β”œβ”€β”€ Application.csproj # Application project definition
178-
└── DependencyInjection.cs # Registers all Application services into DI container
179-
177+
β”œβ”€β”€ Application.csproj # File project Application
178+
└── DependencyInjection.cs # Đăng kΓ½ toΓ n bα»™ service tαΊ§ng Application vΓ o DI container
180179
```
181180

182181
```
183182
/Infrastructure
184-
β”œβ”€β”€ /Constants # Static constants for Infrastructure layer
183+
β”œβ”€β”€ /Constants # HαΊ±ng sα»‘ tΔ©nh cho tαΊ§ng Infrastructure
185184
β”‚
186-
β”œβ”€β”€ /Data # EF Core + persistence layer
187-
β”‚ β”œβ”€β”€ /Configurations/ # Fluent API entity configurations
188-
β”‚ β”œβ”€β”€ /Converters/ # Type converters (e.g., Ulid ↔ string)
189-
β”‚ β”œβ”€β”€ /Interceptors/ # EF Core interceptors (audit, logging)
190-
β”‚ β”œβ”€β”€ /Migrations/ # EF Core migration files
191-
β”‚ β”œβ”€β”€ /Repositories/ # Repository implementations
192-
β”‚ β”œβ”€β”€ /Seeders/ # Seed data for database initialization
193-
β”‚ └── /Settings/ # DbContext, UnitOfWork, factories, settings
185+
β”œβ”€β”€ /Data # EF Core + tαΊ§ng persistence
186+
β”‚ β”œβ”€β”€ /Configurations/ # CαΊ₯u hΓ¬nh entity bαΊ±ng Fluent API
187+
β”‚ β”œβ”€β”€ /Converters/ # Bα»™ chuyển Δ‘α»•i kiểu (vd: Ulid ↔ string)
188+
β”‚ β”œβ”€β”€ /Interceptors/ # EF Core interceptor (audit, logging)
189+
β”‚ β”œβ”€β”€ /Migrations/ # File migration cα»§a EF Core
190+
β”‚ β”œβ”€β”€ /Repositories/ # Triển khai repository
191+
β”‚ β”œβ”€β”€ /Seeders/ # Seed dα»― liệu khởi tαΊ‘o database
192+
β”‚ └── /Settings/ # IOptions cho database
194193
β”‚
195-
β”œβ”€β”€ /Services # Infrastructure service implementations
194+
β”œβ”€β”€ /Services # Triển khai service tαΊ§ng Infrastructure
196195
β”‚
197-
β”œβ”€β”€ DependencyInjection.cs # Registers Infrastructure services into DI
198-
└── Infrastructure.csproj # Project file
199-
196+
β”œβ”€β”€ DependencyInjection.cs # Đăng kΓ½ service Infrastructure vΓ o DI
197+
└── Infrastructure.csproj # File project Infrastructure
200198
```
201199

202200
```
203201
/Api
204-
β”œβ”€β”€ /common # Shared helpers/utilities for the API layer
202+
β”œβ”€β”€ /common # Helper / tiện Γ­ch dΓΉng chung cho tαΊ§ng API
205203
β”‚
206-
β”œβ”€β”€ /Converters # converters for project
204+
β”œβ”€β”€ /Converters # CΓ‘c converter cho project
207205
β”‚
208-
β”œβ”€β”€ /Endpoints # HTTP endpoint definitions (minimal APIs or controllers)
206+
β”œβ”€β”€ /Endpoints # Định nghΔ©a HTTP endpoint (Minimal API)
209207
β”‚
210-
β”œβ”€β”€ /Extensions # API extension methods (Swagger, CORS, routing, etc.)
208+
β”œβ”€β”€ /Extensions # Extension methods cho API (Swagger, CORS, routing, ...)
211209
β”‚
212-
β”œβ”€β”€ /Middlewares # Custom middlewares (exception handling, logging, etc.)
210+
β”œβ”€β”€ /Middlewares # Middleware custom (xα»­ lΓ½ exception, logging, ...)
213211
β”‚
214-
β”œβ”€β”€ /Resources # Localization resources for message translation
215-
β”‚ β”œβ”€β”€ /Messages/ # Localized message files (e.g., en.json, vi.json)
216-
β”‚ └── /Permissions/ # Permission translation files
212+
β”œβ”€β”€ /Resources # TΓ i nguyΓͺn localization cho message
213+
β”‚ β”œβ”€β”€ /Messages/ # File message Δ‘a ngΓ΄n ngα»― (vd: en.json, vi.json)
214+
β”‚ └── /Permissions/ # File dα»‹ch permission
217215
β”‚
218-
β”œβ”€β”€ /Services # API-layer services (if any API-specific logic is needed)
216+
β”œβ”€β”€ /Services # Service riΓͺng cho tαΊ§ng API (nαΊΏu cΓ³ logic Δ‘αΊ·c thΓΉ API)
219217
β”‚
220-
β”œβ”€β”€ /Settings # Settings for IOption
218+
β”œβ”€β”€ /Settings # Setting cho IOptions
221219
β”‚
222-
β”œβ”€β”€ /wwwroot/Templates # Static template files (email templates, exports, etc.)
220+
β”œβ”€β”€ /wwwroot/Templates # File template tΔ©nh (email, export, ...)
223221
β”‚
224-
β”œβ”€β”€ Api.csproj # Project file
225-
└── Program.cs # Application startup
222+
β”œβ”€β”€ Api.csproj # File project API
223+
└── Program.cs # Điểm khởi Δ‘α»™ng α»©ng dα»₯ng
226224
```
227225

228226
```
@@ -319,7 +317,6 @@ Chỉnh lαΊ‘i setting ở your appsettings.json
319317
"AccessKey": "",
320318
"SecretKey": "",
321319
"BucketName": "the-template-project",
322-
"PublicUrl": "http://localhost:9000",
323320
"PreSignedUrlExpirationInMinutes": 1440,
324321
"Protocol": 1
325322
},

β€ŽREADME.mdβ€Ž

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -142,7 +142,7 @@ What makes this Clean Architecture template stand out from the rest on Github?
142142
β”‚ β”œβ”€β”€ /ErrorCodes/ # Centralized error code definitions for the whole app
143143
β”‚ β”œβ”€β”€ /Errors/ # Error result & problem details mappings
144144
β”‚ β”œβ”€β”€ /Interfaces/ # Application-level interfaces (services, repos, abstractions)
145-
β”‚ β”œβ”€β”€ /QueryStringProcessing/ # Parsing, validating & normalizing query parameters
145+
β”‚ β”œβ”€β”€ /RequestHandler/ # Parsing, validating & normalizing query parameters
146146
β”‚ β”œβ”€β”€ /Security/ # Security helpers (permission attributes, role metadata)
147147
β”‚ └── /Validators/ # FluentValidator custom abstract class
148148
β”‚
@@ -308,7 +308,6 @@ input the keys at your appsettings.json
308308
"AccessKey": "***",
309309
"SecretKey": "***",
310310
"BucketName": "the-template-project",
311-
"PublicUrl": "http://localhost:9000",
312311
"PreSignedUrlExpirationInMinutes": 1440,
313312
"Protocol": 1
314313
},

β€Ždocker-compose.ymlβ€Ž

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
services:
22
webapi:
3-
image: ghcr.io/${GITHUB_USER_NAME}/${IMAGE_NAME}:latest
3+
image: ghcr.io/${GITHUB_USER_NAME}/${IMAGE_NAME}:${IMAGE_TAG}
44
environment:
55
- ASPNETCORE_ENVIRONMENT=Production
66
- urls=http://0.0.0.0:8080
@@ -14,7 +14,7 @@ services:
1414
networks:
1515
- the-template-network
1616
deploy:
17-
replicas: 3
17+
replicas: 2
1818
healthcheck:
1919
test: ["CMD", "curl", "-f", "http://127.0.0.1:8080/health"]
2020
interval: 30s

0 commit comments

Comments
Β (0)