# ipol-journal/ipoldevel architecture

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

- Interactive diagram: https://gitdiagram.com/ipol-journal/ipoldevel
- Repository: https://github.com/ipol-journal/ipoldevel

## Overview

##### Main Components
- Control Panel (cp2): This folder contains a Django-like structure (manage.py, models, views, templates, static files, etc.) and appears to be the administration/front-end piece for the demo system.
- Demo Client (ipol_demo): This directory holds the client-side application including its own clientApp (HTML, CSS, and JavaScript) along with its supporting libraries (under lib) and various modules.
- Modules (inside ipol_demo/modules): These contain sub-components for core functionalities such as:
- Core functionalities (core, conversion, dispatcher, demoinfo, blobs)
- Auxiliary tools like the demorunner (and its Docker variant)
- Configuration and environment setups (config_common)
- CI and Testing: The “ci_tests” folder includes automated tests, scripts, and sample resource files that can be shown as a part of the continuous integration pipeline.
- Deployment / Infrastructure:
- Docker folder: Contains Dockerfiles and scripts for containerizing and deploying the application.
- sysadmin: Contains scripts, systemd configurations, and nginx configurations to provision and manage the environment.
- Tools and Helpers: These directories include migration scripts and various command-line utilities to help with tasks like demo copying, migration, and terminal management.

##### Relationships and Interactions
- The Web Control Panel (cp2) likely functions as a management interface – communicating with the backend services.
- The ipol_demo component has multiple layers:
- Its clientApp is the front-facing web interface (HTML/JS/CSS) for running and interacting with demos.
- Under ipol_demo/modules are business logic components that manage tasks such as image conversion, blob management, and dispatcher coordination to run demos.
- Communication between the clientApp and the modules (typically via API calls or internal function calls) should be highlighted.
- CI/CD and Deployment: Indicate how GitHub Actions (referenced in the README and .github/workflows) trigger tests and code checks, which are essential for ensuring quality. Also, mention Docker and sysadmin components that support different environments (local, integration, prod).
- External Integrations: Although not explicitly described in the README, the existence of reverse proxy configs (nginx snippets) and systemd services suggests integration with web servers and operating-system-level services.

##### Architectural Patterns and Design Principles
- Layered Architecture: Separate front-end, business logic, and infrastructure layers.
- Separation of Concerns: Dividing responsibilities among cp2 (control/admin panel), ipol_demo’s client-side interface, and the modular backend logic.
- Modular/Plug-in Structure: The ipol_demo/modules folder clearly separates different domains (blobs, conversion, dispatcher, etc.), which enables independent testing and deployment.
- CI/CD Pipeline Integration: The workflow file and testing directories emphasize continuous integration standards.

##### Key Technologies and Frameworks
- Python 3.9 as the primary language.
- Django (or a similar Python web framework) – evident from cp2’s structure with manage.py, models, views, etc.
- JavaScript, HTML, and CSS for the clientApp components in ipol_demo.
- Docker and systemd for deployment and orchestration.
- Various testing and formatting tools such as ruff, black, and isort, as specified in the README.

## Diagram (Mermaid)

```mermaid
flowchart TD
    %% Presentation Layer
    subgraph "Presentation Layer"
        CP["Control Panel (cp2/Django)"]:::presentation
        Client["Client Application (ipol_demo/clientApp)"]:::presentation
    end

    %% Application Layer
    subgraph "Application Layer"
        CoreModules["Core Modules: Core, Conversion, Dispatcher, Demoinfo, Blobs"]:::application
        Demorunner["Demorunner"]:::application
        DemorunnerDocker["Demorunner (Docker)"]:::application
    end

    %% Infrastructure Layer
    subgraph "Infrastructure Layer"
        CICD["CI/CD & Testing"]:::infrastructure
        Docs["Documentation"]:::infrastructure
        Deploy["Deployment/Infrastructure"]:::infrastructure
        Tools["Tools and Helpers"]:::infrastructure
    end

    %% Connections between layers
    Client -->|"API_Calls"| CoreModules
    CP -->|"Admin_Controls"| CoreModules
    CoreModules -->|"Triggers"| Demorunner
    CoreModules -->|"Triggers"| DemorunnerDocker

    CICD -->|"Deploys"| Deploy
    CICD -->|"Validates"| CoreModules
    Tools -->|"Assists"| Deploy
    Docs ---|"References"| CP
    Docs ---|"References"| CoreModules
    Client ---|"User_Interacts"| CP
    Deploy ---|"Monitored_by"| CICD

    %% Click Events
    click CP "https://github.com/ipol-journal/ipoldevel/tree/devel/cp2/ControlPanel"
    click Client "https://github.com/ipol-journal/ipoldevel/tree/devel/ipol_demo/clientApp"
    click CoreModules "https://github.com/ipol-journal/ipoldevel/tree/devel/ipol_demo/modules/core"
    click Demorunner "https://github.com/ipol-journal/ipoldevel/tree/devel/ipol_demo/modules/demorunner"
    click DemorunnerDocker "https://github.com/ipol-journal/ipoldevel/tree/devel/ipol_demo/modules/demorunner-docker"
    click CICD "https://github.com/ipol-journal/ipoldevel/tree/devel/ci_tests"
    click CICD "https://github.com/ipol-journal/ipoldevel/tree/devel/.github/workflows"
    click Docs "https://github.com/ipol-journal/ipoldevel/tree/devel/doc"
    click Deploy "https://github.com/ipol-journal/ipoldevel/tree/devel/docker"
    click Deploy "https://github.com/ipol-journal/ipoldevel/tree/devel/sysadmin"
    click Tools "https://github.com/ipol-journal/ipoldevel/tree/devel/tools"
    click Tools "https://github.com/ipol-journal/ipoldevel/tree/devel/helpers"

    %% Styles
    classDef presentation fill:#BBDEFB,stroke:#1E88E5,stroke-width:2px;
    classDef application fill:#C8E6C9,stroke:#43A047,stroke-width:2px;
    classDef infrastructure fill:#FFCC80,stroke:#FB8C00,stroke-width:2px;
```
