Skip to content

H0DEI/CleanArch

Repository files navigation

🧱 Clean Architecture Web API (.NET 8)

.NET 8 Clean Architecture REST API License: MIT

A professional Web API project built using Clean Architecture, .NET 8, Entity Framework Core, CQRS, Dependency Injection, and proper domain-driven structure.

This repository is designed as a portfolio-grade backend project showing best practices used in modern .NET development.

🧰 Tech Stack

  • .NET 8
  • C#
  • Clean Architecture
  • CQRS + MediatR
  • Entity Framework Core
  • SQL Server / LocalDB
  • FluentValidation (si lo agregas más adelante)
  • Swagger / OpenAPI
  • Dependency Injection
  • Repository Pattern
  • Domain-Driven Design (DDD) principles

📂 Project Structure

CleanArch/
│── CleanArch.Api/           → Presentation layer (controllers, DTOs, swagger)
│── CleanArch.Application/   → Use cases, CQRS, DTOs, validation
│── CleanArch.Domain/        → Entities, enums, interfaces, core logic
│── CleanArch.Infrastructure/→ EF Core, repositories, persistence

🚀 Features

  • Fully structured Clean Architecture
  • REST API with CRUD operations
  • DTO validation
  • Repository pattern
  • EF Core with migrations
  • Dependency Injection everywhere
  • Swagger UI
  • Async/Await all the way
  • Extensible and production-ready

🛠 Getting Started

1️⃣ Restore Dependencies

dotnet restore

2️⃣ Apply EF Core Migrations

dotnet ef database update --project CleanArch.Infrastructure

3️⃣ Run the API

dotnet run --project CleanArch.Api

API available at:

https://localhost:5001
http://localhost:5000

Swagger UI:

/swagger

🔗 Endpoints Overview

Method Endpoint Description
GET /api/TodoItems Get all todo items
GET /api/TodoItems/{id} Get todo item by ID
POST /api/TodoItems Create a new todo item
PUT /api/TodoItems/{id} Update an existing item
DELETE /api/TodoItems/{id} Delete a todo item

📦 Example Request

Create Todo

POST /api/TodoItems
{
  "title": "Learn Clean Architecture",
  "description": "Understand layered patterns"
}

⭐ Why this project matters

This repository shows that you understand:

  • Enterprise-level architecture
  • Separation of concerns
  • Dependency Inversion
  • Clean, testable code
  • Professional backend development

Perfect for recruiters, interviews, and portfolio highlights.


🛠️ Roadmap

  • Project structure with Clean Architecture
  • CRUD operations for TodoItems
  • CQRS with MediatR (Commands & Queries)
  • Swagger documentation
  • Add FluentValidation for DTOs
  • Add pagination to GET /TodoItems
  • Implement unit tests (xUnit / NUnit)
  • Add authentication (JWT)
  • Deploy to Azure / Render
  • Add CI/CD pipeline with GitHub Actions

📜 License

This project is under the MIT License.

About

Clean Architecture Web API in .NET 8 (EF Core, CQRS, REST).

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages