Skip to content

Commit cece233

Browse files
committed
chore: simplify project structure
1 parent c102111 commit cece233

File tree

66 files changed

+52
-40
lines changed

Some content is hidden

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

66 files changed

+52
-40
lines changed

WebApiTemplate.sln

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,18 @@
11

22
Microsoft Visual Studio Solution File, Format Version 12.00
3-
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "WebApiTemplate.Core", "src\WebApiTemplate.Core\WebApiTemplate.Core.csproj", "{D27E1BC8-0554-43AE-B98B-057641726FC4}"
3+
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Core", "src\Core\Core.csproj", "{D27E1BC8-0554-43AE-B98B-057641726FC4}"
44
EndProject
5-
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "WebApiTemplate.Infrastructure", "src\WebApiTemplate.Infrastructure\WebApiTemplate.Infrastructure.csproj", "{D7B044A7-060A-4E6B-A457-AF93AB03C095}"
5+
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Infrastructure", "src\Infrastructure\Infrastructure.csproj", "{D7B044A7-060A-4E6B-A457-AF93AB03C095}"
66
EndProject
7-
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "WebApiTemplate.Api", "src\WebApiTemplate.Api\WebApiTemplate.Api.csproj", "{53C0477D-D1EE-4D32-9F13-84CB55133F70}"
7+
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Api", "src\Api\Api.csproj", "{53C0477D-D1EE-4D32-9F13-84CB55133F70}"
88
EndProject
9-
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "WebApiTemplate.Application", "src\WebApiTemplate.Application\WebApiTemplate.Application.csproj", "{9D241899-3FCE-4DDA-8349-A8B3FCA48F03}"
9+
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Application", "src\Application\Application.csproj", "{9D241899-3FCE-4DDA-8349-A8B3FCA48F03}"
1010
EndProject
1111
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "tests", "tests", "{61CD5F39-6A48-4620-B894-C30B203CC11C}"
1212
EndProject
13-
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "WebApiTemplate.UnitTests", "tests\WebApiTemplate.UnitTests\WebApiTemplate.UnitTests.csproj", "{F906C471-E4EB-4B4C-B8DE-F7B8BAF37A6D}"
13+
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "UnitTests", "tests\UnitTests\UnitTests.csproj", "{F906C471-E4EB-4B4C-B8DE-F7B8BAF37A6D}"
1414
EndProject
15-
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "WebApiTemplate.IntegrationTests", "tests\WebApiTemplate.IntegrationTests\WebApiTemplate.IntegrationTests.csproj", "{A53F16CF-3876-46DC-AFD3-2F27215F893C}"
15+
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "IntegrationTests", "tests\IntegrationTests\IntegrationTests.csproj", "{A53F16CF-3876-46DC-AFD3-2F27215F893C}"
1616
EndProject
1717
Global
1818
GlobalSection(SolutionConfigurationPlatforms) = preSolution

src/WebApiTemplate.Api/WebApiTemplate.Api.csproj renamed to src/Api/Api.csproj

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,8 @@
44
<TargetFramework>net8.0</TargetFramework>
55
<Nullable>enable</Nullable>
66
<ImplicitUsings>enable</ImplicitUsings>
7+
<RootNamespace>WebApiTemplate.Api</RootNamespace>
8+
<AssemblyName>WebApiTemplate.Api</AssemblyName>
79
</PropertyGroup>
810

911
<ItemGroup>
@@ -24,9 +26,9 @@
2426
</ItemGroup>
2527

2628
<ItemGroup>
27-
<ProjectReference Include="..\WebApiTemplate.Application\WebApiTemplate.Application.csproj" />
28-
<ProjectReference Include="..\WebApiTemplate.Core\WebApiTemplate.Core.csproj" />
29-
<ProjectReference Include="..\WebApiTemplate.Infrastructure\WebApiTemplate.Infrastructure.csproj" />
29+
<ProjectReference Include="..\Application\Application.csproj" />
30+
<ProjectReference Include="..\Core\Core.csproj" />
31+
<ProjectReference Include="..\Infrastructure\Infrastructure.csproj" />
3032
</ItemGroup>
3133

3234
</Project>
File renamed without changes.
File renamed without changes.

src/WebApiTemplate.Api/Customers/Requests/CreateCustomerRequest.cs renamed to src/Api/Customers/Requests/CreateCustomerRequest.cs

File renamed without changes.

src/WebApiTemplate.Api/Customers/Requests/UpdateCustomerRequest.cs renamed to src/Api/Customers/Requests/UpdateCustomerRequest.cs

File renamed without changes.

src/WebApiTemplate.Api/Customers/Responses/CustomerCreatedResponse.cs renamed to src/Api/Customers/Responses/CustomerCreatedResponse.cs

File renamed without changes.

src/Api/Dockerfile

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
FROM mcr.microsoft.com/dotnet/sdk:8.0 AS build
2+
WORKDIR /src
3+
4+
# copy csproj and restore as distinct layers for caching
5+
COPY src/Api/Api.csproj Api/Api.csproj
6+
COPY src/Core/Core.csproj Core/Core.csproj
7+
COPY src/Application/Application.csproj Application/Application.csproj
8+
COPY src/Infrastructure/Infrastructure.csproj Infrastructure/Infrastructure.csproj
9+
RUN dotnet restore -r linux-x64 "Api/Api.csproj"
10+
11+
# copy and publish app and libraries
12+
COPY src/Api/ Api/
13+
COPY src/Core/ Core/
14+
COPY src/Application/ Application/
15+
COPY src/Infrastructure/ Infrastructure/
16+
WORKDIR /src/Api
17+
RUN dotnet publish -c Release --no-self-contained -r linux-x64 -o /app "Api.csproj"
18+
19+
# final stage/image
20+
FROM mcr.microsoft.com/dotnet/aspnet:8.0
21+
ENV ASPNETCORE_URLS=http://+:5000
22+
EXPOSE 5000
23+
WORKDIR /app
24+
COPY --from=build /app .
25+
USER app
26+
ENTRYPOINT ["dotnet", "WebApiTemplate.Api.dll"]
File renamed without changes.

0 commit comments

Comments
 (0)