Self-Authored Microservices Starter: Layered Architecture Template + Reference ERP Implementation

A reusable .NET 8 project template (packaged as a dotnet new template, katmanlibase) implementing a consistent 6-layer architecture — Entity, DataAccess, Business, Service, API, Extensions — paired with a full reference implementation demonstrating the pattern at scale: an API Gateway (YARP), an Identity service with dynamic endpoint-level RBAC, and a CRM service with real domain entities, all wired together with JWT auth, hybrid Dapper/EF Core data access, and asynchronous centralized logging over RabbitMQ. This template now bootstraps new backend services across other projects.

Architecture Template Author & Backend Developer

  1. Reusable Project Template – Packaged a 6-layer Clean-Architecture-style solution structure as a custom dotnet new template so new microservices can be scaffolded consistently in minutes instead of hours.
  2. API Gateway Pattern – Stood up a YARP-based gateway routing to independently deployable Identity, CRM, Logging and R&D services.
  3. Dynamic Endpoint-Level RBAC – Designed a permission model keyed on endpoint + HTTP-method pairs, enforced via custom middleware with a SuperAdmin bypass, instead of static role attributes.
  4. Hybrid Data Access – Combined Dapper for read-heavy queries with EF Core for writes and migrations across every service, balancing raw query performance against maintainability.
  5. Async Centralized Logging – Built a RabbitMQ producer/consumer pipeline (shared LogClient library feeding a LogService) so every service logs asynchronously without blocking request paths.

Features

  1. Self-authored, reusable 6-layer .NET microservice template (packaged as a dotnet new generator)
  2. YARP API Gateway fronting independently deployable services
  3. Dynamic endpoint-level RBAC (endpoint + HTTP method permission pairs)
  4. JWT auth with DB-backed refresh-token revocation
  5. Hybrid Dapper + EF Core data access per service
  6. Asynchronous, decoupled logging pipeline over RabbitMQ
  7. Now used to bootstrap new backend services in other projects

Technologies

  1. .NET 8 Web API
  2. C#
  3. dotnet new custom templates
  4. YARP Reverse Proxy
  5. Entity Framework Core 9 + Dapper (hybrid)
  6. RabbitMQ
  7. AutoMapper
  8. FluentValidation
  9. ASP.NET Core Identity + JWT
  10. PostgreSQL
Associated with