English | Português
- About the Project
- ASP.NET Boilerplate
- Technical Overview
- Installation and Configuration
- Running and Testing
- Code Coverage
- NuGet Packages
- Contributing
The EAF (Enterprise Application Foundation) is an open-source middleware platform that provides a solid foundation for developing modern applications. Based on ASP.NET Boilerplate (ABP), EAF has been optimized to work with the latest versions of ASP.NET Core and Entity Framework Core.
- Integrated Security: Authentication and authorization with support for Azure Active Directory and LDAP
- Complete Auditing: Automatic tracking of all system operations
- Multi-tenancy: Native support for multi-tenant applications
- Observability: Integration with OpenTelemetry for monitoring and telemetry
- Distributed Cache: Support for Redis, SQL Server, and SQLite
- Secret Management: Integration with Azure Key Vault and Oracle Cloud Infrastructure
- Advanced Logging: Replacement of log4net with Serilog for better performance
- Web Applications: Management systems, CRMs, ERPs, and other applications
- RESTful APIs: Development of scalable APIs
- Microservices: Foundation for microservice architectures
- Multi-tenant Applications: SaaS and shared applications
ASP.NET Boilerplate (ABP) is an open-source web application framework that provides a robust infrastructure for developing modern applications. Complete documentation available at: https://aspnetboilerplate.com/Pages/Documents
The EAF (Enterprise Application Foundation) is an open-source implementation based on ASP.NET Boilerplate, designed to offer a more user-friendly interface for API and UI development. EAF complements the base framework with various improvements and additional modules:
- External Login: Support for social login (Google, Facebook, Twitter, Microsoft)
- Azure Active Directory: Complete integration
- LDAP/Active Directory: Authentication via directories
- Two-Factor Authentication: Two-factor authentication
- Permission Management: Granular permission and role system
- Automatic Auditing: Tracking of all CRUD operations
- Structured Logging: Integration with Serilog for detailed logs
- Entity Change Tracking: Monitoring of entity changes
- Error Logging: Capture and analysis of exceptions
- Chat System: Chat system between users
- SignalR Integration: WebSockets for bidirectional communication
- Push Notifications: Real-time notification system
- Tenant-to-Host Chat: Chat between tenants and host
- Group Chat: Group chat for collaboration
- Data Isolation: Complete data separation by tenant
- Tenant Management: Tenant management
- Tenant Resolution: Automatic tenant resolution
- Feature Management: Enable/disable features by tenant
- Distributed Cache: Support for Redis, SQL Server, SQLite
- Cache Abstraction: Unified interface for different backends
- Cache Manager: Intelligent cache management
- Performance Optimization: Integrated performance optimizations
- Hangfire Integration: Background task processing
- Job Management: Job scheduling and monitoring
- Recurring Jobs: Automated recurring tasks
- Worker Services: Scalable background services
- Angular Integration: Complete Angular template
- UI Components: Reusable and styled components
- Client-Side Validation: Automatic frontend validation
- Internationalization: Support for multiple languages
- Setting Management: Configuration management
- Feature Flags: Feature flags
- Environment Configuration: Configuration by environment
- Key Vault Integration: Secret security
- Event Bus: Domain event system
- Data Filters: Automatic data filters (SoftDelete, TenantId)
- Repository Pattern: Data access abstraction
- Unit of Work: Transaction management
- Dependency Injection: Configured dependency injection
- Object Mapping: Integrated AutoMapper
- API Documentation: Automatic Swagger/OpenAPI
- More User-Friendly Interface: Simplified and intuitive APIs
- Ready-to-Use Modules: Pre-configured components for immediate use
- Best Practices: Applied modern development patterns
- Optimized Performance: Integrated performance optimizations
- Portuguese Documentation: Native support for Portuguese language
- BDD Tests: Tests with Given/When/Then pattern
- Observability: OpenTelemetry for advanced monitoring
- Enhanced Security: Multiple authentication and authorization options
EAF follows Domain-Driven Design (DDD) principles and implements patterns such as:
- Repository Pattern: Data layer abstraction
- Unit of Work: Transaction management
- Dependency Injection: Inversion of control
- CQRS: Separation of commands and queries
- Event Sourcing: Domain event tracking
| Technology | Version | Status |
|---|---|---|
| ASP.NET Core | 10.0 | Supported |
| Entity Framework Core | 10.0 | Supported |
| Angular | 18 | Supported |
| .NET | 10.0 | Supported |
- Eaf.Middleware.Core: Central domain layer with entities, services, configurations, authorization, auditing, and base framework features.
- Eaf.Middleware.Application: Application layer with DTOs, application services, validations, and intermediate business logic.
- Eaf.Middleware.Web.Core: Web components for ASP.NET Core including startup configuration, middleware, filters, and HTTP integration.
- Eaf.Middleware.AzureActiveDirectory: Complete integration with Azure Active Directory for external authentication and user synchronization.
- Eaf.Middleware.Ldap: LDAP/Active Directory authentication for integration with existing directories.
- Eaf.SqlServerCache: Distributed cache implementation using SQL Server as backend for high availability scenarios.
- Eaf.SqliteCache: Local cache implementation using SQLite for development and low-scale scenarios.
- Eaf.KeyVault: Secret management supporting Azure Key Vault and Oracle Cloud Infrastructure (OCI) for secure credential storage.
- Eaf.KeyVault.AspNetCore: ASP.NET Core integration for automatic loading of configurations and secrets from Key Vault.
- Eaf.OpenTelemetry: Complete OpenTelemetry implementation for distributed telemetry, tracing, and metrics with support for multiple exporters.
- Eaf.Castle.Serilog: Logging adapter integrating Castle Windsor with Serilog for structured and configurable logging.
- Eaf.Middleware.Worker: Background services (Worker Services) for asynchronous processing, scheduled jobs, and long-running tasks.
- Eaf.Log4NetServiceBus: Integration with Azure Service Bus using log4net for message logging and messaging events.
- .NET 10.0: Main framework
- ASP.NET Core 10.0: Web API and MVC
- Entity Framework Core 10.0: ORM for data access
- AutoMapper: Object mapping
- Castle Windsor: Dependency injection
- Hangfire: Background task processing
- SignalR: Real-time communication
- Swagger/OpenAPI: API documentation
- xUnit: Testing framework
- Shouldly: Fluent assertions
- NSubstitute: Mocking framework
- Angular 18: SPA framework
- Node.js 20.20.0: JavaScript runtime
- TypeScript 5.2: Main language
- Bootstrap 5: CSS framework
- PrimeNG 17: UI components
- Chart.js: Charts and visualizations
- RxJS 7: Reactive programming
- SQLite: Local database
- SQL Server: Main database
- Redis: Distributed cache
- Azure Key Vault: Secret management
- OpenTelemetry: Observability
- Serilog: Structured logging
The detailed technical documentation of the EAF system, covering architecture, modules, development guides, and more, can be found in our documentation portal.
Required:
- .NET 10.0 SDK or higher
- Node.js 20.20.0 (for frontend development)
- Git
For Frontend Development:
npm install -g @angular/cli@19For Coverage Reports:
dotnet tool install -g dotnet-reportgenerator-globaltool| Platform | Status | Notes |
|---|---|---|
| Windows | Full Support | Use PowerShell or Command Prompt |
| Linux | Full Support | Bash scripts provided |
| macOS | Full Support | Use Terminal with bash |
git clone https://github.com/afonsoft/EAF.git
cd EAF- Restore dependencies:
dotnet restore Eaf.sln- Build the project:
dotnet build Eaf.slnLinux/macOS:
# Make the script executable
chmod +x build-and-test.sh
# Run build and tests with coverage
./build-and-test.shWindows (PowerShell):
# Run build and tests
dotnet build Eaf.sln
dotnet test Eaf.sln --collect:"XPlat Code Coverage" --settings coverlet.runsettings
# Generate coverage report (if reportgenerator is installed)
reportgenerator -reports:"TestResults/*/coverage.cobertura.xml" -targetdir:"TestResults/CoverageReport" -reporttypes:"Html;TextSummary"Linux/macOS:
# Make the script executable
chmod +x run-tests-with-coverage.sh
# Run all tests with coverage
./run-tests-with-coverage.shWindows (PowerShell):
# Run all tests with coverage
dotnet test Eaf.sln --collect:"XPlat Code Coverage" --settings coverlet.runsettings
# Generate coverage report
reportgenerator -reports:"TestResults/*/coverage.cobertura.xml" -targetdir:"TestResults/CoverageReport" -reporttypes:"Html;TextSummary"# Run a specific test project with coverage
dotnet test test/Eaf.KeyVault.Tests/Eaf.KeyVault.Tests.csproj --collect:"XPlat Code Coverage" --settings coverlet.runsettings
# Run all tests in the solution
dotnet test Eaf.sln --collect:"XPlat Code Coverage" --settings coverlet.runsettings
# Generate coverage report
reportgenerator -reports:"TestResults/*/coverage.cobertura.xml" -targetdir:"TestResults/CoverageReport" -reporttypes:"Html;Badges;TextSummary"Let's examine a simple class to see the benefits of EAF:
public class TaskAppService : ApplicationService, ITaskAppService
{
private readonly IRepository<Task> _taskRepository;
public TaskAppService(IRepository<Task> taskRepository)
{
_taskRepository = taskRepository;
}
[AbpAuthorize(MyPermissions.UpdateTasks)]
public async Task UpdateTask(UpdateTaskInput input)
{
Logger.Info("Updating a task for input: " + input);
var task = await _taskRepository.FirstOrDefaultAsync(input.TaskId);
if (task == null)
{
throw new UserFriendlyException(L("CouldNotFindTheTaskMessage"));
}
ObjectMapper.MapTo(input, task);
}
}This example demonstrates several EAF features:
- Dependency Injection: EAF uses and provides a conventional DI infrastructure
- Repository: EAF can create a default repository for each entity
- Authorization: EAF can check permissions declaratively
- Validation: EAF automatically checks if input is null
- Audit Logging: Information is automatically saved for each request
- Unit of Work: Each application service method is a unit of work by default
| Module | Line Coverage | Branch Coverage | New Tests | Status |
|---|---|---|---|---|
| Eaf.SqlServerCache | 86.6% | 81.8% | +2 | Good coverage |
| Eaf.SqliteCache | 75.5% | 34.9% | +4 | Good coverage |
| Eaf.OpenTelemetry | 70.1% | 75.0% | +2 | Good coverage |
| Eaf.Middleware.Worker | 24.6% | N/A | +4 | Needs +65.4% |
| Eaf.Middleware.Ldap | 5.1% | N/A | +4 | Needs +84.9% |
| Eaf.Middleware.AzureActiveDirectory | N/A | N/A | +4 | Tests added |
| Eaf.Middleware.Web.Core | 0.63% | 0.16% | +10 | Needs +89.4% |
| Eaf.Middleware.Core | 15.31% | 5.59% | +7 | Needs +74.7% |
| Eaf.Middleware.Application | 4.45% | 1.35% | +15 | Needs +85.6% |
| Eaf.KeyVault | 66.0% | 51.6% | +3 | Tests added |
| TOTAL | 28.4% | 21.3% | +47 | In progress |
- Target: 90% code coverage
- Current: 24.1% line, 15.5% branch, 54.5% method
- Test Status (May 2026): 1492 total, 1491 passing, 1 ignored, 0 failures (100% success)
- Next steps: Implement tests for modules with low coverage
- KeyVault: 206+ BDD tests implemented (99.5% success, 66% coverage)
- XML Documentation: Portuguese summaries added
- BDD Pattern: Given/When/Then implemented
- Castle.Serilog: 44 BDD tests implemented (100% success, 90% coverage)
- OpenTelemetry: 45/45 tests passing (100% success)
- SqlServerCache: 38/38 tests passing (100% success)
- Worker: 63/63 tests passing (100% success)
- Test Expansion (April 2026): +65 new test files implemented
- Eaf.Middleware.Web.Core: +10 tests (Swagger filters, TokenAuth, Impersonation models)
- Eaf.MiddlewareCore: +30 tests (Entities, DTOs, Extensions, Cache items)
- Eaf.Middleware.Application: +9 tests (constants, helpers, authorization)
- Eaf.Middleware.Ldap: +4 tests (configuration, authentication)
- Eaf.Middleware.AzureActiveDirectory: +4 tests (configuration, authentication)
- Eaf.Middleware.Worker: +4 tests (folders, emailing, base classes)
- Eaf.KeyVault: +3 tests (managers, interfaces)
- Eaf.Castle.Serilog: +4 tests (module, factory, logger)
- Eaf.KeyVault.AspNetCore: +1 test (extensions)
- Eaf.Log4NetServiceBus: +3 tests (logging components)
- Eaf.OpenTelemetry: +2 tests (module, extensions)
- Eaf.SqlServerCache: +2 tests (helpers, extensions)
- Eaf.SqliteCache: +4 tests (pool, commands, options)
- Problem: IndexOutOfRangeException during DbCommandPool initialization
- Cause: Incorrect order of static property initialization
- Solution: Moved
CountbeforeCommandsto ensure correct initialization - Result: +21 tests passing (from 53 to 74), 39% improvement
- Problem: Conflicts between Castle.Core.Logging.ILogger and Serilog.ILogger
- Solution: Alias
SerilogILoggerto resolve namespace ambiguity - Problematic Mocks: Replaced with actual Serilog instances
- Invalid Tests: Removed tests that depended on unsupported runtime configuration
- Result: 44/44 tests passing with BDD pattern in Portuguese
- Documented Files: 6/507 (1.2%)
- Main Documented Classes:
- SerilogLoggerFactory - Serilog logger factory
- SerilogLogger - Logger implementation
- EafSqliteCache - SQLite-based cache
- MiddlewareAppServiceBase - Base class for services
- AzureActiveDirectoryAuthenticationSource - Azure AD authentication
- Next Modules: Entity Framework, Web API, Authorization
| Assembly | Line Coverage | Branch Coverage | Method Coverage |
|---|---|---|---|
| Eaf.KeyVault | 66.0% (200/303) | 51.6% (33/64) | 70.2% (40/57) |
| Eaf.SqlServerCache | 78.3% (123/157) | 81.8% (18/22) | 71.4% (15/21) |
| Eaf.OpenTelemetry | 68.9% (164/238) | 75.0% (60/80) | 95.2% (20/21) |
| Eaf.Log4NetServiceBus | 85.0% (97/114) | 62.5% (10/16) | 87.1% (27/31) |
| Eaf.SqliteCache | 45.0% (175/389) | 34.9% (30/86) | 58.5% (24/41) |
| Eaf.Castle.Serilog | 10.0% (29/289) | 3.6% (3/84) | 16.9% (10/59) |
| Eaf.KeyVault.AspNetCore | 85.7% (18/21) | 100.0% (4/4) | 50.0% (1/2) |
| Eaf.Middleware.Web.Core | 0.63% (1/159) | 0.16% (1/625) | 1.35% (1/74) |
| Eaf.Middleware.Core | 15.31% (24/157) | 5.59% (5/90) | 16.9% (10/59) |
| Eaf.Middleware.Application | 4.45% (7/157) | 1.35% (1/74) | 5.59% (5/90) |
| Project | Status | Tests | Line Coverage | Notes |
|---|---|---|---|---|
| Eaf.KeyVault.Tests | Passing | 210 | 67.9% | Excellent coverage |
| Eaf.SqlServerCache.Tests | Passing | 57 | 86.6% | Excellent coverage |
| Eaf.OpenTelemetry.Tests | Passing | 10 | 68.9% | Good coverage |
| Eaf.KeyVault.AspNetCore.Tests | Passing | 8 | 85.7% | Excellent coverage |
| Eaf.Log4NetServiceBus.Tests | Passing | 12 | 85.0% | Good coverage |
| Eaf.SqliteCache.Tests | Passing | 94 | 75.6% | Good coverage |
| Eaf.Castle.Serilog.Tests | Passing | 44 | 10.0% | Resolved with BDD in Portuguese |
| Eaf.Middleware.Web.Core.Tests | Passing | 78 | 0.63% | EXPANDED: +35 tests (Swagger, TokenAuth, Impersonation) |
| Eaf.Middleware.Application.Tests | Passing | 58 | 4.45% | Basic coverage |
| Eaf.Middleware.Worker.Tests | Passing | 70 | 25.97% | Moderate coverage |
| Eaf.MiddlewareCore.Tests | Passing | 632 | 15.31% | EXPANDED: +30 tests (Entities, DTOs, Extensions) |
Legend:
- Passing: All tests pass successfully
- Problems: Tests run but have failures or warnings
- Build Errors: Project fails to compile
Tests follow the BDD (Behavior-Driven Development) pattern in Portuguese:
[Fact]
public void Dado_ParametroValido_Quando_ChamarMetodo_Entao_DeveRetornarSucesso()
{
// Dado (Given)
var parametro = "valor_valido";
// Quando (When)
var resultado = _service.ProcessarParametro(parametro);
// Então (Then)
resultado.ShouldNotBeNull();
resultado.Sucesso.ShouldBeTrue();
}| Package | NuGet | Description |
|---|---|---|
| Eaf.Middleware.Application | Application layer | |
| Eaf.Middleware.AzureActiveDirectory | Azure AD integration | |
| Eaf.Middleware.Core | Core features | |
| Eaf.Middleware.Ldap | LDAP authentication | |
| Eaf.Middleware.Web.Core | Web components | |
| Eaf.Castle.Serilog | Structured logging | |
| Eaf.KeyVault | Secret management | |
| Eaf.KeyVault.AspNetCore | ASP.NET Core integration | |
| Eaf.OpenTelemetry | Telemetry and observability | |
| Eaf.Log4NetServiceBus | Service bus logging | |
| Eaf.SqlServerCache | SQL Server cache | |
| Eaf.SqliteCache | SQLite cache | |
| Eaf.Middleware.Worker | Background services |
- Fork the repository
- Create a branch for your feature (
git checkout -b feature/AmazingFeature) - Commit your changes (
git commit -m 'Add some AmazingFeature') - Push to the branch (
git push origin feature/AmazingFeature) - Open a Pull Request
- Tests: All new features must have unit tests
- Coverage: Maintain minimum 90% coverage
- Documentation: Add XML documentation to public methods
- BDD: Follow Given/When/Then pattern in Portuguese
| Code Smell | Bugs | Tests | Lang | Quality |
|---|---|---|---|---|
| Lines of Code | Duplicated Lines | Coverage | Maintainability |
|---|---|---|---|
| Reliability | Security | Technical Debt | Vulnerabilities |
|---|---|---|---|
Developed with ❤️ by the opensource community
Beyond this simple example, EAF provides a robust infrastructure and development model for modularity, multi-tenancy, cache, background jobs, data filters, setting management, domain events, unit and integration tests, and much more! You focus on your business code and don't repeat yourself!