Skip to content

afonsoft/EAF

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

497 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Enterprise Application Foundation (EAF)

GitHub GitHub version Commits History SonarCloud DeepWiki

English | Português

Line Coverage Branch Coverage Method Coverage Test Success Rate Total Tests Passing Tests Skipped Tests Build Warnings Angular Tests API Template Tests API Template Passing Worker Runtime Docker Compose

Table of Contents

About the Project

What is EAF?

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.

Key Benefits

  • 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

Use Cases

  • 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

What is ASP.NET Boilerplate?

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

EAF: Enhanced Open Source Implementation

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:

Modules and Improvements

Authentication and Authorization

  • 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

Auditing and Logging

  • 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

Real-time Communication

  • 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

Multi-Tenancy

  • Data Isolation: Complete data separation by tenant
  • Tenant Management: Tenant management
  • Tenant Resolution: Automatic tenant resolution
  • Feature Management: Enable/disable features by tenant

Cache and Performance

  • 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

Background Jobs

  • Hangfire Integration: Background task processing
  • Job Management: Job scheduling and monitoring
  • Recurring Jobs: Automated recurring tasks
  • Worker Services: Scalable background services

UI and Frontend

  • Angular Integration: Complete Angular template
  • UI Components: Reusable and styled components
  • Client-Side Validation: Automatic frontend validation
  • Internationalization: Support for multiple languages

Configuration and Settings

  • Setting Management: Configuration management
  • Feature Flags: Feature flags
  • Environment Configuration: Configuration by environment
  • Key Vault Integration: Secret security

Other Features

  • 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

Benefits of EAF over Pure ABP

  1. More User-Friendly Interface: Simplified and intuitive APIs
  2. Ready-to-Use Modules: Pre-configured components for immediate use
  3. Best Practices: Applied modern development patterns
  4. Optimized Performance: Integrated performance optimizations
  5. Portuguese Documentation: Native support for Portuguese language
  6. BDD Tests: Tests with Given/When/Then pattern
  7. Observability: OpenTelemetry for advanced monitoring
  8. Enhanced Security: Multiple authentication and authorization options

Technical Overview

Architecture

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

Supported Technologies

Technology Version Status
ASP.NET Core 10.0 Supported
Entity Framework Core 10.0 Supported
Angular 20 Supported
.NET 10.0 Supported

Main Components

Middleware Core

  • 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.

Authentication and Authorization

  • 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.

Cache and Persistence

  • 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.

Security

  • 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.

Observability

  • 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.

Processing

  • 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.

Tech Stack

Backend (.NET)

  • .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

Frontend (Template)

  • Angular 20: SPA framework
  • Node.js 20.20.2: JavaScript runtime
  • TypeScript 5.8.3: Main language
  • ngx-bootstrap 12.0.0 / Bootstrap 5: CSS framework
  • PrimeNG 17: UI components
  • Chart.js 4.4.7: Charts and visualizations
  • RxJS 7.8.0: Reactive programming

Infrastructure

  • SQLite: Local database
  • SQL Server: Main database
  • Redis: Distributed cache
  • Azure Key Vault: Secret management
  • OpenTelemetry: Observability
  • Serilog: Structured logging

Documentation

The detailed technical documentation of the EAF system, covering architecture, modules, development guides, and more, can be found in our documentation portal.

Access Complete Documentation | DeepWiki - AI-Powered Docs


Installation and Configuration

Prerequisites

Required:

  • .NET 10.0 SDK or higher
  • Node.js 20.20.2 (for frontend development)
  • Git

For Frontend Development:

npm install -g @angular/[email protected]

For Coverage Reports:

dotnet tool install -g dotnet-reportgenerator-globaltool

Platform Compatibility

Platform Status Notes
Windows Full Support Use PowerShell or Command Prompt
Linux Full Support Bash scripts provided
macOS Full Support Use Terminal with bash

Cloning the Repository

git clone https://github.com/afonsoft/EAF.git
cd EAF

Environment Setup

  1. Restore dependencies:
dotnet restore Eaf.sln
  1. Build the project:
dotnet build Eaf.sln

Running and Testing

Quick Start

Linux/macOS:

# Make the script executable
chmod +x build-and-test.sh

# Run build and tests with coverage
./build-and-test.sh

Windows (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"

Running Only Tests

Linux/macOS:

# Make the script executable
chmod +x run-tests-with-coverage.sh

# Run all tests with coverage
./run-tests-with-coverage.sh

Windows (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"

Manual Test Execution

# 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"

Running the Templates with Docker

Full stack (SQL Server + Migrator + API + Worker + Angular)

cd /path/to/EAF

# Copy and edit the environment file
cp .env.example .env

# Start everything
docker compose -f docker-compose.all.yml up --build -d

# Validate
curl http://localhost:5000/swagger/v1/swagger.json
curl http://localhost:4200/

Minimal stack (API + Angular only, external SQL Server)

Use this when the infrastructure (SQL Server, Redis, etc.) is managed outside Docker Compose.

cd /path/to/EAF

# Configure .env with your external connection string
cp .env.example .env

# Start API and Angular
docker compose -f docker-compose.yml up --build -d

# Or use an external SQL Server container in the same network
docker compose -f docker-compose.all.yml up -d eaf-sqlserver eaf-migrator
docker compose -f docker-compose.yml up --build -d

Validation script

# Full stack validation (default)
bash scripts/validate-docker-compose.sh

# Validate a specific compose file
COMPOSE_FILE=docker-compose.all.yml bash scripts/validate-docker-compose.sh

CI validation

Pull requests that change docker-compose*.yml, Dockerfile* or scripts/validate-docker-compose.sh trigger the .github/workflows/docker-compose-validation.yml workflow, which builds Eaf.sln and runs the full Docker Compose stack end-to-end.

Manual container examples

See Templates/Api/README.md and Templates/Angular/Eaf.ProjectName.UI/README.md for details.

Usage Example

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

Code Coverage

Latest Test Results (2026-07-16)

Metric Value
Line coverage 97.9%
Branch coverage 90.5%
Method coverage 99.8%
Total tests 4605
Passed 4604
Skipped 1
Failed 0
Build warnings 0
Template build warnings 0 (Api, Worker, Angular)

P66 update: Eaf.ApiWithSrc.sln starts and Swagger UI loads at http://localhost:5000/swagger; runtime config precedence fixed so environment variables override appsettings.json. P65 template build warnings remain suppressed and documented.

Coverage by Module

Module Tests Line Coverage Status
Eaf.Castle.Serilog 73 100% ✅ Excellent
Eaf.SqlServerCache 100 100% ✅ Excellent
Eaf.KeyVault.AspNetCore 10 100% ✅ Excellent
Eaf.Middleware.Application 1507 99.9% ✅ Excellent
Eaf.Middleware.Core 1266 99.9% ✅ Excellent
Eaf.Middleware.Web.Core 769 96.9% ✅ Excellent
Eaf.Middleware.Worker 191 100% ✅ Excellent
Eaf.SqliteCache 162 98% ✅ Excellent
Eaf.OpenTelemetry 67 100% ✅ Excellent
Eaf.KeyVault 243 100% ✅ Excellent
Eaf.Log4NetServiceBus 52 96.0% ✅ Good
Eaf.Middleware.AzureActiveDirectory 66 95.3% ✅ Excellent
Eaf.Middleware.Ldap 99 66.3% ⚠️ Needs improvement

NuGet Packages

Package NuGet Description
Eaf.Middleware.Application NuGet version Application layer
Eaf.Middleware.AzureActiveDirectory NuGet version Azure AD integration
Eaf.Middleware.Core NuGet version Core features
Eaf.Middleware.Ldap NuGet version LDAP authentication
Eaf.Middleware.Web.Core NuGet version Web components
Eaf.Castle.Serilog NuGet version Structured logging
Eaf.KeyVault NuGet version Secret management
Eaf.KeyVault.AspNetCore NuGet version ASP.NET Core integration
Eaf.OpenTelemetry NuGet version Telemetry and observability
Eaf.Log4NetServiceBus NuGet version Service bus logging
Eaf.SqlServerCache NuGet version SQL Server cache
Eaf.SqliteCache NuGet version SQLite cache
Eaf.Middleware.Worker NuGet version Background services

Contributing

How to Contribute

  1. Fork the repository
  2. Create a branch for your feature (git checkout -b feature/AmazingFeature)
  3. Commit your changes (git commit -m 'Add some AmazingFeature')
  4. Push to the branch (git push origin feature/AmazingFeature)
  5. Open a Pull Request

Development Standards

  • 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

Useful Links


Quality and Metrics

SonarCloud

Code Smell Bugs Tests Lang Quality
Code Smells Bugs AppVeyor tests GitHub top language Quality Gate Status

Statistics

Lines of Code Duplicated Lines Coverage Maintainability
Lines of Code Duplicated Lines (%) Coverage Maintainability Rating
Reliability Security Technical Debt Vulnerabilities
Reliability Rating Security Rating Technical Debt Vulnerabilities

Downloads

GitHub all releases

Issues

GitHub issues


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!


Star History

Star History Chart

StarMapper

StarMapper

StarMapper also requires a GitHub token to fetch star geolocation data. The live map image is not available until the repository is scanned.

About

No description, website, or topics provided.

Resources

License

Security policy

Stars

0 stars

Watchers

0 watching

Forks

Packages

 
 
 

Contributors