# axelor/axelor-open-platform architecture

> Architecture diagram of the GitHub repository axelor/axelor-open-platform, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2024-12-28). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/axelor/axelor-open-platform
- Repository: https://github.com/axelor/axelor-open-platform

## Overview

##### Main Components

a. Core Components:
- axelor-core: The central module containing core functionality
- axelor-web: Web interface and REST services
- axelor-common: Common utilities and shared components
- axelor-test: Testing framework
- axelor-tools: Development and build tools

b. Infrastructure Components:
- Database Layer
- Authentication/Security Layer
- Web Services Layer
- Front-end Layer (axelor-front)

##### Key Architectural Elements

a. Data Layer:
- JPA/Hibernate Integration
- Model Management
- Repository Pattern Implementation
- Multi-tenancy Support

b. Business Layer:
- Action System
- Workflow Engine
- Security Framework
- Event System

c. Presentation Layer:
- REST API Services
- WebSocket Support
- View System
- Form Handlers

**[Client Layer]**
- Web Interface (React-based)
- API Consumers
- ↓
**[Web Layer]**
- REST Controllers
- WebSocket Endpoints
- Security Filters
- ↓
**[Service Layer]**
- Business Logic
- Action Handlers
- Event Processing
- ↓
**[Data Access Layer]**
- Repositories
- Entity Management
- Transaction Handling
- ↓
**[Infrastructure Layer]**
- Database
- File Storage
- Cache
- Search Engine

##### Key Integration Points to Highlight

- Authentication flow
- Data access patterns
- View rendering pipeline
- Action execution flow
- Event propagation
- Module extension points

##### Additional Elements

Annotations for:
- Security boundaries
- Scalability points
- Extension mechanisms
- Configuration options
- Cache layers
- Transaction boundaries

##### Specific Implementation Details

Relationship between:
- Form/Grid/Tree views
- Action system
- Data import/export
- Report generation
- File management
- Messaging system

- Modularity of the system
- Clear separation of concerns
- Extensibility points
- Security integration
- Transaction management
- Event-driven architecture

## Diagram (Mermaid)

```mermaid
graph TB
    %% Define styles
    classDef core fill:#3498db,stroke:#2980b9,color:white
    classDef web fill:#2ecc71,stroke:#27ae60,color:white
    classDef security fill:#e67e22,stroke:#d35400,color:white
    classDef data fill:#9b59b6,stroke:#8e44ad,color:white
    classDef infra fill:#95a5a6,stroke:#7f8c8d,color:white
    classDef frontend fill:#1abc9c,stroke:#16a085,color:white

    %% Client Layer
    subgraph ClientLayer
        WebUI["Web Interface (React)"]
        APIConsumers["API Consumers"]
    end

    %% Web Layer
    subgraph WebLayer
        RestAPI["REST Services"]:::web
        WebSocket["WebSocket Support"]:::web
        SecurityFilters["Security Filters"]:::security
    end

    %% Service Layer
    subgraph ServiceLayer
        ActionSystem["Action System"]:::core
        EventSystem["Event System"]:::core
        MetaServices["Meta Services"]:::core
        MailIntegration["Mail Integration"]:::core
        DMSSystem["DMS System"]:::core
    end

    %% Security Layer
    subgraph SecurityLayer
        Auth["Authentication"]:::security
        Permissions["Permission System"]:::security
        SecurityFramework["Security Framework"]:::security
    end

    %% Data Layer
    subgraph DataLayer
        JPAIntegration["JPA Integration"]:::data
        ModelManagement["Model Management"]:::data
        RepositorySystem["Repository System"]:::data
        QuerySystem["Query System"]:::data
    end

    %% Infrastructure Layer
    subgraph InfraLayer
        Database[(Database)]:::infra
        FileStorage[(File Storage)]:::infra
        Cache[(Cache)]:::infra
    end

    %% Connections
    WebUI --> RestAPI
    WebUI --> WebSocket
    APIConsumers --> RestAPI
    RestAPI --> SecurityFilters
    WebSocket --> SecurityFilters
    SecurityFilters --> SecurityLayer
    SecurityFilters --> ServiceLayer
    ActionSystem --> EventSystem
    EventSystem --> MetaServices
    MetaServices --> DataLayer
    MailIntegration --> DataLayer
    DMSSystem --> FileStorage
    JPAIntegration --> Database
    ModelManagement --> Database
    RepositorySystem --> Database
    QuerySystem --> Database

    %% Click events
    click RestAPI "https://github.com/axelor/axelor-open-platform/blob/master/axelor-web/src/main/java/com/axelor/web/service/RestService.java"
    click WebSocket "https://github.com/axelor/axelor-open-platform/tree/master/axelor-web/src/main/java/com/axelor/web/socket/"
    click ActionSystem "https://github.com/axelor/axelor-open-platform/tree/master/axelor-core/src/main/java/com/axelor/meta/schema/actions/"
    click EventSystem "https://github.com/axelor/axelor-open-platform/tree/master/axelor-core/src/main/java/com/axelor/event/"
    click MetaServices "https://github.com/axelor/axelor-open-platform/tree/master/axelor-core/src/main/java/com/axelor/meta/service/"
    click Auth "https://github.com/axelor/axelor-open-platform/tree/master/axelor-core/src/main/java/com/axelor/auth/"
    click SecurityFramework "https://github.com/axelor/axelor-open-platform/blob/master/axelor-core/src/main/java/com/axelor/auth/AuthSecurity.java"
    click Permissions "https://github.com/axelor/axelor-open-platform/blob/master/axelor-core/src/main/resources/domains/Permission.xml"
    click JPAIntegration "https://github.com/axelor/axelor-open-platform/tree/master/axelor-core/src/main/java/com/axelor/db/"
    click ModelManagement "https://github.com/axelor/axelor-open-platform/tree/master/axelor-core/src/main/java/com/axelor/db/mapper/"
    click RepositorySystem "https://github.com/axelor/axelor-open-platform/blob/master/axelor-core/src/main/java/com/axelor/db/Repository.java"
    click QuerySystem "https://github.com/axelor/axelor-open-platform/blob/master/axelor-core/src/main/java/com/axelor/db/Query.java"
    click MailIntegration "https://github.com/axelor/axelor-open-platform/tree/master/axelor-core/src/main/java/com/axelor/mail/"
    click DMSSystem "https://github.com/axelor/axelor-open-platform/tree/master/axelor-core/src/main/java/com/axelor/dms/"
    click WebUI "https://github.com/axelor/axelor-open-platform/tree/master/axelor-front/src/components/"

    %% Legend
    subgraph Legend
        CoreComponent["Core Component"]:::core
        WebComponent["Web Component"]:::web
        SecurityComponent["Security Component"]:::security
        DataComponent["Data Component"]:::data
        InfraComponent["Infrastructure Component"]:::infra
        FrontendComponent["Frontend Component"]:::frontend
    end
```
