# zebrunner/community-edition architecture

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

- Interactive diagram: https://gitdiagram.com/zebrunner/community-edition
- Repository: https://github.com/zebrunner/community-edition

## Overview

##### Project Type and Purpose
- This is a full-stack, containerized test automation management platform. It orchestrates continuous testing and deployment by integrating multiple tools like Zebrunner Reporting, Jenkins, SonarQube, Selenium Hub, and MCloud (for mobile testing).
- The README emphasizes that it leverages Infrastructure as Code principles and is deployed using Docker (with a docker-compose.yml) alongside an NGINX reverse proxy.

##### File Structure
- Key top-level directories and files include:
- Docker configuration files (docker-compose.yml, .env.original)
- NGINX configuration and SSL resources in the “nginx” directory (including custom configurations for mcloud, sonarqube, etc.)
- Components related to individual services like “jenkins”, “selenoid”, “mcloud”, and “sonarqube”
- “patch” directory with SQL and shell scripts likely used for database migration or service updates, indicating versioned update procedures.
- “docs” directory that includes guides for installation, configuration, integration, and usage.
- The presence of subdirectories for each component (Kubernetes-style grouping by service) suggests a microservices-like approach, with the services interacting through well-defined network boundaries.

##### Insights from the README
- The README clearly lists deployed components with their respective URLs:
- Zebrunner Reporting (main dashboard)
- Jenkins (CI tool)
- SonarQube (static code analysis)
- Web Selenium Hub (for web tests)
- Mobile Selenium Hub (MCloud)
- Mobile SmartTest Farm (STF)
- The documentation references integration with Carina-Core, Docker, and a PostgreSQL database backend. Also, it emphasizes that all components are deployed under an NGINX web server for secure routing.

a. Main Components:
- NGINX Web Server: Acts as the reverse proxy managing external requests.
- Docker Ecosystem: Container orchestration is key (indicated by docker-compose.yml), grouping each component as a container.
- Zebrunner Reporting: The central dashboard/UI module.
- CI Server: Jenkins for Continuous Integration.
- Quality Gate: SonarQube for static code analysis.
- Testing Hubs:
- Web Selenium Hub (possibly using Selenoid, as seen in the file tree)
- Mobile Selenium Hub (represented by the “mcloud” directory)
- Mobile SmartTest Farm (STF) – as mentioned in the README.
- Database: PostgreSQL (implicitly part of the stack, though not explicitly named in the file tree, it’s required as per documentation).
- Additional components like patch scripts indicate management and database migration steps.

b. Relationships and Interactions:
- All incoming/external traffic first hits the NGINX server, which then routes requests to the appropriate container/service:
- Requests on the root hostname likely serve Zebrunner Reporting.
- Requests to /jenkins, /sonarqube, /selenoid/wd/hub, and /mcloud/wd/hub are forwarded to Jenkins, SonarQube, Selenium Hub, and Mobile Testing respectively.
- Jenkins triggers test automation and communicates with other services (e.g., reporting, Selenium hubs).
- SonarQube analyzes code quality, while patch scripts manage database/schema migrations.
- Docker composes all these containers together so that inter-service communication happens over internal networks.

c. Architectural Patterns and Key Technologies:
- Microservices / containerization pattern: Each service is encapsulated as its own container (managed via Docker Compose).
- Reverse proxy pattern: NGINX handles routing and possibly SSL termination.
- Infrastructure as Code: Evident from the use of configuration files and docker-compose, ensuring consistency in deployment.
- Integration with other CI/CD tools (Jenkins) and testing frameworks (Carina-Core and Selenium-based hubs).

d. Relevant Technologies/Frameworks/Libraries:
- Docker and Docker Compose for container orchestration.
- NGINX for reverse proxying and securing the services.
- Jenkins, SonarQube, Selenium (Selenoid), and MCloud for specialized functionality.
- PostgreSQL (for database needs) and possibly custom scripts in the “patch” directory for database migrations.

## Diagram (Mermaid)

```mermaid
flowchart TD
    A["NGINX Reverse Proxy"]:::proxy
    B["Docker Ecosystem"]:::docker
    A --> B

    subgraph "Containerized Services"
        C["Zebrunner Reporting UI"]:::frontend
        D["Jenkins CI Server"]:::ci
        E["SonarQube Server"]:::analysis
        F["Web Selenium Hub"]:::testing
        G["Mobile Selenium Hub (MCloud)"]:::testing
        H["Mobile SmartTest Farm (STF)"]:::testing
        I["Patch Management/Migrations"]:::ops
    end

    B --> C
    B --> D
    B --> E
    B --> F
    B --> G
    B --> H
    B --> I

    D -->|"triggers"| C
    D -->|"triggers"| F
    D -->|"triggers"| G
    D -->|"triggers"| H

    B --> J["PostgreSQL DB"]:::database
    I -->|"migrates"| J

    %% Click Events
    click A "https://github.com/zebrunner/community-edition/tree/master/nginx"
    click B "https://github.com/zebrunner/community-edition/blob/master/docker-compose.yml"
    click C "https://github.com/zebrunner/community-edition/tree/master/reporting"
    click D "https://github.com/zebrunner/community-edition/tree/master/jenkins"
    click E "https://github.com/zebrunner/community-edition/tree/master/sonarqube"
    click F "https://github.com/zebrunner/community-edition/tree/master/selenoid"
    click G "https://github.com/zebrunner/community-edition/tree/master/mcloud"
    click I "https://github.com/zebrunner/community-edition/tree/master/patch"

    %% Styles
    classDef proxy fill:#f9c74f,stroke:#000,stroke-width:2px;
    classDef docker fill:#90be6d,stroke:#000,stroke-width:2px;
    classDef frontend fill:#f9844a,stroke:#000,stroke-width:1px;
    classDef ci fill:#f94144,stroke:#000,stroke-width:1px;
    classDef analysis fill:#277da1,stroke:#000,stroke-width:1px;
    classDef testing fill:#577590,stroke:#000,stroke-width:1px;
    classDef ops fill:#9b5de5,stroke:#000,stroke-width:1px;
    classDef database fill:#43aa8b,stroke:#000,stroke-width:2px;
```
