Nera.Lib.Web
1.0.3
dotnet add package Nera.Lib.Web --version 1.0.3
NuGet\Install-Package Nera.Lib.Web -Version 1.0.3
<PackageReference Include="Nera.Lib.Web" Version="1.0.3" />
<PackageVersion Include="Nera.Lib.Web" Version="1.0.3" />
<PackageReference Include="Nera.Lib.Web" />
paket add Nera.Lib.Web --version 1.0.3
#r "nuget: Nera.Lib.Web, 1.0.3"
#:package Nera.Lib.Web@1.0.3
#addin nuget:?package=Nera.Lib.Web&version=1.0.3
#tool nuget:?package=Nera.Lib.Web&version=1.0.3
Nera.Lib.Web
Nera.Lib.Web is a foundational library for building web applications in the Nera ecosystem. It provides web models, business rules, aggregates, value objects, and domain services, with a focus on clean architecture and DDD (Domain-Driven Design) principles.
Features
- Authorization & Authentication: Includes JWT support, custom claim types, and flexible permission/role-based authorization handlers.
- Cloud Integrations: Abstractions and implementations for cloud providers, messaging, and storage.
- Email & Communication: Integrates with Google APIs (Gmail, Drive), Azure Communication Services, SendGrid, MimeKit, and MailKit for robust email handling.
- API Versioning & Documentation: Built-in support for API versioning and Swagger/OpenAPI documentation using Swashbuckle.
- Validation & Middleware: FluentValidation integration and a suite of middleware for exception handling, logging, rate limiting, security headers, and more.
- Resilience: Polly integration for retry policies and circuit breaker patterns.
Getting Started
Prerequisites
- .NET 9.0 SDK or later
Installation
Add the NuGet package to your project:
# Using .NET CLI
dotnet add package Nera.Lib.Web --version 1.0.0
Or add the following to your .csproj
:
<PackageReference Include="Nera.Lib.Web" Version="1.0.0" />
Usage
Configure Services Register Nera.Lib.Web services in your
Startup.cs
or Program setup:services.AddNeraWeb(); // Example extension method
Use Middleware Add the provided middleware components to your pipeline as needed:
app.UseMiddleware<ExceptionHandlingMiddleware>(); app.UseMiddleware<RequestLoggingMiddleware>(); // ...other middleware
API Versioning & Swagger
services.AddApiVersioning(); services.AddSwaggerGen();
Authentication & Authorization
services.AddAuthentication(JwtBearerDefaults.AuthenticationScheme) .AddJwtBearer(options => { /* ... */ }); services.AddAuthorization(options => { /* ... */ });
Packages Used
- Microsoft.AspNetCore.Mvc.Versioning
- Microsoft.AspNetCore.Authentication.JwtBearer
- Swashbuckle.AspNetCore
- Newtonsoft.Json & System.Text.Json
- Google.Apis (Gmail, Drive, Auth)
- MimeKit, MailKit
- Azure.Communication.Email, Azure.Core
- SendGrid
- Polly
- FluentValidation.AspNetCore
Project Structure
Authorize/
– Authorization handlers, requirements, and attributesCloud/
– Cloud abstractions and implementationsCommon/
– Enums, exceptions, extensions, and utilitiesConfiguration/
– Configuration classes and optionsFactories/
– Factory patterns for providersMessaging/
– Messaging abstractions and implementationsModels/
– Domain and web modelsSecurity/
– JWT and security servicesServices/
– Base servicesWebBootstrap/
– Application bootstrap and Swagger configurationMiddleware/
– Custom middleware componentsFilters/
– API filtersExtensions/
– Service and middleware extension methods
Contributing
Contributions are welcome! Please open issues or submit pull requests on GitHub.
License
This project is licensed under the MIT License. See the LICENSE file for details.
Authors
Nextera Systems
For more information, visit Nextera Systems on GitHub.
Product | Versions Compatible and additional computed target framework versions. |
---|---|
.NET | net9.0 is compatible. net9.0-android was computed. net9.0-browser was computed. net9.0-ios was computed. net9.0-maccatalyst was computed. net9.0-macos was computed. net9.0-tvos was computed. net9.0-windows was computed. net10.0 was computed. net10.0-android was computed. net10.0-browser was computed. net10.0-ios was computed. net10.0-maccatalyst was computed. net10.0-macos was computed. net10.0-tvos was computed. net10.0-windows was computed. |
-
net9.0
- Azure.Communication.Email (>= 1.0.1)
- Azure.Core (>= 1.40.0)
- FluentValidation.AspNetCore (>= 11.3.0)
- Google.Apis.Auth (>= 1.68.0)
- Google.Apis.Drive.v3 (>= 1.68.0.3373)
- Google.Apis.Gmail.v1 (>= 1.68.0.3287)
- MailKit (>= 4.8.0)
- Microsoft.AspNetCore.Authentication.JwtBearer (>= 9.0.6)
- Microsoft.AspNetCore.Mvc.NewtonsoftJson (>= 9.0.6)
- Microsoft.AspNetCore.Mvc.Versioning (>= 5.1.0)
- Microsoft.AspNetCore.Mvc.Versioning.ApiExplorer (>= 5.1.0)
- MimeKit (>= 4.8.0)
- Nera.Lib.Core (>= 1.0.6)
- Nera.Lib.Domain (>= 1.0.5)
- Nera.Lib.Infrastructure (>= 1.0.2)
- Newtonsoft.Json (>= 13.0.3)
- Polly (>= 8.6.2)
- SendGrid (>= 9.29.2)
- Swashbuckle.AspNetCore (>= 9.0.1)
- Swashbuckle.AspNetCore.Filters (>= 8.0.1)
- System.IdentityModel.Tokens.Jwt (>= 8.3.0)
- System.Text.Json (>= 9.0.6)
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.