# drakonian/data-editor-for-bc architecture

> Architecture diagram of the GitHub repository drakonian/data-editor-for-bc, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2025-04-05). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/drakonian/data-editor-for-bc
- Repository: https://github.com/drakonian/data-editor-for-bc

## Overview

##### Project Type & Purpose
- This is an open-source Business Central extension focused on editing table data.
- The README highlights that it is a tool for manipulating data in Business Central tables, intended for both community collaboration and installation as a Per Tenant Extension (.app file).
- Given that it is built using AL language (specific to Business Central) and includes a myriad of AL objects (pages, codeunits, tables, enums, etc.), the project’s core is the Business Central extension itself.

##### Analyzing the File Structure
- Development Environment Configuration: The .AL-Go directory contains scripts (such as cloudDevEnv.ps1, localDevEnv.ps1) and configuration files (settings.json) to set up development environments tailored for Business Central.
- CI/CD & Automation: The .github directory, especially the workflows subfolder, holds numerous YAML files defining automated processes for build, deployment, testing, and versioning. This reflects that the project is set up with automated pipelines to handle Continuous Integration/Continuous Deployment (CI/CD) as well as environment management.
- Core Source Code: The Source directory is the heart of the Business Central extension. It is divided into subdirectories by AL object types:
- Codeunits, Pages, Tables, Enums, and Translations – which represent different layers of the Business Central application.
- Additional settings and metadata files like app.json that define the extension’s configuration and manifest.
- Testing: The Test folder contains test-specific AL files, test libraries, handlers, and configurations to automate and manage testing. This separation underscores the emphasis on quality assurance.
- Auxiliary Files: Files such as LICENSE, CODE_OF_CONDUCT, and al.code-workspace ensure coding standards, governance, and developer coordination.

a. Main Components to Represent:
- Developer Environment & Setup Tools: Represented by the .AL-Go scripts and environment configuration.
- CI/CD & Automation Pipeline: Represented by the GitHub workflows in .github (including build, test, deployment, and version increment processes).
- Core Extension and AL Source Code: Subdivide this into:
- Codeunits: Business logic.
- Pages: User interface components within Business Central.
- Tables: Data storage structures.
- Enums & Permissions: Define constants and security settings.
- Translations: Localization support.
- Testing Framework: Illustrate how test handlers, test libraries, and test scripts are organized to validate business logic and UI aspects.
- Deployment & Integration: Show how the release (.app file) is built from the source and then deployed into Business Central (as described in the installation guide provided in the README).

b. Relationships & Interactions:
- Source components (pages, codeunits, tables) to illustrate dependency relationships, such as pages interacting with codeunits, which in turn manage table data.
- External integration with Business Central: the extension (as an .app file) is deployed and interacts with the Business Central runtime.

c. Architectural Patterns & Design Principles:
- Separation of concerns: The clear division between source components, development environment setup, automation scripts, and tests.
- Automated CI/CD: Reflects modern DevOps practices ensuring continuous integration and deployment for Business Central extensions.
- Modular organization: The AL objects are organized in a way that supports reusability (for example, test libraries and handlers are kept separately).

d. Technologies, Frameworks, & Libraries:
- AL Language: The core technology for developing Business Central extensions.
- GitHub Actions: For defining and automating CI/CD workflows.
- PowerShell: Utilized in the .AL-Go scripts for setting up development environments.
- Business Central Services: Represented as the environment where the .app file is deployed and run.

##### Specific Elements
- Developer Setup (.AL-Go)
- CI/CD Pipeline (.github/workflows)
- Core AL Source (dividing into Codeunits, Pages, Tables, Enums, Permissions, Translations)
- Testing Components (Test folder with separate sections for test libraries, handlers, and test cases)
- Deployment Component (release .app file and the installation process on Business Central)
- Data flow: From source code changes triggering CI/CD, running tests, and ultimately building the .app file.
- Deployment flow: From the final build moving to the Business Central environment.
- One set for development resources (scripting, configuration, workflows).
- A set for business logic/extension components (AL objects).
- Another for testing layers.

##### Final Advice
- Be very detailed. Capture every essential element so that the chain—from development environment to automated testing and finally to the Business Central deployment—is transparent.

## Diagram (Mermaid)

```mermaid
graph TD
    subgraph "Developer Environment Setup"
        DEV("Developer Setup (.AL-Go)"):::developer
    end

    subgraph "CI/CD Pipeline"
        CICD("CI/CD Pipeline (.github/workflows)"):::cicd
    end

    subgraph "Core AL Source Code"
        CU("Codeunits (Business Logic)"):::core
        PG("Pages (User Interface)"):::core
        TB("Tables (Data Storage)"):::core
        EN("Enums (Constants)"):::core
        PER("Permissions (Security)"):::core
        TR("Translations (Localization)"):::core
        CONF("Configuration (app.json)"):::core
    end

    subgraph "Testing Framework"
        TEST("Testing Framework (Test folder)"):::testing
    end

    subgraph "Deployment"
        DEP("Deployment Artifact (.app file)"):::deployment
    end

    EXT("Business Central Environment"):::external

    DEV -->|"triggers"| CICD
    CICD -->|"builds"| CU
    CICD -->|"builds"| PG
    CICD -->|"builds"| TB
    CICD -->|"builds"| EN
    CICD -->|"builds"| PER
    CICD -->|"builds"| TR
    CICD -->|"builds"| CONF
    CICD -->|"runs"| TEST
    CICD -->|"builds"| DEP
    PG -->|"calls"| CU
    CU -->|"manages"| TB
    DEP -->|"deploys_to"| EXT

    classDef developer fill:#F9E79F,stroke:#B7950B,stroke-width:2px;
    classDef cicd fill:#AED6F1,stroke:#3498DB,stroke-width:2px;
    classDef core fill:#A9DFBF,stroke:#1E8449,stroke-width:2px;
    classDef testing fill:#F5B7B1,stroke:#E74C3C,stroke-width:2px;
    classDef deployment fill:#D7BDE2,stroke:#6C3483,stroke-width:2px;
    classDef external fill:#FAD7A0,stroke:#E67E22,stroke-width:2px;

    click DEV "https://github.com/drakonian/data-editor-for-bc/tree/master/.AL-Go/"
    click CICD "https://github.com/drakonian/data-editor-for-bc/tree/master/.github/workflows/"
    click CU "https://github.com/drakonian/data-editor-for-bc/tree/master/Source/Codeunits/"
    click PG "https://github.com/drakonian/data-editor-for-bc/tree/master/Source/Pages/"
    click TB "https://github.com/drakonian/data-editor-for-bc/tree/master/Source/Tables/"
    click EN "https://github.com/drakonian/data-editor-for-bc/tree/master/Source/Enums/"
    click PER "https://github.com/drakonian/data-editor-for-bc/tree/master/Source/Permissions/"
    click TR "https://github.com/drakonian/data-editor-for-bc/tree/master/Source/Translations/"
    click CONF "https://github.com/drakonian/data-editor-for-bc/blob/master/Source/app.json"
    click TEST "https://github.com/drakonian/data-editor-for-bc/tree/master/Test/"
    click DEP "https://github.com/drakonian/data-editor-for-bc/blob/master/Volodymyr Dvernytskyi_Data Editor Tool_Latest.app"
```
