$8

Clean Architecture .NET 9 Web API Starter — CQRS, MediatR, JWT, Redis, RabbitMQ

Add to cart

Clean Architecture .NET 9 Web API Starter — CQRS, MediatR, JWT, Redis, RabbitMQ

$8
1 rating


Ship enterprise-grade APIs fast—without reinventing the stack.
This .NET 9 Clean Architecture starter organizes your code into Domain / Application / Infrastructure / WebApi with CQRS + MediatR, JWT auth, Redis cache, RabbitMQ, Hangfire, and Polly baked in. It’s a battle-tested foundation that lets you focus on business features, not plumbing.

Why teams choose this template

  • Clean Architecture → strict boundaries keep code maintainable at scale.
  • CQRS + MediatR → predictable flows, easy testing, and vertical slice features.
  • Architecture tests → prevent drift across entities, value objects, and handlers.
  • FluentValidation → robust command/query validation.
  • SecurityJWT auth/authorization scaffolding and HTTPS patterns.
  • ResiliencePolly policies for retries/timeouts/circuit breakers.
  • PerformanceRedis distributed cache (with in-memory fallback).
  • MessagingRabbitMQ integration (plus in-memory bus for dev).
  • Background jobsHangfire dashboard & recurring jobs.
  • Rate limiting → protect your API and control costs.
  • EF Core (code-first) → migrations-ready data access.
  • DevExSwagger/OpenAPI, structured logging, Docker, and compose.

Built-in Features (✅ implemented)

  • Clean Architecture layers (Domain / Application / Infrastructure / WebApi)
  • CQRS with MediatR
  • Unit & architecture tests (xUnit, FluentAssertions, Moq)
  • FluentValidation
  • SMTP email integration
  • JWT authentication & authorization
  • Unit of Work + generic repositories + Specification pattern
  • Custom middleware (error handling & rate limiting)
  • EF Core code-first
  • Polly resilience for HTTP clients
  • Redis cache (fallback to memory)
  • RabbitMQ messaging (fallback in-memory)
  • Hangfire background jobs
  • Dockerfile & docker-compose
  • Structured logging (console)

Project Structure

CleanArchitectureApi/
├── src/
│   ├── Domain/
│   │   ├── Common/
│   │   ├── Entities/
│   │   ├── Events/
│   │   ├── Specifications/
│   │   └── ValueObjects/
│   ├── Application/
│   │   ├── Behaviors/
│   │   ├── DTOs/
│   │   ├── Features/
│   │   ├── Interfaces/
│   │   └── Mappings/
│   ├── Infrastructure/
│   │   ├── Data/
│   │   ├── Repositories/
│   │   └── Services/
│   └── WebApi/
│       ├── Controllers/
│       ├── Middleware/
│       └── Program.cs
├── tests/
│   ├── UnitTests/
│   └── IntegrationTests/
├── docker-compose.yml
├── Dockerfile
└── README.md

Who it’s for

  • .NET developers & teams shipping features quickly with guardrails
  • Solution architects enforcing standards across services
  • Agencies/contractors starting client projects on a solid base

FAQ

Is it production-ready?
Yes—boundaries, validation, resilience, logging, rate limiting, Docker, tests. Add your cloud TLS, secrets, and observability and deploy.

Can I swap infrastructure pieces?
Absolutely. Redis/RabbitMQ are optional; in-memory fallbacks ease local dev.

How do I add a feature?
Create a vertical slice under Application/Features with command/query, handler, validators, tests, and minimal changes to controllers.

Does it include integration tests?
Yes—samples plus guidance to add more.

License?
MIT—commercial use allowed.

Add to cart
44 sales

Production-ready template with architecture tests, FluentValidation, Hangfire jobs, rate limiting, Docker, and resilient HTTP via Polly.

Size
14.8 MB

Ratings

5
(1 rating)
5 stars
100%
4 stars
0%
3 stars
0%
2 stars
0%
1 star
0%