# dromara/jpom architecture

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

- Interactive diagram: https://gitdiagram.com/dromara/jpom
- Repository: https://github.com/dromara/jpom

## Overview

##### Project Type and Purpose
- Jpom is an “ops” platform that helps teams deploy, build, monitor, and manage projects.
- The README emphasizes it is a low-invasive online construction, automatic deployment, and operational maintenance tool.
- The file tree shows multiple Maven modules (server, agent, common, sub-plugins, storage-modules) and a separate web‑vue frontend, indicating a full‑stack system with modular plugins and extensibility.

##### File Structure for Architectural Patterns
- Top-level directories include “modules” (with subfolders for agent, server, common, storage-module, sub-plugin) and “web‑vue” (the Vue.js frontend).
- The server and agent modules are clearly separated; the “server” hosts the management console while the “agent” runs on nodes and handles operations like builds, file transfers, SSH, etc.
- The “sub-plugin” directory indicates a plugin mechanism (with modules for docker-cli, email, encrypt, git-clone, etc.) that extend core functionality without being tightly coupled.
- The “storage-module” directories (with variants for H2, MariaDB, MySQL, PostgreSQL) suggest pluggable database/storage support.
- The existence of multiple Dockerfiles, docker-compose files, and scripts points to containerization and flexible deployment options.

##### Main Components and Their Interactions
- Frontend Component:
– Represented by the “web‑vue” module.
– It communicates with the back end (via REST API endpoints or web sockets) to display real‑time information, logs, and manage configurations.
- Server Module:
– Core back‑end service (modules/server) that provides the management console, performs centralized configuration, logging, and orchestration.
– It interacts with the underlying storage (through the storage‑module) and receives data from plugin extensions.
- Agent Module:
– (modules/agent) Installed on managed nodes.
– Provides functionalities such as build, deployment, file management, and remote command execution via SSH/FTP.
– Communicates with the server over HTTP and possibly WebSocket channels for real‑time logs and command triggers.
- Sub-plugins:
– Extend functionalities like Docker management, email notifications, encryption tasks, Git operations, etc.
– They should be depicted as optional, modular components that plug into either the server or the agent.
- Storage/Database:
– Abstract the persistent data layer through interchangeable storage modules (H2, MySQL, etc.).
– They serve as the repository for metadata, logs, and configuration settings.
- Infrastructure & Deployment:
– Include Docker containers (as indicated by multiple Dockerfiles and docker-compose files).
– Represent CI/CD elements (Maven build, npm for front end) and external integrations (SSH, file storage, etc.).

##### Relationships and Interactions
- Connectivity from the server to agent nodes (via REST/WebSocket), indicating control commands, log streaming, or file transfers.
- Storage layer as a database that the server reads from and writes to.
- Optionally, include external notification services (email, messaging platforms) that are triggered by the server to notify users of alerts or task statuses.

##### Architectural Patterns and Technologies
- Use a modular, layered architecture with clear separation of concerns:
– Presentation (Vue web‑UI)
– Business Logic (Server module, common utilities)
– Operational Agents (Agent module)
– Extension Points (Sub-plugin modules)
– Persistence (Storage modules)
– Java/Spring Boot for back-end; Maven as build tool
– Node, npm, Vue.js for the frontend
– Docker for containerization; Shell scripts and CI/CD pipelines
– WebSocket and HTTP for communication
- Low‑invasiveness design and the pluggable extension mechanism.

## Diagram (Mermaid)

```mermaid
flowchart TB
    BROWSER("Browser/Client"):::external
    VUE("Vue Web UI"):::frontend
    SERVER("Jpom Server"):::backend
    AGENT("Jpom Agent"):::backend
    STORAGE("Common Storage Module"):::storage
    H2("Storage: H2"):::storage
    MARIADB("Storage: MariaDB"):::storage
    MYSQL("Storage: MySQL"):::storage
    POSTGRES("Storage: PostgreSQL"):::storage

    subgraph "Sub-Plugins"
        DOCKER("Plugin: Docker CLI"):::plugin
        EMAIL("Plugin: Email"):::plugin
        ENCRYPT("Plugin: Encryption"):::plugin
        GIT("Plugin: Git Clone"):::plugin
        SSH("Plugin: SSH JSch"):::plugin
        SVN("Plugin: SVN Clone"):::plugin
        WEBHOOK("Plugin: Webhook"):::plugin
    end

    BROWSER -->|"access"| VUE
    VUE -->|"REST/WebSocket"| SERVER
    SERVER -->|"command"| AGENT
    AGENT -->|"log/status"| SERVER
    SERVER -->|"persist"| STORAGE
    STORAGE -->|"pluggable"| H2
    STORAGE -->|"pluggable"| MARIADB
    STORAGE -->|"pluggable"| MYSQL
    STORAGE -->|"pluggable"| POSTGRES
    SERVER -->|"plugins"| DOCKER
    SERVER -->|"plugins"| EMAIL
    SERVER -->|"plugins"| ENCRYPT
    SERVER -->|"plugins"| GIT
    SERVER -->|"plugins"| SSH
    SERVER -->|"plugins"| SVN
    SERVER -->|"plugins"| WEBHOOK

    click VUE "https://github.com/dromara/jpom/tree/master/web-vue/"
    click SERVER "https://github.com/dromara/jpom/tree/master/modules/server/"
    click AGENT "https://github.com/dromara/jpom/tree/master/modules/agent/"
    click DOCKER "https://github.com/dromara/jpom/tree/master/modules/sub-plugin/docker-cli/"
    click EMAIL "https://github.com/dromara/jpom/tree/master/modules/sub-plugin/email/"
    click ENCRYPT "https://github.com/dromara/jpom/tree/master/modules/sub-plugin/encrypt/"
    click GIT "https://github.com/dromara/jpom/tree/master/modules/sub-plugin/git-clone/"
    click SSH "https://github.com/dromara/jpom/tree/master/modules/sub-plugin/ssh-jsch/"
    click SVN "https://github.com/dromara/jpom/tree/master/modules/sub-plugin/svn-clone/"
    click WEBHOOK "https://github.com/dromara/jpom/tree/master/modules/sub-plugin/webhook/"
    click STORAGE "https://github.com/dromara/jpom/tree/master/modules/storage-module/storage-module-common/"
    click H2 "https://github.com/dromara/jpom/tree/master/modules/storage-module/storage-module-h2/"
    click MARIADB "https://github.com/dromara/jpom/tree/master/modules/storage-module/storage-module-mariadb/"
    click MYSQL "https://github.com/dromara/jpom/tree/master/modules/storage-module/storage-module-mysql/"
    click POSTGRES "https://github.com/dromara/jpom/tree/master/modules/storage-module/storage-module-postgresql/"

    classDef frontend fill:#AED6F1,stroke:#2471A3,stroke-width:2px;
    classDef backend fill:#A9DFBF,stroke:#1D8348,stroke-width:2px;
    classDef plugin fill:#F9E79F,stroke:#B7950B,stroke-width:2px;
    classDef storage fill:#F5CBA7,stroke:#D35400,stroke-width:2px;
    classDef external fill:#D2B4DE,stroke:#7D3C98,stroke-width:2px;
```
