{"id":25853658,"url":"https://github.com/omatheusribeiro/clean-architecture-template-dotnet","last_synced_at":"2026-02-24T09:03:09.044Z","repository":{"id":278454912,"uuid":"935672882","full_name":"omatheusribeiro/clean-architecture-template-dotnet","owner":"omatheusribeiro","description":"This repository has a Clean Architecture template using .NET Core 8. It applies the Code First pattern with Migrations to create a SQL Server database. The goal is to guide developers in learning and applying Clean Architecture principles in .NET applications. 🚀","archived":false,"fork":false,"pushed_at":"2025-04-28T22:52:09.000Z","size":134,"stargazers_count":1,"open_issues_count":0,"forks_count":1,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-07-29T17:44:26.851Z","etag":null,"topics":["architecture","auto-mapper","automapper","clean-architecture","code-first","codefirst","dotnet","dotnet-core","dotnet-core-8","entity-framework","entity-framework-core","jwt","jwt-authentication","jwt-token","migration","sql","sql-server","viewmodel","xunit"],"latest_commit_sha":null,"homepage":"","language":"C#","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"gpl-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/omatheusribeiro.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2025-02-19T20:35:58.000Z","updated_at":"2025-04-28T22:52:12.000Z","dependencies_parsed_at":null,"dependency_job_id":"7c9f7681-104d-438c-bb56-bcb9aff36efa","html_url":"https://github.com/omatheusribeiro/clean-architecture-template-dotnet","commit_stats":null,"previous_names":["omatheusribeiro/clean-architecture-template-dotnet"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/omatheusribeiro/clean-architecture-template-dotnet","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/omatheusribeiro%2Fclean-architecture-template-dotnet","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/omatheusribeiro%2Fclean-architecture-template-dotnet/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/omatheusribeiro%2Fclean-architecture-template-dotnet/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/omatheusribeiro%2Fclean-architecture-template-dotnet/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/omatheusribeiro","download_url":"https://codeload.github.com/omatheusribeiro/clean-architecture-template-dotnet/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/omatheusribeiro%2Fclean-architecture-template-dotnet/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":29777609,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-02-24T04:54:30.205Z","status":"ssl_error","status_checked_at":"2026-02-24T04:53:58.628Z","response_time":75,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["architecture","auto-mapper","automapper","clean-architecture","code-first","codefirst","dotnet","dotnet-core","dotnet-core-8","entity-framework","entity-framework-core","jwt","jwt-authentication","jwt-token","migration","sql","sql-server","viewmodel","xunit"],"created_at":"2025-03-01T15:18:56.458Z","updated_at":"2026-02-24T09:03:04.029Z","avatar_url":"https://github.com/omatheusribeiro.png","language":"C#","funding_links":[],"categories":[],"sub_categories":[],"readme":"# 📌 Clean Architecture .NET 8 API\n\n## 📚 Overview\nThe **Clean Architecture .NET 8 API** is a structured and well-organized example of implementing Clean Architecture using **.NET Core 8**. This project serves as a learning reference for developers who want to understand and implement Clean Architecture using best practices and modern development patterns. 🚀\n\nThis repository demonstrates:\n\n👉 **Separation of Concerns (SoC) through Clean Architecture** 🏰  \n👉 **Implementation of Code First with Migrations** 🛂  \n👉 **Usage of Repository Pattern and Unit of Work** 🔄  \n👉 **Automated Testing with xUnit** 🧪  \n👉 **Authentication and Authorization with JWT** 🔑   \n\n## 🏰 Project Structure\n```\nclean-architecture-dotnet.Api\n ├── Config              # Configuration files, such as AutoMapper settings\n │   ├── MappingConfig   # Mapping profiles for AutoMapper\n ├── Controllers         # API controllers handling HTTP requests\n │   ├── V1              # Versioned API controllers\n ├── Middlewares         # Custom middleware components\n ├── Properties          # Metadata and project properties\n\nclean-architecture-dotnet.Application\n ├── Mappings           # AutoMapper configuration for domain-to-view model mappings\n ├── Models             # Application-level data models\n │   ├── Http          # HTTP request/response models\n ├── Services           # Business logic and service layer\n │   ├── Login         # Authentication and authorization logic\n │   │   ├── Interfaces # Interfaces for login services\n │   ├── Products      # Product-related business logic\n │   │   ├── Interfaces # Interfaces for product services\n │   ├── Sales         # Sales-related business logic\n │   │   ├── Interfaces # Interfaces for sales services\n │   ├── Users         # User-related business logic\n │   │   ├── Interfaces # Interfaces for user services\n ├── ViewModels         # View models for API responses\n │   ├── Products      # Product-related view models\n │   ├── Sales         # Sales-related view models\n │   ├── Users         # User-related view models\n\nclean-architecture-dotnet.Domain\n ├── Entities           # Core domain entities\n │   ├── Base          # Base classes for domain entities\n │   ├── Products      # Product entity definitions\n │   ├── Sales         # Sales entity definitions\n │   ├── Users         # User entity definitions\n ├── Enums              # Enumeration types for the domain layer\n\nclean-architecture-dotnet.Infrastructure\n ├── Authentication      # Authentication implementation (JWT, token management)\n ├── Context            # Database context configuration (Entity Framework Core)\n ├── EntitiesConfiguration # Database table configurations (EF Core Fluent API)\n │   ├── Products      # Product table configurations\n │   ├── Sales         # Sales table configurations\n │   ├── Users         # User table configurations\n ├── Repositories       # Data access layer\n │   ├── Products      # Product repository implementations\n │   │   ├── Interfaces # Repository interfaces\n │   ├── Sales         # Sales repository implementations\n │   │   ├── Interfaces # Repository interfaces\n │   ├── Users         # User repository implementations\n │   │   ├── Interfaces # Repository interfaces\n\nclean-architecture-dotnet.Tests\n ├── Application       # Application layer testing\n │   ├── Products      # Product tests implementations\n │   ├── Sales         # Sales tests implementations\n │   ├── Users         # User tests implementations\n```\n\n## 🎼 Screenshots\n\u003cp align=\"center\"\u003e\n  \u003cimg src=\"https://github.com/user-attachments/assets/eec7416c-dc82-4a9f-8a8f-c1cb6439b8a4\" alt=\"Screenshot 1\"\u003e\n\u003c/p\u003e\n\u003cp align=\"center\"\u003e\n  \u003cimg src=\"https://github.com/user-attachments/assets/ac84c606-b79e-49fb-a632-01cb51b55d6d\" alt=\"Architecture Diagram\"\u003e\n\u003c/p\u003e\n\u003cp align=\"center\"\u003e\n  \u003cimg src=\"https://github.com/user-attachments/assets/53ace5f6-274a-4d5e-b38f-e57d689db2f7\" alt=\"Screenshot 2\"\u003e\n\u003c/p\u003e\n\n## 🚀 Getting Started\n\n### 📝 Prerequisites\nMake sure you have the following installed:\n- [.NET Core 8 SDK](https://dotnet.microsoft.com/download/dotnet/8.0)\n- [SQL Server](https://www.microsoft.com/en-us/sql-server/sql-server-downloads)\n- [Postman](https://www.postman.com/) (optional, for API testing)\n\n### 🔧 Installation\n```bash\n# Clone the repository\ngit clone https://github.com/omatheusribeiro/clean-architecture-template-dotnet.git\ncd clean-architecture-template-dotnet\n```\n\n### ⚙️ Configuration\nBefore running the application, configure the **database connection string** in:\n- `appsettings.json`\n- `appsettings.Development.json`\n\nExample:\n```json\n\"ConnectionStrings\": {\n  \"DefaultConnection\": \"Data Source=localhost\\\\SQLEXPRESS;Initial Catalog=clean-architecture-dotnet;Integrated Security=True;TrustServerCertificate=True\"\n}\n```\n\n### ▶️ Running the Application\n```bash\n# Start the API\ndotnet run --project clean-architecture-dotnet.Api\n```\nThe application will automatically check if the database and tables exist. If not, they will be created upon execution.\n\n## 🔑 Authentication \u0026 Initial Token Usage\nTo generate an authentication token, use the following credentials in the **login endpoint**:\n- **Email:** `usertest@test.com.br`\n\n## 🛠️ Features \u0026 Modules\nThis application includes:\n\n👉 **User Registration (With Address \u0026 Contact Info)** 👤  \n👉 **Product Management (With Product Types)** 🛂  \n👉 **Sales Registration (With Business Rules Applied)** 💰  \n\n## 🛠️ Technologies Used\n- **.NET Core 8** 🚀\n- **Entity Framework Core (Code First + Migrations)** 🏰\n- **SQL Server** 📂\n- **AutoMapper** 🔄\n- **xUnit (Unit Testing)** 🧪\n- **JWT Authentication** 🔑\n- **Repository \u0026 Service Layer Pattern** 📚\n\n## 📄 License\nThis project is licensed under the GPL-2.0 License.\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fomatheusribeiro%2Fclean-architecture-template-dotnet","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fomatheusribeiro%2Fclean-architecture-template-dotnet","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fomatheusribeiro%2Fclean-architecture-template-dotnet/lists"}