Skip to content

Commit 4878f4d

Browse files
Merge branch 'release/v1.0.2'
2 parents 8894f6f + 7caa67e commit 4878f4d

File tree

258 files changed

+17143
-5012
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

258 files changed

+17143
-5012
lines changed

.github/workflows/github-cicd.yml

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ on:
1010

1111
env:
1212
DOTNET_INSTALL_DIR: "./.dotnet"
13+
NUGET_PACKAGES: ${{ github.workspace }}/.nuget/packages
1314

1415
jobs:
1516
build-and-deploy:
@@ -26,8 +27,9 @@ jobs:
2627
- name: Setup .NET
2728
uses: actions/setup-dotnet@v4
2829
with:
29-
dotnet-version: '8.0.405'
30+
dotnet-version: "8.0.13"
3031
cache: true
32+
cache-dependency-path: "src/**/packages.lock.json"
3133
- name: Install dependencies
3234
run: dotnet restore --locked-mode
3335
- name: Build
@@ -42,6 +44,7 @@ jobs:
4244
path: |
4345
app/publish
4446
app/output/test-results
47+
retention-days: 3
4548
- name: Log in to GitHub Container Registry
4649
uses: docker/login-action@v3
4750
with:
@@ -77,4 +80,4 @@ jobs:
7780
7881
docker compose down
7982
80-
docker compose up -d --build
83+
docker compose up -d --build

Dockers/ElasticSearch/docker-compose.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ services:
66
volumes:
77
- certs:/usr/share/elasticsearch/config/certs
88
networks:
9-
- the-teplate-network
9+
- the-template-network
1010
user: "0"
1111
command: >
1212
bash -c '
@@ -63,7 +63,7 @@ services:
6363
ports:
6464
- ${ES_PORT}:9200
6565
networks:
66-
- the-teplate-network
66+
- the-template-network
6767
environment:
6868
- node.name=es01
6969
- cluster.name=${CLUSTER_NAME}
@@ -195,7 +195,7 @@ services:
195195
ports:
196196
- ${KIBANA_PORT}:5601
197197
networks:
198-
- the-teplate-network
198+
- the-template-network
199199
environment:
200200
- SERVERNAME=kibana
201201
- ELASTICSEARCH_HOSTS=https://es01:9200
@@ -226,5 +226,5 @@ volumes:
226226
driver: local
227227

228228
networks:
229-
the-teplate-network:
229+
the-template-network:
230230
external: true

Dockers/MinioS3/docker-compose.yaml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ services:
2929
- data1-1:/data1
3030
- data1-2:/data2
3131
networks:
32-
- the-teplate-network
32+
- the-template-network
3333

3434
minio2:
3535
<<: *minio-common
@@ -38,7 +38,7 @@ services:
3838
- data2-1:/data1
3939
- data2-2:/data2
4040
networks:
41-
- the-teplate-network
41+
- the-template-network
4242

4343
nginx:
4444
image: nginx:1.19.2-alpine
@@ -52,7 +52,7 @@ services:
5252
- minio1
5353
- minio2
5454
networks:
55-
- the-teplate-network
55+
- the-template-network
5656

5757
## By default this config uses default local driver,
5858
## For custom volumes replace with volume driver configuration.
@@ -63,5 +63,5 @@ volumes:
6363
data2-2:
6464

6565
networks:
66-
the-teplate-network:
66+
the-template-network:
6767
external: true

Dockers/Otel/docker-compose.yaml

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,15 +2,16 @@ version: "3"
22

33
services:
44
collector:
5-
image: otel/opentelemetry-collector-contrib:latest
5+
image: otel/opentelemetry-collector:latest
66
command: ["--config=/etc/otel-collector-config.yaml"]
77
volumes:
88
- ./otel-collector-config.yaml:/etc/otel-collector-config.yaml
99
networks:
10-
- the-teplate-network
10+
- the-template-network
1111
ports:
1212
- "4317:4317" # OTLP over gRPC receiver
1313
- "4318:4318" # OTLP over HTTP receiver
14+
- "13133:13133" # health_check extension
1415
depends_on:
1516
- jaeger
1617

@@ -24,8 +25,8 @@ services:
2425
- "14268:14268" # Jaeger collector HTTP port
2526
- "14250:14250" # gRPC for Jaeger
2627
networks:
27-
- the-teplate-network
28+
- the-template-network
2829

2930
networks:
30-
the-teplate-network:
31+
the-template-network:
3132
external: true

Dockers/Postgresql/docker-compose.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ services:
1010
POSTGRES_PASSWORD: ${POSTGRES_PASSWORD}
1111
POSTGRES_DB: ${POSTGRES_DB}
1212
networks:
13-
- the-teplate-network
13+
- the-template-network
1414
volumes:
1515
- ./db_data:/var/lib/postgresql/data/
1616

@@ -24,10 +24,10 @@ services:
2424
depends_on:
2525
- database
2626
networks:
27-
- the-teplate-network
27+
- the-template-network
2828
volumes:
2929
- ./pgadmin_data:/var/lib/pgadmin/
3030

3131
networks:
32-
the-teplate-network:
32+
the-template-network:
3333
external: true

Dockers/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
The first thing you're going to do is to create a docker network by following command :
33

44
```
5-
docker network create the-teplate-network
5+
docker network create the-template-network
66
```
77

88
this is a little trick for docker containers can communicate with each other.

Dockers/Redis/docker-compose.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ services:
77
ports:
88
- "6379:6379" # Map Redis default port to host
99
networks:
10-
- the-teplate-network
10+
- the-template-network
1111
volumes:
1212
- redis_data:/data # Persist Redis data using a named volume
1313
environment:
@@ -20,5 +20,5 @@ volumes:
2020
driver: local # Use local storage for the Redis data volume
2121

2222
networks:
23-
the-teplate-network:
23+
the-template-network:
2424
external: true

Dockers/Seq/docker-compose.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,8 @@ services:
1111
ports:
1212
- 5341:80
1313
networks:
14-
- the-teplate-network
14+
- the-template-network
1515

1616
networks:
17-
the-teplate-network:
17+
the-template-network:
1818
external: true

README-VIETNAMESE.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -259,7 +259,7 @@ _Phụ thuộc vào tầng Application và Domain_
259259

260260
_Phụ thuộc vào tầng Application and Infrastructure_
261261

262-
**_Contract_** : Chứa shared components qua các tầng
262+
**_Contract_** : Chứa shared components cho các tầng Application, Infrastructure and API.
263263

264264
# Bắt đầu thôi nào
265265

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -259,7 +259,7 @@ _It depends on Application and Domain layer_
259259

260260
_It depends on Application and Infrastructure layer_
261261

262-
**_Contract_** : Contains shared components across all layers
262+
**_Contract_** : Contains shared components for Application, Infrastructure and API layer.
263263

264264
# Getting started
265265

docker-compose.yml

Lines changed: 13 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,25 +1,23 @@
11
services:
2-
webapi: &webapi_defaults
2+
webapi:
33
image: ghcr.io/${GITHUB_USER_NAME}/${IMAGE_NAME}:latest
44
environment:
55
- ASPNETCORE_ENVIRONMENT=Production
66
expose:
77
- "8080"
88
networks:
9-
- the-teplate-network
9+
- the-template-network
1010
healthcheck:
1111
test: ["CMD", "curl", "-f", "http://localhost:8080/api/health"]
1212
interval: 30s
1313
timeout: 10s
1414
retries: 3
15-
16-
webapi1:
17-
<<: *webapi_defaults # Reuse defaults
18-
container_name: the_template1
19-
20-
webapi2:
21-
<<: *webapi_defaults # Reuse defaults
22-
container_name: the_template2
15+
deploy:
16+
replicas: 2
17+
restart_policy:
18+
condition: on-failure
19+
delay: 5s
20+
max_attempts: 3
2321

2422
nginx:
2523
image: nginx:latest
@@ -30,11 +28,10 @@ services:
3028
- ./nginx.conf:/etc/nginx/nginx.conf:ro
3129
- ./logs:/var/log/nginx
3230
depends_on:
33-
- webapi1
34-
- webapi2
31+
- webapi
3532
networks:
36-
- the-teplate-network
33+
- the-template-network
3734

38-
networks:
39-
the-teplate-network:
40-
external: true
35+
networks:
36+
the-template-network:
37+
external: true

nginx/nginx.conf renamed to nginx.conf

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,8 @@ http {
1010
error_log /var/log/nginx/error.log warn;
1111

1212
upstream backend {
13-
server webapi1:8080 max_fails=3 fail_timeout=60s weight=2;
14-
server webapi2:8080 max_fails=3 fail_timeout=60s;
13+
# Use Docker's DNS-based service discovery
14+
server webapi:8080 max_fails=3 fail_timeout=60s;
1515
}
1616

1717
server {

packages.lock.json

Whitespace-only changes.

src/Api/Api.csproj

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,8 +25,16 @@
2525
<PackageReference Include="Microsoft.AspNetCore.OpenApi" Version="8.0.8" />
2626
<PackageReference Include="Microsoft.Extensions.Diagnostics.HealthChecks" Version="9.0.1" />
2727
<PackageReference Include="Npgsql.DependencyInjection" Version="8.0.6" />
28-
<PackageReference Include="Swashbuckle.AspNetCore" Version="6.7.3" />
29-
<PackageReference Include="Swashbuckle.AspNetCore.Annotations" Version="6.7.3" />
28+
<PackageReference Include="OpenTelemetry.Exporter.OpenTelemetryProtocol" Version="1.11.1" />
29+
<PackageReference Include="OpenTelemetry.Instrumentation.Http" Version="1.11.0" />
30+
<PackageReference Include="OpenTelemetry" Version="1.11.2" />
31+
<PackageReference Include="OpenTelemetry.Exporter.Console" Version="1.11.2" />
32+
<PackageReference Include="OpenTelemetry.Extensions.Hosting" Version="1.11.2" />
33+
<PackageReference Include="OpenTelemetry.Instrumentation.AspNetCore" Version="1.11.1" />
34+
<PackageReference Include="OpenTelemetry.Instrumentation.EntityFrameworkCore" Version="1.11.0-beta.2" />
35+
36+
<PackageReference Include="Swashbuckle.AspNetCore" Version="7.3.1" />
37+
<PackageReference Include="Swashbuckle.AspNetCore.Annotations" Version="7.3.1" />
3038
</ItemGroup>
3139

3240
<PropertyGroup>
@@ -36,6 +44,7 @@
3644
<PreserveCompilationContext>true</PreserveCompilationContext>
3745
<GenerateDocumentationFile>true</GenerateDocumentationFile>
3846
<NoWarn>$(NoWarn);1591</NoWarn>
47+
<RestorePackagesWithLockFile>true</RestorePackagesWithLockFile>
3948
</PropertyGroup>
4049

4150
</Project>

src/Api/Endpoints/AuditLogs/ListAuditLog.cs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
1-
using Application.UseCases.AuditLogs.Queries;
1+
using Api.common.RouteResults;
2+
using Api.common.Routers;
3+
using Application.Features.AuditLogs.Queries;
24
using Ardalis.ApiEndpoints;
35
using Contracts.ApiWrapper;
4-
using Contracts.RouteResults;
5-
using Contracts.Routers;
66
using Mediator;
77
using Microsoft.AspNetCore.Mvc;
88
using Swashbuckle.AspNetCore.Annotations;

src/Api/Endpoints/Permissions/ListPermissionEndpoint.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
1+
using Api.common.RouteResults;
2+
using Api.common.Routers;
13
using Application.Features.Permissions;
24
using Ardalis.ApiEndpoints;
35
using Contracts.ApiWrapper;
4-
using Contracts.RouteResults;
5-
using Contracts.Routers;
66
using Mediator;
77
using Microsoft.AspNetCore.Mvc;
88
using Swashbuckle.AspNetCore.Annotations;

src/Api/Endpoints/Regions/ListCommuneEndpoint.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
1+
using Api.common.RouteResults;
2+
using Api.common.Routers;
13
using Application.Features.Regions.Queries.List.Communes;
24
using Ardalis.ApiEndpoints;
35
using Contracts.ApiWrapper;
4-
using Contracts.RouteResults;
5-
using Contracts.Routers;
66
using Mediator;
77
using Microsoft.AspNetCore.Mvc;
88
using Swashbuckle.AspNetCore.Annotations;

src/Api/Endpoints/Regions/ListDistrictEndpoint.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
1+
using Api.common.RouteResults;
2+
using Api.common.Routers;
13
using Application.Features.Regions.Queries.List.Districts;
24
using Ardalis.ApiEndpoints;
35
using Contracts.ApiWrapper;
4-
using Contracts.RouteResults;
5-
using Contracts.Routers;
66
using Mediator;
77
using Microsoft.AspNetCore.Mvc;
88
using Swashbuckle.AspNetCore.Annotations;

src/Api/Endpoints/Regions/ListProvinceEndpoint.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
1+
using Api.common.RouteResults;
2+
using Api.common.Routers;
13
using Application.Features.Regions.Queries.List.Provinces;
24
using Ardalis.ApiEndpoints;
35
using Contracts.ApiWrapper;
4-
using Contracts.RouteResults;
5-
using Contracts.Routers;
66
using Mediator;
77
using Microsoft.AspNetCore.Mvc;
88
using Swashbuckle.AspNetCore.Annotations;

src/Api/Endpoints/Roles/CreateRoleEndpoint.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
1+
using Api.common.RouteResults;
2+
using Api.common.Routers;
13
using Application.Common.Auth;
24
using Application.Features.Roles.Commands.Create;
35
using Ardalis.ApiEndpoints;
46
using Contracts.ApiWrapper;
5-
using Contracts.RouteResults;
6-
using Contracts.Routers;
77
using Infrastructure.Constants;
88
using Mediator;
99
using Microsoft.AspNetCore.Mvc;

src/Api/Endpoints/Roles/DeleteRoleEndpoint.cs

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,10 @@
1+
using Api.common.RouteResults;
2+
using Api.common.Routers;
13
using Application.Common.Auth;
24
using Application.Features.Roles.Commands.Delete;
35
using Ardalis.ApiEndpoints;
46
using Contracts.ApiWrapper;
5-
using Contracts.RouteResults;
6-
using Contracts.Routers;
7+
using Contracts.Constants;
78
using Infrastructure.Constants;
89
using Mediator;
910
using Microsoft.AspNetCore.Mvc;
@@ -18,7 +19,7 @@ public class DeleteRoleEndpoint(ISender sender)
1819
[SwaggerOperation(Tags = [Router.RoleRoute.Tags], Summary = "Delete Role")]
1920
[AuthorizeBy(permissions: $"{ActionPermission.delete}:{ObjectPermission.role}")]
2021
public override async Task<ActionResult<ApiResponse>> HandleAsync(
21-
[FromRoute(Name = Router.Id)] string roleId,
22+
[FromRoute(Name = RoutePath.Id)] string roleId,
2223
CancellationToken cancellationToken = default
2324
)
2425
{

0 commit comments

Comments
 (0)