|
| 1 | +# .NET Todo Application - Development Guidelines |
| 2 | + |
| 3 | +## Purpose of the Application |
| 4 | +The .NET Todo application is a command-line utility inspired by the Todo.txt shell script. It provides a robust and extensible way to manage tasks using a plain text file. The application aims to remain faithful to the original Todo.txt functionality while leveraging modern .NET features. |
| 5 | + |
| 6 | +## Coding Style |
| 7 | +- **Language**: C# |
| 8 | +- **Framework**: .NET Core |
| 9 | +- **Conventions**: The project adheres to standard C# coding conventions, including PascalCase for public members and camelCase for private members. |
| 10 | +- **Dependency Injection**: The application uses Microsoft.Extensions.DependencyInjection for managing dependencies. |
| 11 | +- **Async/Await**: Asynchronous programming is used extensively for I/O-bound operations. |
| 12 | +- **Command Pattern**: Commands and queries are implemented using the MediatR library. |
| 13 | + |
| 14 | +## Architecture |
| 15 | +The application follows a modular clean architecture with the following layers: |
| 16 | + |
| 17 | +1. **Domain Layer** (`todo.domain`): |
| 18 | + - Contains core entities like `TaskItem` and interfaces such as `ITaskFile` and `ITaskConfiguration`. |
| 19 | + - Implements business logic and rules. |
| 20 | + |
| 21 | +2. **Application Layer** (`todo.application`): |
| 22 | + - Implements commands and queries using the MediatR library. |
| 23 | + - Provides handlers for operations like adding, deleting, and listing tasks. |
| 24 | + |
| 25 | +3. **Infrastructure Layer** (`todo.infrastructure`): |
| 26 | + - Handles persistence and configuration management. |
| 27 | + - Implements interfaces defined in the domain layer. |
| 28 | + |
| 29 | +4. **Presentation Layer** (`todo`): |
| 30 | + - Contains the `TodoApplication` class, which serves as the entry point. |
| 31 | + - Implements CLI commands using `System.CommandLine`. |
| 32 | + |
| 33 | +## NuGet Packages Used |
| 34 | +- **MediatR**: Implements the mediator pattern for handling commands and queries. |
| 35 | +- **System.CommandLine**: Provides a framework for building command-line applications. |
| 36 | +- **ColoredConsole**: Adds colorized output to the console. |
| 37 | +- **NUnit**: Used for unit testing. |
| 38 | +- **FluentAssertions**: Provides a fluent syntax for writing assertions in tests. |
| 39 | + |
| 40 | +## Testing Style |
| 41 | +- **Framework**: NUnit |
| 42 | +- **Mocking**: Custom mocks (e.g., `TaskFileMock`) are used to simulate dependencies. |
| 43 | +- **Structure**: Tests are organized by layer and feature (e.g., `Commands`, `Queries`). |
| 44 | +- **Assertions**: FluentAssertions is used for readable and expressive assertions. |
| 45 | +- **Setup**: Common setup logic is placed in `[SetUp]` methods. |
| 46 | + |
| 47 | +## CI/CD Workflow |
| 48 | +The project includes a GitHub Actions workflow (`.github/workflows/dotnet-core.yml`) that: |
| 49 | +- Restores dependencies. |
| 50 | +- Builds the project in Release mode. |
| 51 | +- Runs unit tests. |
| 52 | +- Packages the application as a NuGet package. |
| 53 | +- Publishes the package to GitHub Packages and NuGet.org. |
0 commit comments