# onnus/web-eng-2022a architecture

> Architecture diagram of the GitHub repository onnus/web-eng-2022a, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2025-03-29). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/onnus/web-eng-2022a
- Repository: https://github.com/onnus/web-eng-2022a

## Overview

##### Project Overview
- This project is a full-stack web development environment designed to streamline local and cloud-based web development. It integrates Visual Studio Code (with Codespaces support), Docker containers, and a custom web engine (OWE) that supports modular, plugin-driven web applications.
- The README highlights two main parts: the WDE, which provides the development environment, and the OWE, which is the core engine for building sites and web applications.

##### Main Components
a. Dev Environment & Orchestration:
- .devcontainer: Contains configuration (e.g., devcontainer.json and README) used to set up VS Code/Codespaces environments.
- .docker: Contains Dockerfiles, docker-compose files (with separate configurations for debug and default modes on both Linux and Windows) that standardize the environment.
- .script: Houses various shell and batch scripts to build, start, stop, reset, and manage Docker containers as well as linter integrations. This is key for orchestrating the environment.
- .github: Holds CI/CD workflows and deployment scripts (e.g., deploy-to-aws-s3.yml, deploy-to-azure.yml) which show the integration with cloud environments and how the project is maintained/released.

b. Core Engine – ONNUS WEB Engine (OWE):
- onn-web-eng: This is the source for the web engine. It includes configuration files (.htaccess, index.php, index.json) as well as an ONNUS workspace file that configures the IDE.
- Inside “onn-web-eng/onnus”, you have distinct folders for:
- __applications__: Contains various modules (e.g., onnus-app-debug, onnus-cms, onnus-crm, onnus-exchange, onnus-ide, onnus-lms, onnus-messenger, onnus-pms) where each module has subdirectories for its class definitions and module data file (module.json). These indicate a modular and possibly plugin-influenced architecture.
- __plugins__: Contains additional extensions like “onnus-plugin-debug”, with their module metadata indicating plug-and-play capabilities.
- __resources__: Offers shared assets (CSS, JavaScript, PHP API definitions) that support functionality across applications.
- content/_data_ and content/pages: These directories suggest dynamic content management (pages and user/account data), further emphasizing a separation of concerns.
- “framework” directory inside “onn-web-eng/onnus” which is broken out into versioned subdirectories (2206c, 2207c, and 2208c). Each of these contains:
- __applications__/onnus-browser: Likely serving as the primary web interface with a layered API (accounts, browser operations, components, dashboards, and systems).
- __plugins__: Additional functional extensions that support interface enhancements (like onnus-interface, onnus-user, onnus-menu).
- __resources__: Static and dynamic assets (CSS, JS, PHP scripts) used widely across the engine.
- This modular structure suggests that the OWE is built on a plugin-based pattern where core functionality is split into loosely coupled modules.

##### Relationships and Interactions
- The Dev Environment (using Docker, Codespaces, and VS Code) is responsible for providing a consistent and replicable platform. It connects directly to the OWE by running the engine inside Docker containers.
- The orchestration scripts (.script) manage container lifecycle events (build, start, stop) and integrate with GitHub Actions for CI/CD.
- The Docker configuration components (.docker) and the container orchestration flows are what bind the development environment to the web engine.
- In the OWE itself, the relationships are modular:
- The __applications__ modules form the core features of the engine.
- The __plugins__ extend core functionality, interacting with the API endpoints provided by the framework.
- The __resources__ folder provides shared assets and utility functions that are used by both applications and plugins.
- The “framework” subdirectories (versioned) indicate that there is a versioned evolution or an experimental approach for the web engine with consistent API endpoints for modules, plugins, and resources.

##### Architectural Patterns and Design Principles
- Modular/Plugin Architecture: Components (both applications and plugins) are organized as self-contained modules with their own data (module.json) and class files.
- Separation of Concerns: There is a clear divide between the development environment configuration and the production runtime (OWE), as well as within the engine itself between different functional areas.
- Containerization: Docker is used to ensure uniform development and production environments.
- DevOps Integration: GitHub Actions and scripts support CI/CD and deployment across different cloud providers (AWS, Azure, GCP).

## Diagram (Mermaid)

```mermaid
flowchart TD
    %% Development Environment
    subgraph "Development Environment"
        DevConfig["Dev Environment Configuration (.devcontainer)"]:::env
        DockerConfig["Docker & Container Orchestration (.docker)"]:::env
        Orchestration["Orchestration Scripts (.script)"]:::env
    end

    %% CI/CD & Deployment
    subgraph "CI/CD & Deployment"
        CIDeploy["CI/CD Pipelines (.github)"]:::cicd
    end

    %% ONNUS WEB Engine (OWE)
    subgraph "ONNUS WEB Engine (OWE)"
        OWE["OWE Main Source (onn-web-eng)"]:::engine
        CoreApps["Core Applications Modules (__applications__)"]:::engine
        Plugins["Plugins & Extensions (__plugins__)"]:::engine
        Resources["Shared Resources (__resources__)"]:::engine
        DynamicContent["Dynamic Content Management (_data_ & pages)"]:::engine
        Framework["Framework Versions (onn-web-eng/onnus/framework)"]:::framework

        subgraph "Framework Versions"
            Ver2206["Version 2206c"]:::framework
            Ver2207["Version 2207c"]:::framework
            Ver2208["Version 2208c"]:::framework
        end
    end

    %% Relationships
    DevConfig -->|"configure"| DockerConfig
    Orchestration -->|"trigger lifecycle"| DockerConfig
    DockerConfig -->|"run engine"| OWE
    CIDeploy -->|"deploy/build"| Orchestration

    OWE -->|"loads"| CoreApps
    OWE -->|"loads"| Plugins
    OWE -->|"loads"| Resources
    OWE -->|"loads"| DynamicContent
    OWE -->|"versioning"| Framework

    CoreApps -->|"uses"| Resources
    Plugins -->|"extends"| CoreApps

    %% Click Events
    click DevConfig "https://github.com/onnus/web-eng-2022a/blob/alpha/.devcontainer/devcontainer.json"
    click DockerConfig "https://github.com/onnus/web-eng-2022a/tree/alpha/.docker/debug/"
    click Orchestration "https://github.com/onnus/web-eng-2022a/tree/alpha/.script/docker/"
    click CIDeploy "https://github.com/onnus/web-eng-2022a/blob/alpha/.github/deploy-to-aws-s3.yml"
    click OWE "https://github.com/onnus/web-eng-2022a/blob/alpha/onn-web-eng/index.php"
    click CoreApps "https://github.com/onnus/web-eng-2022a/tree/alpha/onn-web-eng/onnus/content/__applications__"
    click Plugins "https://github.com/onnus/web-eng-2022a/tree/alpha/onn-web-eng/onnus/content/__plugins__"
    click Resources "https://github.com/onnus/web-eng-2022a/tree/alpha/onn-web-eng/onnus/content/__resources__"
    click DynamicContent "https://github.com/onnus/web-eng-2022a/tree/alpha/onn-web-eng/onnus/content/_data_"
    click Framework "https://github.com/onnus/web-eng-2022a/tree/alpha/onn-web-eng/onnus/framework"
    click Ver2206 "https://github.com/onnus/web-eng-2022a/tree/alpha/onn-web-eng/onnus/framework/2206c"
    click Ver2207 "https://github.com/onnus/web-eng-2022a/tree/alpha/onn-web-eng/onnus/framework/2207c"
    click Ver2208 "https://github.com/onnus/web-eng-2022a/tree/alpha/onn-web-eng/onnus/framework/2208c"

    %% Styles
    classDef env fill:#AEDFF7,stroke:#000,stroke-width:1px;
    classDef cicd fill:#C8E6C9,stroke:#000,stroke-width:1px;
    classDef engine fill:#FFF59D,stroke:#000,stroke-width:1px;
    classDef framework fill:#F48FB1,stroke:#000,stroke-width:1px;
```
