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.


📂 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/todos Get all todo items
GET /api/todos/{id} Get todo by ID
POST /api/todos Create a new todo
PUT /api/todos/{id} Update existing todo
DELETE /api/todos/{id} Delete todo

📦 Example Request

Create Todo

POST /api/todos
{
  "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.


📜 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