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
- 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.
- API Gateway Pattern – Stood up a YARP-based gateway routing to independently deployable Identity, CRM, Logging and R&D services.
- 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.
- 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.
- 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
- Self-authored, reusable 6-layer .NET microservice template (packaged as a dotnet new generator)
- YARP API Gateway fronting independently deployable services
- Dynamic endpoint-level RBAC (endpoint + HTTP method permission pairs)
- JWT auth with DB-backed refresh-token revocation
- Hybrid Dapper + EF Core data access per service
- Asynchronous, decoupled logging pipeline over RabbitMQ
- Now used to bootstrap new backend services in other projects
Technologies
- .NET 8 Web API
- C#
- dotnet new custom templates
- YARP Reverse Proxy
- Entity Framework Core 9 + Dapper (hybrid)
- RabbitMQ
- AutoMapper
- FluentValidation
- ASP.NET Core Identity + JWT
- PostgreSQL