11#Aristotle Study - User Management API
22
3+ * This project serves as a learning exercise comparing C#/.NET development patterns with Java/Spring Boot, focusing on
4+ Clean Architecture principles and modern development practices.*
5+
36<div align =" center " >
47
58[ ![ Build, Unit & Integration Tests] ( https://github.com/mayconht/Aristotle_Study/actions/workflows/ci-pipeline.yml/badge.svg )] ( https://github.com/mayconht/Aristotle_Study/actions/workflows/ci-pipeline.yml )
6- [ ![ Quality Gate Status] ( https://sonarcloud.io/api/project_badges/measure?project=mayconht_Aristotle_Study &metric=alert_status&token=e169eb95d409b4f735ecdd4d9b7cf94422518e97 )] ( https://sonarcloud.io/summary/new_code?id=mayconht_Aristotle_Study )
7- [ ![ Bugs] ( https://sonarcloud.io/api/project_badges/measure?project=mayconht_Aristotle_Study &metric=bugs&token=e169eb95d409b4f735ecdd4d9b7cf94422518e97 )] ( https://sonarcloud.io/summary/new_code?id=mayconht_Aristotle_Study )
8- [ ![ Code Smells] ( https://sonarcloud.io/api/project_badges/measure?project=mayconht_Aristotle_Study &metric=code_smells&token=e169eb95d409b4f735ecdd4d9b7cf94422518e97 )] ( https://sonarcloud.io/summary/new_code?id=mayconht_Aristotle_Study )
9- [ ![ Coverage] ( https://sonarcloud.io/api/project_badges/measure?project=mayconht_Aristotle_Study &metric=coverage&token=e169eb95d409b4f735ecdd4d9b7cf94422518e97 )] ( https://sonarcloud.io/summary/new_code?id=mayconht_Aristotle_Study )
10- [ ![ Duplicated Lines (%)] ( https://sonarcloud.io/api/project_badges/measure?project=mayconht_Aristotle_Study &metric=duplicated_lines_density&token=e169eb95d409b4f735ecdd4d9b7cf94422518e97 )] ( https://sonarcloud.io/summary/new_code?id=mayconht_Aristotle_Study )
11- [ ![ Lines of Code] ( https://sonarcloud.io/api/project_badges/measure?project=mayconht_Aristotle_Study &metric=ncloc&token=e169eb95d409b4f735ecdd4d9b7cf94422518e97 )] ( https://sonarcloud.io/summary/new_code?id=mayconht_Aristotle_Study )
12- [ ![ Reliability Rating] ( https://sonarcloud.io/api/project_badges/measure?project=mayconht_Aristotle_Study &metric=reliability_rating&token=e169eb95d409b4f735ecdd4d9b7cf94422518e97 )] ( https://sonarcloud.io/summary/new_code?id=mayconht_Aristotle_Study )
13- [ ![ Security Rating] ( https://sonarcloud.io/api/project_badges/measure?project=mayconht_Aristotle_Study &metric=security_rating&token=e169eb95d409b4f735ecdd4d9b7cf94422518e97 )] ( https://sonarcloud.io/summary/new_code?id=mayconht_Aristotle_Study )
14- [ ![ Technical Debt] ( https://sonarcloud.io/api/project_badges/measure?project=mayconht_Aristotle_Study &metric=sqale_index&token=e169eb95d409b4f735ecdd4d9b7cf94422518e97 )] ( https://sonarcloud.io/summary/new_code?id=mayconht_Aristotle_Study )
15- [ ![ Maintainability Rating] ( https://sonarcloud.io/api/project_badges/measure?project=mayconht_Aristotle_Study &metric=sqale_rating&token=e169eb95d409b4f735ecdd4d9b7cf94422518e97 )] ( https://sonarcloud.io/summary/new_code?id=mayconht_Aristotle_Study )
16- [ ![ Vulnerabilities] ( https://sonarcloud.io/api/project_badges/measure?project=mayconht_Aristotle_Study &metric=vulnerabilities&token=e169eb95d409b4f735ecdd4d9b7cf94422518e97 )] ( https://sonarcloud.io/summary/new_code?id=mayconht_Aristotle_Study )
9+ [ ![ Quality Gate Status] ( https://sonarcloud.io/api/project_badges/measure?project=mayconht_Aristotle_Demo &metric=alert_status )] ( https://sonarcloud.io/summary/new_code?id=mayconht_Aristotle_Demo )
10+ [ ![ Bugs] ( https://sonarcloud.io/api/project_badges/measure?project=mayconht_Aristotle_Demo &metric=bugs )] ( https://sonarcloud.io/summary/new_code?id=mayconht_Aristotle_Demo )
11+ [ ![ Code Smells] ( https://sonarcloud.io/api/project_badges/measure?project=mayconht_Aristotle_Demo &metric=code_smells )] ( https://sonarcloud.io/summary/new_code?id=mayconht_Aristotle_Demo )
12+ [ ![ Coverage] ( https://sonarcloud.io/api/project_badges/measure?project=mayconht_Aristotle_Demo &metric=coverage )] ( https://sonarcloud.io/summary/new_code?id=mayconht_Aristotle_Demo )
13+ [ ![ Duplicated Lines (%)] ( https://sonarcloud.io/api/project_badges/measure?project=mayconht_Aristotle_Demo &metric=duplicated_lines_density )] ( https://sonarcloud.io/summary/new_code?id=mayconht_Aristotle_Demo )
14+ [ ![ Lines of Code] ( https://sonarcloud.io/api/project_badges/measure?project=mayconht_Aristotle_Demo &metric=ncloc )] ( https://sonarcloud.io/summary/new_code?id=mayconht_Aristotle_Demo )
15+ [ ![ Reliability Rating] ( https://sonarcloud.io/api/project_badges/measure?project=mayconht_Aristotle_Demo &metric=reliability_rating )] ( https://sonarcloud.io/summary/new_code?id=mayconht_Aristotle_Demo )
16+ [ ![ Security Rating] ( https://sonarcloud.io/api/project_badges/measure?project=mayconht_Aristotle_Demo &metric=security_rating )] ( https://sonarcloud.io/summary/new_code?id=mayconht_Aristotle_Demo )
17+ [ ![ Technical Debt] ( https://sonarcloud.io/api/project_badges/measure?project=mayconht_Aristotle_Demo &metric=sqale_index )] ( https://sonarcloud.io/summary/new_code?id=mayconht_Aristotle_Demo )
18+ [ ![ Maintainability Rating] ( https://sonarcloud.io/api/project_badges/measure?project=mayconht_Aristotle_Demo &metric=sqale_rating )] ( https://sonarcloud.io/summary/new_code?id=mayconht_Aristotle_Demo )
19+ [ ![ Vulnerabilities] ( https://sonarcloud.io/api/project_badges/measure?project=mayconht_Aristotle_Demo &metric=vulnerabilities )] ( https://sonarcloud.io/summary/new_code?id=mayconht_Aristotle_Demo )
1720
1821</div >
1922
@@ -24,8 +27,8 @@ Keep in mind that this is a simple project for educational purposes and many imp
2427
2528- ** .NET 8.0** - Target framework
2629- ** ASP.NET Core Web API** - Web framework
27- - ** Entity Framework Core 9.0** - ORM withSQLite and PostgreSQLproviders
28- - ** PostgreSQL** - Alternative database (configurable)
30+ - ** Entity Framework Core 9.0** - ORM with PostgreSQLprovider
31+ - ** PostgreSQL** - Alternative database
2932- ** AutoMapper** - Object-to-object mapping
3033- ** DotNetEnv** - Environment variable loader
3134- ** Swagger/OpenAPI** - API documentation (Swashbuckle.AspNetCore)
@@ -36,6 +39,14 @@ Keep in mind that this is a simple project for educational purposes and many imp
3639- ** Keycloak** - OAuth2/OIDC identity provider for authentication
3740- ** JWT Bearer** - Token-based authentication
3841
42+ ##Pipelines
43+ <div align =" center " >
44+ <img width =" 769 " height =" 376 " alt =" image " src =" https://github.com/user-attachments/assets/df6efdf8-cb2b-4731-a5e2-4e78a855e76b " />
45+
46+
47+ <img width =" 1181 " height =" 722 " alt =" image " src =" https://github.com/user-attachments/assets/e4f1d6b3-36d9-4f28-8cbe-0ccd068b6116 " />
48+ </div >
49+
3950##Architecture
4051
4152The project follows Clean Architecture principles with the following layers:
@@ -213,7 +224,7 @@ The project is integrated with SonarCloud for code quality analysis. To configur
213224
2142251 . ** Access SonarCloud Settings** :
215226- Go to[ SonarCloud] ( https://sonarcloud.io/ ) and log in
216- - Select your project` mayconht_Aristotle_Study `
227+ - Select your project` mayconht_Aristotle_Demo `
217228- Navigate to "Administration" > "Analysis Method"
218229
2192302 . ** Configure Analysis Method** :
@@ -223,18 +234,6 @@ The project is integrated with SonarCloud for code quality analysis. To configur
2232343 . ** Required GitHub Secrets** :
224235- ` SONAR_TOKEN ` : Your SonarCloud API token (from SonarCloud user settings)
225236
226- ###Local SonarQube Setup (Optional)
227-
228- For local code quality analysis, you can run SonarQube using Docker Compose:
229-
230- ``` bash
231- # Start SonarQube and PostgreSQL
232- docker-compose up -d
233-
234- # Access SonarQube at http://localhost:9000
235- # Default credentials: admin/admin
236- ```
237-
238237###Hot Reload Feature
239238
240239The application supports hot reload with` dotnet watch ` which provides:
@@ -245,33 +244,6 @@ The application supports hot reload with `dotnet watch` which provides:
245244
246245> ** Tip** : You'll see hot reload messages in the terminal when files are changed and recompiled.
247246
248- ###Available Endpoints
249-
250- The API provides user management functionality. Check the Swagger documentation for complete API details:
251-
252- - ` GET /api/users ` - Get all users
253- - ` GET /api/users/{id} ` - Get user by ID
254- - ` PUT /api/users/{id} ` - Update user
255- - ` DELETE /api/users/{id} ` - Delete user
256-
257- ** Note** : User creation is handled automatically through JIT provisioning on first login via Keycloak.
258-
259- ###Database
260-
261- The project uses SQLite with Entity Framework Core:
262-
263- - ** Database file** :` users.db ` (created automatically)
264- - ** Migrations** : Located in` Migrations/ ` folder
265- - ** Context** :` ApplicationDbContext ` in Infrastructure layer
266-
267- To create new migrations:
268-
269- ``` bash
270- cd UserService
271- dotnet ef migrations add< MigrationName>
272- dotnet ef database update
273- ```
274-
275247###Development Workflow
276248
2772491 . Make code changes in your IDE
@@ -282,77 +254,6 @@ dotnet ef database update
2822546 . Run tests to make sure everything works
2832557 . Repeat!
284256
285- ###Project Structure
286-
287- ```
288- Aristotle_Study/
289- ├── Aristotle_Study.sln # Solution file
290- ├── coverlet.runsettings # Code coverage settings
291- ├── Dockerfile # Docker configuration
292- ├── global.json # .NET SDK version
293- ├── README.md # This file
294- ├── UserService/ # Main ASP.NET Core Web API project
295- │ ├── appsettings.Development.json
296- │ ├── appsettings.json
297- │ ├── Program.cs
298- │ ├── UserService.csproj
299- │ ├── Application/ # Application services and logic
300- │ │ ├── MappingProfile.cs
301- │ │ ├── UserValidator.cs
302- │ │ ├── DTOs/
303- │ │ ├── Exceptions/
304- │ │ └── Service/
305- │ ├── Controllers/ # API controllers
306- │ │ └── UserController.cs
307- │ ├── Domain/ # Domain entities and interfaces
308- │ │ ├── Entities/
309- │ │ ├── Exceptions/
310- │ │ └── Interfaces/
311- │ ├── Infrastructure/ # Data access and external concerns
312- │ │ ├── ApplicationDbContext.cs
313- │ │ ├── Data/
314- │ │ ├── Exceptions/
315- │ │ └── Middleware/
316- │ ├── bin/
317- │ └── obj/
318- ├── UserServiceTests/ # Unit tests for UserService
319- │ ├── UserService.UnitTests.csproj
320- │ ├── Application/
321- │ │ ├── MappingProfileTests.cs
322- │ │ ├── UserValidatorTests.cs
323- │ │ ├── Controllers/
324- │ │ ├── DTOs/
325- │ │ └── Service/
326- │ ├── Builders/
327- │ │ └── UserBuilder.cs
328- │ ├── Config/
329- │ │ └── TestConfig.cs
330- │ ├── Domain/
331- │ │ ├── Entities/
332- │ │ └── Exceptions/
333- │ ├── Infrastructure/
334- │ │ ├── ApplicationDbContextTests.cs
335- │ │ ├── Data/
336- │ │ └── Middleware/
337- │ ├── bin/
338- │ └── obj/
339- ├── Tests/ # Additional test project
340- │ ├── bin/
341- │ └── obj/
342- ├── ISTQB/ # ISTQB study materials
343- │ ├── StartHere.md
344- │ └── 1_Fundamentals-Of-Testing/
345- │ └── 1_Fundamentals.md
346- ├── bruno/ # API testing with Bruno
347- │ └── UserService API/
348- │ ├── bruno.json
349- │ ├── collection.bru
350- │ ├── environments/
351- │ └── User API Regression Test/
352- └── Aristotle_Project/ # Legacy project directory
353- ├── bin/
354- └── obj/
355- ```
356257
357258###Testing Strategy
358259
@@ -370,7 +271,7 @@ Test frameworks used:
370271- xUnit for test execution
371272- Moq for mocking dependencies
372273- Bogus for generating fake test data
373- - Verify for snapshot testing
274+ - Verify for snapshot testing - TODO
374275
375276###API Testing with Bruno
376277
@@ -400,7 +301,6 @@ or even download the [Bruno Desktop App](https://www.usebruno.com/download).
400301
401302This is an educational project, but contributions are welcome! Areas for improvement include:
402303
403- - Increase test coverage from 45% to 80%
404304- Fix .NET compiler warnings
405305- Address SonarQube security hotspots
406306- Add integration tests
@@ -412,8 +312,6 @@ This is an educational project, but contributions are welcome! Areas for improve
412312
413313** Port Issues** : If default ports are in use, modify the URLs in` Properties/launchSettings.json `
414314
415- ** Database Issues** : Delete` users.db ` file to reset the database (it will be recreated automatically)
416-
417315** Build Issues** : Run` dotnet clean ` followed by` dotnet restore ` and` dotnet build `
418316
419317---