From 380bb038cb4157df43f77609c820a427ab420c31 Mon Sep 17 00:00:00 2001 From: blyssco Date: Sat, 5 Jul 2025 13:20:54 +0200 Subject: [PATCH 1/5] Setup API Clean Architecture --- Liber_Incantamentum.API/Class1.cs | 7 +++++++ .../Liber_Incantamentum.API.csproj | 9 +++++++++ .../Liber_Incantamentum.Application.csproj | 15 ++++++++++++++ .../Liber_Incantamentum.Domain.csproj | 17 ++++++++++++++++ .../Liber_Incantamentum.Infrastructure.csproj | 14 +++++++++++++ Liber_Incantamentum.sln | 20 ++++++++++++++++++- ....csproj => Liber_Incantamentum.API.csproj} | 5 +++++ 7 files changed, 86 insertions(+), 1 deletion(-) create mode 100644 Liber_Incantamentum.API/Class1.cs create mode 100644 Liber_Incantamentum.API/Liber_Incantamentum.API.csproj create mode 100644 Liber_Incantamentum.Application/Liber_Incantamentum.Application.csproj create mode 100644 Liber_Incantamentum.Domain/Liber_Incantamentum.Domain.csproj create mode 100644 Liber_Incantamentum.Infrastructure/Liber_Incantamentum.Infrastructure.csproj rename Liber_Incantamentum/{Liber_Incantamentum.csproj => Liber_Incantamentum.API.csproj} (75%) diff --git a/Liber_Incantamentum.API/Class1.cs b/Liber_Incantamentum.API/Class1.cs new file mode 100644 index 0000000..3d81c5c --- /dev/null +++ b/Liber_Incantamentum.API/Class1.cs @@ -0,0 +1,7 @@ +namespace Liber_Incantamentum.API +{ + public class Class1 + { + + } +} diff --git a/Liber_Incantamentum.API/Liber_Incantamentum.API.csproj b/Liber_Incantamentum.API/Liber_Incantamentum.API.csproj new file mode 100644 index 0000000..125f4c9 --- /dev/null +++ b/Liber_Incantamentum.API/Liber_Incantamentum.API.csproj @@ -0,0 +1,9 @@ + + + + net9.0 + enable + enable + + + diff --git a/Liber_Incantamentum.Application/Liber_Incantamentum.Application.csproj b/Liber_Incantamentum.Application/Liber_Incantamentum.Application.csproj new file mode 100644 index 0000000..fefd871 --- /dev/null +++ b/Liber_Incantamentum.Application/Liber_Incantamentum.Application.csproj @@ -0,0 +1,15 @@ + + + + net9.0 + enable + enable + + + + + + + + + diff --git a/Liber_Incantamentum.Domain/Liber_Incantamentum.Domain.csproj b/Liber_Incantamentum.Domain/Liber_Incantamentum.Domain.csproj new file mode 100644 index 0000000..795fb41 --- /dev/null +++ b/Liber_Incantamentum.Domain/Liber_Incantamentum.Domain.csproj @@ -0,0 +1,17 @@ + + + + net9.0 + enable + enable + + + + + + + + + + + diff --git a/Liber_Incantamentum.Infrastructure/Liber_Incantamentum.Infrastructure.csproj b/Liber_Incantamentum.Infrastructure/Liber_Incantamentum.Infrastructure.csproj new file mode 100644 index 0000000..c4f9216 --- /dev/null +++ b/Liber_Incantamentum.Infrastructure/Liber_Incantamentum.Infrastructure.csproj @@ -0,0 +1,14 @@ + + + + net9.0 + enable + enable + + + + + + + + diff --git a/Liber_Incantamentum.sln b/Liber_Incantamentum.sln index b3fda7c..26099e0 100644 --- a/Liber_Incantamentum.sln +++ b/Liber_Incantamentum.sln @@ -3,7 +3,13 @@ Microsoft Visual Studio Solution File, Format Version 12.00 # Visual Studio Version 17 VisualStudioVersion = 17.14.36109.1 d17.14 MinimumVisualStudioVersion = 10.0.40219.1 -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Liber_Incantamentum", "Liber_Incantamentum\Liber_Incantamentum.csproj", "{BB761821-A9EC-4EBA-83A2-89F32C50041F}" +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Liber_Incantamentum.API", "Liber_Incantamentum\Liber_Incantamentum.API.csproj", "{BB761821-A9EC-4EBA-83A2-89F32C50041F}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Liber_Incantamentum.Domain", "Liber_Incantamentum.Domain\Liber_Incantamentum.Domain.csproj", "{7DF16F8F-C307-455F-8389-5F0B90281347}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Liber_Incantamentum.Application", "Liber_Incantamentum.Application\Liber_Incantamentum.Application.csproj", "{1307DD24-0090-4C5A-B56F-8A815DF46AB9}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Liber_Incantamentum.Infrastructure", "Liber_Incantamentum.Infrastructure\Liber_Incantamentum.Infrastructure.csproj", "{C80C19DC-06DA-45DD-ADEE-2BB0F670A014}" EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution @@ -15,6 +21,18 @@ Global {BB761821-A9EC-4EBA-83A2-89F32C50041F}.Debug|Any CPU.Build.0 = Debug|Any CPU {BB761821-A9EC-4EBA-83A2-89F32C50041F}.Release|Any CPU.ActiveCfg = Release|Any CPU {BB761821-A9EC-4EBA-83A2-89F32C50041F}.Release|Any CPU.Build.0 = Release|Any CPU + {7DF16F8F-C307-455F-8389-5F0B90281347}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {7DF16F8F-C307-455F-8389-5F0B90281347}.Debug|Any CPU.Build.0 = Debug|Any CPU + {7DF16F8F-C307-455F-8389-5F0B90281347}.Release|Any CPU.ActiveCfg = Release|Any CPU + {7DF16F8F-C307-455F-8389-5F0B90281347}.Release|Any CPU.Build.0 = Release|Any CPU + {1307DD24-0090-4C5A-B56F-8A815DF46AB9}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {1307DD24-0090-4C5A-B56F-8A815DF46AB9}.Debug|Any CPU.Build.0 = Debug|Any CPU + {1307DD24-0090-4C5A-B56F-8A815DF46AB9}.Release|Any CPU.ActiveCfg = Release|Any CPU + {1307DD24-0090-4C5A-B56F-8A815DF46AB9}.Release|Any CPU.Build.0 = Release|Any CPU + {C80C19DC-06DA-45DD-ADEE-2BB0F670A014}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {C80C19DC-06DA-45DD-ADEE-2BB0F670A014}.Debug|Any CPU.Build.0 = Debug|Any CPU + {C80C19DC-06DA-45DD-ADEE-2BB0F670A014}.Release|Any CPU.ActiveCfg = Release|Any CPU + {C80C19DC-06DA-45DD-ADEE-2BB0F670A014}.Release|Any CPU.Build.0 = Release|Any CPU EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE diff --git a/Liber_Incantamentum/Liber_Incantamentum.csproj b/Liber_Incantamentum/Liber_Incantamentum.API.csproj similarity index 75% rename from Liber_Incantamentum/Liber_Incantamentum.csproj rename to Liber_Incantamentum/Liber_Incantamentum.API.csproj index 1fc25bd..11b4c78 100644 --- a/Liber_Incantamentum/Liber_Incantamentum.csproj +++ b/Liber_Incantamentum/Liber_Incantamentum.API.csproj @@ -10,4 +10,9 @@ + + + + + From 31299e413d88506a7c538523be4bf83497168214 Mon Sep 17 00:00:00 2001 From: blyssco Date: Sat, 5 Jul 2025 14:16:02 +0200 Subject: [PATCH 2/5] Edit config --- Liber_Incantamentum/Properties/launchSettings.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Liber_Incantamentum/Properties/launchSettings.json b/Liber_Incantamentum/Properties/launchSettings.json index 92c536d..7e1aa4a 100644 --- a/Liber_Incantamentum/Properties/launchSettings.json +++ b/Liber_Incantamentum/Properties/launchSettings.json @@ -13,7 +13,7 @@ "https": { "commandName": "Project", "dotnetRunMessages": true, - "launchBrowser": false, + "launchBrowser": true, "applicationUrl": "https://localhost:7239;http://localhost:5225", "environmentVariables": { "ASPNETCORE_ENVIRONMENT": "Development" From 5f6aa216aac548aa9616ad28d727336567c9ddd6 Mon Sep 17 00:00:00 2001 From: blyssco Date: Sat, 5 Jul 2025 15:56:43 +0200 Subject: [PATCH 3/5] Fix --- .../Liber_Incantamentum.Domain.csproj | 2 +- .../Liber_Incantamentum.Tests.csproj | 14 +++++++ Liber_Incantamentum.sln | 8 +++- README.md | 41 +++---------------- 4 files changed, 28 insertions(+), 37 deletions(-) create mode 100644 Liber_Incantamentum.Tests/Liber_Incantamentum.Tests.csproj diff --git a/Liber_Incantamentum.Domain/Liber_Incantamentum.Domain.csproj b/Liber_Incantamentum.Domain/Liber_Incantamentum.Domain.csproj index 795fb41..d732c4a 100644 --- a/Liber_Incantamentum.Domain/Liber_Incantamentum.Domain.csproj +++ b/Liber_Incantamentum.Domain/Liber_Incantamentum.Domain.csproj @@ -9,7 +9,7 @@ - + diff --git a/Liber_Incantamentum.Tests/Liber_Incantamentum.Tests.csproj b/Liber_Incantamentum.Tests/Liber_Incantamentum.Tests.csproj new file mode 100644 index 0000000..6c83ff3 --- /dev/null +++ b/Liber_Incantamentum.Tests/Liber_Incantamentum.Tests.csproj @@ -0,0 +1,14 @@ + + + + net9.0 + enable + enable + + + + + + + + diff --git a/Liber_Incantamentum.sln b/Liber_Incantamentum.sln index 26099e0..480ae1a 100644 --- a/Liber_Incantamentum.sln +++ b/Liber_Incantamentum.sln @@ -1,7 +1,7 @@  Microsoft Visual Studio Solution File, Format Version 12.00 # Visual Studio Version 17 -VisualStudioVersion = 17.14.36109.1 d17.14 +VisualStudioVersion = 17.14.36109.1 MinimumVisualStudioVersion = 10.0.40219.1 Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Liber_Incantamentum.API", "Liber_Incantamentum\Liber_Incantamentum.API.csproj", "{BB761821-A9EC-4EBA-83A2-89F32C50041F}" EndProject @@ -11,6 +11,8 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Liber_Incantamentum.Applica EndProject Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Liber_Incantamentum.Infrastructure", "Liber_Incantamentum.Infrastructure\Liber_Incantamentum.Infrastructure.csproj", "{C80C19DC-06DA-45DD-ADEE-2BB0F670A014}" EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Liber_Incantamentum.Tests", "Liber_Incantamentum.Tests\Liber_Incantamentum.Tests.csproj", "{4C656BB8-ED7B-422A-A984-75522021B031}" +EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution Debug|Any CPU = Debug|Any CPU @@ -33,6 +35,10 @@ Global {C80C19DC-06DA-45DD-ADEE-2BB0F670A014}.Debug|Any CPU.Build.0 = Debug|Any CPU {C80C19DC-06DA-45DD-ADEE-2BB0F670A014}.Release|Any CPU.ActiveCfg = Release|Any CPU {C80C19DC-06DA-45DD-ADEE-2BB0F670A014}.Release|Any CPU.Build.0 = Release|Any CPU + {4C656BB8-ED7B-422A-A984-75522021B031}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {4C656BB8-ED7B-422A-A984-75522021B031}.Debug|Any CPU.Build.0 = Debug|Any CPU + {4C656BB8-ED7B-422A-A984-75522021B031}.Release|Any CPU.ActiveCfg = Release|Any CPU + {4C656BB8-ED7B-422A-A984-75522021B031}.Release|Any CPU.Build.0 = Release|Any CPU EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE diff --git a/README.md b/README.md index 1561097..85cb504 100644 --- a/README.md +++ b/README.md @@ -38,14 +38,14 @@ Développer une API professionnelle respectant les bonnes pratiques modernes : Liber_Incantamentum/ │ ├── src/ -│ ├── Liber_Incantamentum.Api/ → API (controllers, middlewares) -│ ├── Liber_Incantamentum.Application/ → Use cases (logique métier) -│ ├── Liber_Incantamentum.Domain/ → Entités, Enums, Interfaces -│ └── Liber_Incantamentum.Infrastructure/ → Persistance (ex: EF Core) +│ ├── Liber_Incantamentum.Api/ +│ ├── Liber_Incantamentum.Application/ +│ ├── Liber_Incantamentum.Domain/ +│ └── Liber_Incantamentum.Infrastructure/ │ └── tests/ - ├── Liber_Incantamentum.Tests.Unit/ → Tests unitaires - └── Liber_Incantamentum.Tests.Integration/→ Tests d’intégration & sécurité + ├── Liber_Incantamentum.Tests.Unit/ + └── Liber_Incantamentum.Tests.Integration/ ``` --- @@ -118,35 +118,6 @@ Toutes les routes sont protégées par une clé API : --- -## ▶️ Lancer le projet - -```bash -# Compilation -dotnet build - -# Lancer l’API -dotnet run --project src/Liber_Incantamentum.Api -``` - ---- - -## 🧪 Lancer les tests - -```bash -dotnet test -``` - ---- - -## ✅ Fichiers présents à la racine - -- `Liber_Incantamentum.sln` — Solution .NET -- `.editorconfig` — Convention de code -- `.gitignore` — Fichiers à ignorer -- `README.md` — Documentation du projet - ---- - ## ✨ Technologies utilisées - C# / .NET 9 From 8f3db0e1336cb62c5609002c4388e66c307692de Mon Sep 17 00:00:00 2001 From: blyssco Date: Mon, 7 Jul 2025 19:59:08 +0200 Subject: [PATCH 4/5] =?UTF-8?q?Correction=20du=20launch=20browser=20=C3=A0?= =?UTF-8?q?=20true?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Liber_Incantamentum/Properties/launchSettings.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Liber_Incantamentum/Properties/launchSettings.json b/Liber_Incantamentum/Properties/launchSettings.json index 7e1aa4a..92c536d 100644 --- a/Liber_Incantamentum/Properties/launchSettings.json +++ b/Liber_Incantamentum/Properties/launchSettings.json @@ -13,7 +13,7 @@ "https": { "commandName": "Project", "dotnetRunMessages": true, - "launchBrowser": true, + "launchBrowser": false, "applicationUrl": "https://localhost:7239;http://localhost:5225", "environmentVariables": { "ASPNETCORE_ENVIRONMENT": "Development" From d1fa49bc6b0d048c244ceab39cad189002fad39f Mon Sep 17 00:00:00 2001 From: blyssco Date: Mon, 7 Jul 2025 20:02:17 +0200 Subject: [PATCH 5/5] Nettoyage de la classe vide Class1.cs --- Liber_Incantamentum.API/Class1.cs | 7 ------- 1 file changed, 7 deletions(-) delete mode 100644 Liber_Incantamentum.API/Class1.cs diff --git a/Liber_Incantamentum.API/Class1.cs b/Liber_Incantamentum.API/Class1.cs deleted file mode 100644 index 3d81c5c..0000000 --- a/Liber_Incantamentum.API/Class1.cs +++ /dev/null @@ -1,7 +0,0 @@ -namespace Liber_Incantamentum.API -{ - public class Class1 - { - - } -}