Task Api
Learn Python, JavaScript, Java and more with free interactive lessons, real projects and a built-in help dictionary. Beginner-friendly.
Part of the free C# course at LearnCodingFast — hands-on lessons with examples you run in your browser, plus practice exercises and a quick quiz.
Advanced Project — Clean Architecture, JWT Auth, EF Core, Testing
🧠 Project Overview
Build a production-grade task management REST API using ASP.NET Core with Clean Architecture. This project demonstrates every core backend skill: authentication, database access, business logic, validation, and testing.
🎯 Requirements
- • CRUD operations for tasks with filtering and pagination
- • JWT authentication — register, login, refresh tokens
- • Role-based authorization (Admin vs User)
- • EF Core with repository pattern and migrations
- • Input validation with FluentValidation
- • Unit tests for all use case handlers
- • Swagger/OpenAPI documentation
Step 1: Domain Entity
Start with the domain entity — it enforces business rules and is independent of any framework.
Step 2: API Controller
The controller is thin — it delegates to use case handlers via MediatR and extracts the user ID from the JWT claims.
Step 3: Unit Tests
Test every use case handler with Moq. Verify that domain rules are enforced and repositories are called correctly.
Challenge Complete Checklist
- ☐ All CRUD endpoints work with Swagger
- ☐ JWT auth protects all endpoints
- ☐ Admin role can see all tasks; users see only their own
- ☐ 80%+ unit test coverage
- ☐ Published to GitHub with README