Skip to content

Commit

Permalink
Merge pull request #6 from dontnod/ac/setup-clean-architecture
Browse files Browse the repository at this point in the history
Setup clean architecture
  • Loading branch information
zenoxs authored May 17, 2024
2 parents 711729c + a9261bc commit 3147b8e
Show file tree
Hide file tree
Showing 88 changed files with 2,004 additions and 554 deletions.
3 changes: 3 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
Expand Up @@ -26,3 +26,6 @@ dotnet_diagnostic.IDE0005.severity = warning

# IDE0052: Remove unread private members
dotnet_diagnostic.IDE0052.severity = warning

# SA1601: Partial elements should be documented
dotnet_diagnostic.SA1601.severity = silent
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,9 @@
*.userosscache
*.sln.docstates

# SQl Lite Database
app.db*

# Vite files
.vite

Expand Down
4 changes: 2 additions & 2 deletions .vscode/launch.json
Original file line number Diff line number Diff line change
Expand Up @@ -22,11 +22,11 @@
}
},
{
"name": "Todo Api Launch",
"name": "Api Launch",
"type": "coreclr",
"request": "launch",
"preLaunchTask": "build",
"program": "${workspaceFolder}/src/Api/bin/Debug/net8.0/DNE.Todo.Api.dll",
"program": "${workspaceFolder}/src/Api/bin/Debug/net8.0/WebAppStarter.Api.dll",
"args": [],
"cwd": "${workspaceFolder}/src/Api",
"stopAtEntry": false,
Expand Down
2 changes: 2 additions & 0 deletions Directory.Build.props
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>
<Company>Don't Nod</Company>
<!-- Uncomment the following line to use InMemoryDatabase -->
<DefineConstants>$(DefineConstants);USE_SQL_LITE</DefineConstants>
<Product />
</PropertyGroup>
</Project>
37 changes: 17 additions & 20 deletions Directory.Packages.props
Original file line number Diff line number Diff line change
Expand Up @@ -6,44 +6,41 @@ https://devblogs.microsoft.com/nuget/introducing-central-package-management/ -->
</PropertyGroup>
<ItemGroup>
<PackageVersion Include="Ardalis.GuardClauses" Version="4.5.0" />
<PackageVersion Include="Ardalis.Result" Version="9.0.0" />
<PackageVersion Include="Ardalis.Result.AspNetCore" Version="9.0.0" />
<PackageVersion Include="Azure.Identity" Version="1.11.1" />
<PackageVersion Include="coverlet.collector" Version="6.0.2" />

<PackageVersion Include="DotSwashbuckle.AspNetCore" Version="3.0.8" />
<PackageVersion Include="DotSwashbuckle.AspNetCore.Annotations" Version="3.0.8" />

<PackageVersion Include="FluentAssertions" Version="6.12.0" />
<PackageVersion Include="FluentValidation.AspNetCore" Version="11.3.0" />
<PackageVersion Include="FluentValidation.DependencyInjectionExtensions" Version="11.9.0" />

<PackageVersion Include="MediatR" Version="12.2.0" />

<PackageVersion Include="Microsoft.AspNetCore.Authentication.JwtBearer" Version="8.0.3"
NoWarn="NU1605" />
<PackageVersion Include="Microsoft.AspNetCore.Authentication.OpenIdConnect" Version="8.0.3"
NoWarn="NU1605" />
<PackageVersion Include="Microsoft.AspNetCore.Authentication.JwtBearer" Version="8.0.3" NoWarn="NU1605" />
<PackageVersion Include="Microsoft.AspNetCore.Authentication.OpenIdConnect" Version="8.0.3" NoWarn="NU1605" />
<PackageVersion Include="Microsoft.AspNetCore.Mvc.Testing" Version="8.0.5" />
<PackageVersion Include="Microsoft.Identity.Web" Version="2.15.2" />
<PackageVersion Include="Microsoft.Identity.Web.DownstreamApi" Version="2.15.2" />
<PackageVersion Include="Microsoft.AspNetCore.Identity.EntityFrameworkCore" Version="8.0.5" />
<PackageVersion Include="Microsoft.AspNetCore.OpenApi" Version="8.0.3" />

<PackageVersion Include="Microsoft.AspNetCore.Identity.EntityFrameworkCore" Version="8.0.5" />
<PackageVersion Include="Microsoft.AspNetCore.Diagnostics.EntityFrameworkCore" Version="8.0.5" />
<PackageVersion Include="Microsoft.EntityFrameworkCore.Sqlite" Version="8.0.5" />
<PackageVersion Include="Microsoft.EntityFrameworkCore.InMemory" Version="8.0.5" />
<PackageVersion Include="Microsoft.EntityFrameworkCore" Version="8.0.5" />
<PackageVersion Include="Microsoft.EntityFrameworkCore.Analyzers" Version="8.0.5" />
<PackageVersion Include="Microsoft.EntityFrameworkCore.Design" Version="8.0.5" />
<PackageVersion Include="Microsoft.EntityFrameworkCore.Tools" Version="8.0.5" />
<PackageVersion Include="Microsoft.Extensions.Configuration.EnvironmentVariables"
Version="8.0.0" />
<PackageVersion Include="Microsoft.Extensions.Diagnostics.HealthChecks.EntityFrameworkCore"
Version="8.0.4" />

<PackageVersion Include="Microsoft.EntityFrameworkCore.Relational" Version="8.0.5" />
<PackageVersion Include="Microsoft.Extensions.Configuration.EnvironmentVariables" Version="8.0.0" />
<PackageVersion Include="Microsoft.Extensions.Diagnostics.HealthChecks.EntityFrameworkCore" Version="8.0.5" />
<PackageVersion Include="Microsoft.NET.Test.Sdk" Version="17.8.0" />

<PackageVersion Include="moq" Version="4.20.70" />
<PackageVersion Include="xunit" Version="2.5.3" />
<PackageVersion Include="xunit.runner.visualstudio" Version="2.5.3" />

<PackageVersion Include="Moq" Version="4.20.70" />
<PackageVersion Include="nunit" Version="4.1.0" />
<PackageVersion Include="NUnit.Analyzers" Version="4.2.0">
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
<PrivateAssets>all</PrivateAssets>
</PackageVersion>
<PackageVersion Include="NUnit3TestAdapter" Version="4.5.0" />
<PackageVersion Include="StyleCop.Analyzers" Version="1.2.0-beta.556" PrivateAssets="All" />
</ItemGroup>
</Project>
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ WORKDIR /app
COPY --from=prod-build /workspace/out .

EXPOSE 8080
ENTRYPOINT ["dotnet", "DNE.Todo.Api.dll"]
ENTRYPOINT ["dotnet", "WebAppStarter.Api.dll"]

## ---------------------------------------------------------------------------------- ##
## -------------------------------- development build ------------------------------- ##
Expand Down
33 changes: 27 additions & 6 deletions WebAppStarter.sln
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,13 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solutions Items", "Solution
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "tests", "tests", "{41D3ECC0-AB64-4994-8B5E-73A7876C4F5F}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Api.UnitTests", "tests\Api.UnitTests\Api.UnitTests.csproj", "{31BDF5B0-70C7-4802-B0C8-63A88C0DFD67}"
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Domain", "src\Domain\Domain.csproj", "{19D0CD06-CCE9-4918-B178-F0D49D3D830E}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Infrastructure", "src\Infrastructure\Infrastructure.csproj", "{F8DB058D-EE5F-4CC7-9136-98B910FE49D0}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Application", "src\Application\Application.csproj", "{ECEE2966-F534-4939-8446-FDCE3E28A054}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Application.FunctionalTests", "tests\Application.FunctionalTests\Application.FunctionalTests.csproj", "{475E9335-BA53-4587-8058-2E684053EE87}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Expand All @@ -39,18 +45,33 @@ Global
{0261127C-E97A-4350-AFFD-FBFF75F12AD3}.Release|Any CPU.ActiveCfg = Release|Any CPU
{0261127C-E97A-4350-AFFD-FBFF75F12AD3}.Release|Any CPU.Build.0 = Release|Any CPU
{0261127C-E97A-4350-AFFD-FBFF75F12AD3}.Release|Any CPU.Deploy.0 = Release|Any CPU
{31BDF5B0-70C7-4802-B0C8-63A88C0DFD67}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{31BDF5B0-70C7-4802-B0C8-63A88C0DFD67}.Debug|Any CPU.Build.0 = Debug|Any CPU
{31BDF5B0-70C7-4802-B0C8-63A88C0DFD67}.Release|Any CPU.ActiveCfg = Release|Any CPU
{31BDF5B0-70C7-4802-B0C8-63A88C0DFD67}.Release|Any CPU.Build.0 = Release|Any CPU
{19D0CD06-CCE9-4918-B178-F0D49D3D830E}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{19D0CD06-CCE9-4918-B178-F0D49D3D830E}.Debug|Any CPU.Build.0 = Debug|Any CPU
{19D0CD06-CCE9-4918-B178-F0D49D3D830E}.Release|Any CPU.ActiveCfg = Release|Any CPU
{19D0CD06-CCE9-4918-B178-F0D49D3D830E}.Release|Any CPU.Build.0 = Release|Any CPU
{F8DB058D-EE5F-4CC7-9136-98B910FE49D0}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{F8DB058D-EE5F-4CC7-9136-98B910FE49D0}.Debug|Any CPU.Build.0 = Debug|Any CPU
{F8DB058D-EE5F-4CC7-9136-98B910FE49D0}.Release|Any CPU.ActiveCfg = Release|Any CPU
{F8DB058D-EE5F-4CC7-9136-98B910FE49D0}.Release|Any CPU.Build.0 = Release|Any CPU
{ECEE2966-F534-4939-8446-FDCE3E28A054}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{ECEE2966-F534-4939-8446-FDCE3E28A054}.Debug|Any CPU.Build.0 = Debug|Any CPU
{ECEE2966-F534-4939-8446-FDCE3E28A054}.Release|Any CPU.ActiveCfg = Release|Any CPU
{ECEE2966-F534-4939-8446-FDCE3E28A054}.Release|Any CPU.Build.0 = Release|Any CPU
{475E9335-BA53-4587-8058-2E684053EE87}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{475E9335-BA53-4587-8058-2E684053EE87}.Debug|Any CPU.Build.0 = Debug|Any CPU
{475E9335-BA53-4587-8058-2E684053EE87}.Release|Any CPU.ActiveCfg = Release|Any CPU
{475E9335-BA53-4587-8058-2E684053EE87}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
EndGlobalSection
GlobalSection(NestedProjects) = preSolution
{24717492-0735-485A-A0A9-DF837633E3DD} = {D34D9A25-2206-4972-BC45-EC8363A695C0}
{0261127C-E97A-4350-AFFD-FBFF75F12AD3} = {D34D9A25-2206-4972-BC45-EC8363A695C0}
{31BDF5B0-70C7-4802-B0C8-63A88C0DFD67} = {41D3ECC0-AB64-4994-8B5E-73A7876C4F5F}
{19D0CD06-CCE9-4918-B178-F0D49D3D830E} = {D34D9A25-2206-4972-BC45-EC8363A695C0}
{F8DB058D-EE5F-4CC7-9136-98B910FE49D0} = {D34D9A25-2206-4972-BC45-EC8363A695C0}
{ECEE2966-F534-4939-8446-FDCE3E28A054} = {D34D9A25-2206-4972-BC45-EC8363A695C0}
{475E9335-BA53-4587-8058-2E684053EE87} = {41D3ECC0-AB64-4994-8B5E-73A7876C4F5F}
EndGlobalSection
GlobalSection(ExtensibilityGlobals) = postSolution
SolutionGuid = {A727A511-A414-4DD0-A3C6-3DCCCBB5C3FB}
Expand Down
15 changes: 10 additions & 5 deletions src/Api/Api.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,16 @@
<TargetFramework>net8.0</TargetFramework>
<UserSecretsId>dne-todo-api-2f979706-5df6-465d-af50-c3917e0e8925</UserSecretsId>

<RootNamespace>DNE.Todo.Api</RootNamespace>
<AssemblyName>DNE.Todo.Api</AssemblyName>
<RootNamespace>WebAppStarter.Api</RootNamespace>
<AssemblyName>WebAppStarter.Api</AssemblyName>
</PropertyGroup>

<ItemGroup>
<PackageReference Include="Ardalis.Result" />
<PackageReference Include="Ardalis.Result.AspNetCore" />
<PackageReference Include="Microsoft.Extensions.Diagnostics.HealthChecks.EntityFrameworkCore" />
<PackageReference Include="Microsoft.AspNetCore.Authentication.JwtBearer" />
<PackageReference Include="Microsoft.AspNetCore.Authentication.OpenIdConnect" />
<PackageReference Include="Microsoft.AspNetCore.Authentication.OpenIdConnect" />
<PackageReference Include="Microsoft.EntityFrameworkCore.InMemory" />
<PackageReference Include="Microsoft.EntityFrameworkCore.Tools">
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
Expand All @@ -24,8 +27,8 @@
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
<PrivateAssets>all</PrivateAssets>
</PackageReference>
<PackageReference Include="Microsoft.EntityFrameworkCore.Sqlite" />
<PackageReference Include="DotSwashbuckle.AspNetCore" />
<PackageReference Include="Microsoft.EntityFrameworkCore.Sqlite" />
<PackageReference Include="DotSwashbuckle.AspNetCore" />
<PackageReference Include="DotSwashbuckle.AspNetCore.Annotations" />
<PackageReference Include="StyleCop.Analyzers" PrivateAssets="All" />
</ItemGroup>
Expand All @@ -41,6 +44,8 @@
</Target>

<ItemGroup>
<ProjectReference Include="..\Application\Application.csproj" />
<ProjectReference Include="..\Infrastructure\Infrastructure.csproj" />
<ProjectReference Include="..\Client\client.esproj">
<ReferenceOutputAssembly>false</ReferenceOutputAssembly>
</ProjectReference>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
namespace TodoApi.Models;
namespace WebAppStarter.Api.Models;

public class ClaimSettings
{
Expand Down
157 changes: 0 additions & 157 deletions src/Api/Controllers/ToDoListController.cs

This file was deleted.

Loading

0 comments on commit 3147b8e

Please sign in to comment.