|
1 | 1 | # AdvancedTodoList |
2 | | -**AdvancedTodoList**, developed as my personal project, is a Web API for managing to-do lists in teams, where each member can have a role and different sets of permissions. It's based on ASP.NET Core and Entity Framework Core with SQL Server running on Docker. |
| 2 | +**AdvancedTodoList**, developed as my personal project, is a Web API for managing tasks in team settings, where each member can have a role and different sets of permissions. It's based on ASP.NET Core and Entity Framework Core with SQL Server running on Docker. |
3 | 3 |
|
4 | 4 | ## Technologies and tools used |
5 | 5 | * .NET 8.0 |
|
11 | 11 | * SharpGrip.FluentValidation.AutoValidation |
12 | 12 |
|
13 | 13 | ## Features |
| 14 | + |
14 | 15 | * **Collaborative to-do list management**: The API allows users to add new tasks (`TodoListItem`) to their to-do lists, update task details, mark tasks as completed/skipped, or delete them when they're no longer needed. |
15 | 16 | * **Invitation links**: Users can create invitation links for their to-do lists to allow other users to join them. |
16 | 17 | * **Search and Filtering**: Most endpoints allow users to specify filtering criteria and search prompts. |
|
20 | 21 | * **Integration testing**: Integration tests utilize `Testcontainers` for comprehensive testing of API functionality and interactions. |
21 | 22 |
|
22 | 23 | ## Architecture Overview |
23 | | -The Advanced Todo List application follows a clean architecture. The main three layers are: |
| 24 | +This project follows a pragmatic, clean-architecture inspired layout that balances separation of concerns with developer productivity. The solution preserves clear layer responsibilities and interfaces while choosing to use EF Core directly where it simplifies the codebase. |
24 | 25 |
|
25 | 26 | ### Core Layer (`AdvancedTodoList.Core`) |
26 | | -* Contains services and repositories interfaces. |
| 27 | + |
| 28 | +A layer that defines the application's domain and data access contracts. |
| 29 | + |
| 30 | +* Contains data access services interfaces (e.g. repositories). |
27 | 31 | * Defines the entities and value objects representing the domain model. |
28 | | -* Provides services for CRUD operations, task management, user authentication, authorization, etc. |
29 | 32 | * Defines specifications to query and filter parameters. |
| 33 | + |
| 34 | +### Application Layer (`AdvancedTodoList.Application`) |
| 35 | + |
| 36 | +The business logic layer that depends on the Core. |
| 37 | + |
| 38 | +* Provides services for business logic such as CRUD operations, task management, user authentication, authorization, etc. |
30 | 39 | * Implements validation logic using FluentValidation for ensuring data integrity and consistency. |
| 40 | +* Contains data transfer objects and application options. |
31 | 41 |
|
32 | 42 | ### Infrastructure Layer (`AdvancedTodoList.Infrastructure`) |
| 43 | + |
| 44 | +Handles the direct EF Core data access. Depends on the Core. |
| 45 | + |
33 | 46 | * Handles data access and infrastructure-related concerns. |
34 | 47 | * Implements repositories and data access logic using Entity Framework Core. |
35 | 48 | * Manages database context and configuration. |
36 | | -* Handles JWT and refresh tokens. |
37 | | -* Implements services and specifications. |
38 | 49 |
|
39 | | -### Application Layer (`AdvancedTodoList`) |
| 50 | +### Presentation Layer (`AdvancedTodoList.WebApi`) |
| 51 | + |
| 52 | +A layer that enables HTTP methods. Directly depends on the Core (filter and pagination parameters) and Application (service interfaces) layers. Indirectly depends on the Infrastructure, but only for mapping services to the interfaces for Dependency Injection. |
| 53 | + |
40 | 54 | * Implements RESTful API endpoints using ASP.NET Core Web API. |
41 | | -* Handles incoming HTTP requests, validates input data, and delegates to services for business logic execution. |
| 55 | +* Handles incoming HTTP requests, validates input data (using middleware), and delegates to services for business logic execution. |
42 | 56 | * Uses authentication and authorization mechanisms to secure endpoints. |
43 | 57 | * Facilitates error handling and response formatting. |
44 | 58 | * Exposes Swagger documentation. |
45 | 59 |
|
| 60 | +## Design Choices Justifications |
| 61 | + |
| 62 | +* Use of EF Core in the domain layer - despite being a clean-architecture violation, this choice significantly reduces mapping boilerplate and makes many queries simpler and more expressive by leveraging EF Core/LINQ directly against the model. It is justified here because the project commits to a single, stable data provider that is unlikely to change. |
| 63 | +* Repository and Unit of Work implementations over `DbContext` - repository + UoW provide clear, testable contracts and centralize common data operations (pagination, specification application, common query helpers), which reduces duplication and keeps transactional boundaries explicit. |
| 64 | +* Creating interfaces for services that have only one implementation - primarily improves testability (easy mocking/faking) and decouples callers from concrete implementations, which helps when composing dependencies in DI. |
| 65 | + |
46 | 66 | ## Testing Approach |
47 | 67 | The `AdvancedTodoList` application uses two types of automated tests: unit tests and integration tests. |
48 | 68 |
|
|
0 commit comments