|
| 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. |
| 3 | + |
| 4 | +## Technologies and tools used |
| 5 | +* .NET 8.0 |
| 6 | +* ASP.NET Core |
| 7 | +* Mapster |
| 8 | +* Entity Framework Core with SQL Server |
| 9 | +* Swashbuckle |
| 10 | +* FluentValidation |
| 11 | +* SharpGrip.FluentValidation.AutoValidation |
| 12 | + |
| 13 | +## Features |
| 14 | +* **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 | +* **Invitation links**: Users can create invitation links for their to-do lists to allow other users to join them. |
| 16 | +* **Search and Filtering**: Most endpoints allow users to specify filtering criteria and search prompts. |
| 17 | +* **Authentication and Authorization**: This feature utilizes JWT and refresh tokens for secure user authentication and authorization. |
| 18 | +* **Role Permissions and Priorities system**: Each to-do list has its own roles with different sets of permissions. Additionally, each role is assigned a priority level. Roles with the highest priority can modify and assign roles with lower priority. |
| 19 | +* **Swagger documentation**: The API is documented using Swagger, providing a convenient way for developers to explore and understand the API endpoints. |
| 20 | +* **Integration testing**: Integration tests utilize `Testcontainers` for comprehensive testing of API functionality and interactions. |
| 21 | + |
| 22 | +## Architecture Overview |
| 23 | +The Advanced Todo List application follows a clean architecture. The main three layers are: |
| 24 | + |
| 25 | +### Core Layer (`AdvancedTodoList.Core`) |
| 26 | +* Contains services and repositories interfaces. |
| 27 | +* Defines the entities and value objects representing the domain model. |
| 28 | +* Provides services for CRUD operations, task management, user authentication, authorization, etc. |
| 29 | +* Defines specifications to query and filter parameters. |
| 30 | +* Implements validation logic using FluentValidation for ensuring data integrity and consistency. |
| 31 | + |
| 32 | +### Infrastructure Layer (`AdvancedTodoList.Infrastructure`) |
| 33 | +* Handles data access and infrastructure-related concerns. |
| 34 | +* Implements repositories and data access logic using Entity Framework Core. |
| 35 | +* Manages database context and configuration. |
| 36 | +* Handles JWT and refresh tokens. |
| 37 | +* Implements services and specifications. |
| 38 | + |
| 39 | +### Application Layer (`AdvancedTodoList`) |
| 40 | +* 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. |
| 42 | +* Uses authentication and authorization mechanisms to secure endpoints. |
| 43 | +* Facilitates error handling and response formatting. |
| 44 | +* Exposes Swagger documentation. |
| 45 | + |
| 46 | +## Testing Approach |
| 47 | +The `AdvancedTodoList` application uses two types of automated tests: unit tests and integration tests. |
| 48 | + |
| 49 | +### Integration tests |
| 50 | +Integration tests validate the interaction between different components and layers of the application. |
| 51 | + |
| 52 | +#### Scope: |
| 53 | +* **Endpoints layer**: API endpoints are tested using a simulated HTTP client to verify correct request handling, response generation, and error handling. |
| 54 | +* **Service layer**: The data access layer is mocked, and services are tested to ensure proper business logic execution, error handling, and interaction with external dependencies. |
| 55 | +* **Data access layer**: Repository implementations are tested with a database running on a test container to ensure that repositories interact correctly with Entity Framework Core and the MsSql database. |
| 56 | + |
| 57 | +### Unit tests |
| 58 | +Unit tests validate individual units of code in isolation from external dependencies. |
| 59 | + |
| 60 | +#### Scope: |
| 61 | +* **Core Logic**: Simple service methods, validators, specifications, and other core components. |
| 62 | +* **Utilities and Helpers**: Utility classes, helper functions, and extension methods. |
| 63 | + |
| 64 | +## Tools used for testing |
| 65 | +* NUnit |
| 66 | +* NSubstitutes |
| 67 | +* Microsoft.AspNetCore.Mvc.Testing |
| 68 | +* Testcontainers.MsSql |
0 commit comments