FG.CleanArchitecture.Template
1.0.0
Suggested Alternatives
Additional Details
my new best clean architecture template
dotnet new install FG.CleanArchitecture.Template@1.0.0
This package contains a .NET Template Package you can call from the shell/command line.
FG.CleanArchitecture Template
A production-ready Clean Architecture template for ASP.NET Core Web API.
Features
- 🏗️ Clean Architecture - 4-layer architecture (Domain, Application, Infrastructure, API)
- 🔐 Authentication - JWT + Refresh Token with Google/Apple OAuth support
- 🗃️ Database - PostgreSQL with Entity Framework Core
- 📝 Logging - Serilog with Seq integration
- ❤️ Health Checks - Database and application health monitoring
- 🛡️ Rate Limiting - IP-based request throttling
- ✅ Validation - FluentValidation with MediatR pipeline
- 📚 API Documentation - Scalar (modern OpenAPI UI)
- 🐳 Docker - Full Docker and Docker Compose support
Installation
dotnet new install FG.CleanArchitecture.Template
Usage
Create a new project:
dotnet new fg-cleanarch -n MyProject
With options:
# Target different framework
dotnet new fg-cleanarch -n MyProject --Framework net9.0
# Without Docker files
dotnet new fg-cleanarch -n MyProject --IncludeDocker false
Quick Start
Create project:
dotnet new fg-cleanarch -n MyAwesomeApi cd MyAwesomeApiStart infrastructure:
docker-compose up -d postgres seqRun migrations:
dotnet ef database update --project Infrastructure --startup-project APIRun the API:
cd API dotnet runOpen in browser:
- API Docs: http://localhost:5000/scalar/v1
- Health Check: http://localhost:5000/health
- Seq Logs: http://localhost:5341
Project Structure
├── API/ # Presentation layer
│ ├── Controllers/ # API endpoints
│ ├── Middleware/ # Custom middleware
│ └── Filters/ # Action filters
├── Application/ # Business logic layer
│ ├── Features/ # CQRS Commands & Queries
│ ├── Interfaces/ # Abstractions
│ └── Common/ # Shared components
├── Domain/ # Core entities layer
│ ├── Entities/ # Domain entities
│ ├── Enums/ # Enumerations
│ └── Events/ # Domain events
├── Infrastructure/ # External concerns layer
│ ├── Identity/ # Authentication
│ ├── Persistence/ # Database context
│ └── Services/ # External services
└── docs/ # Documentation
Configuration
Update appsettings.json:
{
"ConnectionStrings": {
"DefaultConnection": "Host=localhost;Port=5432;Database=MyDb;Username=postgres;Password=postgres123"
},
"Jwt": {
"Secret": "YourSuperSecretKeyMustBeAtLeast32CharactersLong!",
"Issuer": "MyApp",
"Audience": "MyApp.Users",
"ExpiryMinutes": 60
},
"Authentication": {
"Google": {
"ClientId": "your-google-client-id",
"ClientSecret": "your-google-client-secret"
}
}
}
Uninstall
dotnet new uninstall FG.CleanArchitecture.Template
License
MIT License - feel free to use in your projects!
-
net8.0
- No dependencies.
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.
| Version | Downloads | Last Updated | |
|---|---|---|---|
| 1.0.0 | 670 | 1/21/2026 |