A production-ready RESTful API for task management built with ASP.NET Core 9.0, featuring comprehensive testing, clean architecture, and modern development practices.
- RESTful API - Complete CRUD operations for task management
- Comprehensive Testing - 7+ unit and validation tests with >85% coverage
- Entity Framework Core - Modern ORM with InMemory database
- Priority Management - Low, Medium, High task prioritization
- Data Validation - DTOs with comprehensive validation rules
- Clean Architecture - Separation of concerns with SOLID principles
- Swagger/OpenAPI - Interactive API documentation
- AI-Assisted Development – Used GitHub Copilot to speed up implementation of APIs, unit tests, and debugging.
- C# (.NET 9.0) - Latest .NET framework
- ASP.NET Core Web API - Modern web framework
- Entity Framework Core - ORM with InMemory database provider
- Swagger/OpenAPI - API documentation
- xUnit 2.9 - Testing framework
- Moq 4.20 - Mocking library
- Microsoft.AspNetCore.Mvc.Testing - Integration test support
- InMemory Database - Isolated test environment
- Vanilla JavaScript (ES6+) - Modern JavaScript features
- HTML5 & CSS3 - Semantic markup and responsive design
- Glassmorphism UI - Modern dark theme with frosted glass effects
cd TaskFlowAPI.Tests
dotnet test
Unit Tests (TasksControllerTests.cs
)
- Controller CRUD operations with InMemory database
- HTTP status code validation (200 OK, 201 Created, 204 No Content, 404 Not Found)
- Business logic verification (auto-setting
CompletedAt
timestamp when status ch anges to Done) - Dependency injection with mocked
ILogger
Validation Tests (ModelValidationTests.cs
)
- DTO validation rules using DataAnnotations
- Input constraint testing (min/max length, required fields)
- Default value verification for domain entities
- Edge case handling for invalid inputs
Technologies:
- xUnit - Modern, extensible testing framework
- Moq - Dependency mocking for isolated unit tests
- InMemory Database - Fast, isolated test environment (new instance per test)
- Microsoft.AspNetCore.Mvc.Testing - Full HTTP pipeline testing support
# Run only controller tests
dotnet test --filter TasksControllerTests
# Run only validation tests
dotnet test --filter ModelValidationTests
# Run with detailed output
dotnet test --verbosity detailed
- .NET 9.0 SDK
- Any modern web browser
- Visual Studio 2022 / VS Code / Rider (optional)
git clone https://github.com/d2mariad/TaskFlowAPI.git
cd TaskFlowAPI
dotnet restore
cd TaskFlowAPI
dotnet run
The API will start at http://localhost:5247
- Swagger UI: http://localhost:5247/swagger
- API Base: http://localhost:5247/api/tasks
- Frontend Demo: http://localhost:5247/index.html
Method | Endpoint | Description | Response |
---|---|---|---|
GET |
/api/tasks |
Get all tasks (ordered by creation date) | 200 OK |
GET |
/api/tasks/{id} |
Get specific task by ID | 200 OK / 404 Not Found |
POST |
/api/tasks |
Create new task | 201 Created |
PUT |
/api/tasks/{id} |
Update existing task | 200 OK / 404 Not Found |
DELETE |
/api/tasks/{id} |
Delete task | 204 No Content / 404 Not Found |
POST /api/tasks
Content-Type: application/json
{
"title": "Implement user authentication",
"description": "Add JWT-based authentication system",
"priority": 2,
"dueDate": "2025-10-15T00:00:00Z"
}
{
"id": 1,
"title": "Implement user authentication",
"description": "Add JWT-based authentication system",
"status": "Todo",
"priority": "High",
"dueDate": "2025-10-15T00:00:00Z",
"createdAt": "2025-10-04T10:30:00Z",
"completedAt": null
}
CreateTaskDto:
title
: Required, 3-200 charactersdescription
: Optional, max 1000 characterspriority
: Enum (Low=0, Medium=1, High=2), default: MediumdueDate
: Optional DateTime
UpdateTaskDto:
- All fields optional (partial updates supported)
- Same validation rules apply when fields are provided
- Setting status to
Done
automatically setscompletedAt
timestamp
The API is configured to accept requests from any origin for development purposes. For production, configure CORS properly in Program.cs
:
builder.Services.AddCors(options =>
{
options.AddPolicy("Production", policy =>
{
policy.WithOrigins("https://yourdomain.com")
.AllowAnyMethod()
.AllowAnyHeader();
});
});
Planned features for v2.0:
- JWT Authentication & Authorization
- PostgreSQL/SQL Server database support
- Task assignment to users
- Search and filtering endpoints
- Task categories and tags
- Email notifications
Maria Dia
- Built with ASP.NET Core and Entity Framework Core
- Inspired by modern API design patterns and clean architecture
- Developed as part of continuous learning in software engineering
- AI-assisted development with GitHub Copilot and Claude