# redhat-performance/quads architecture

> Architecture diagram of the GitHub repository redhat-performance/quads, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2024-12-27). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/redhat-performance/quads
- Repository: https://github.com/redhat-performance/quads

## Overview

##### Main Components Architecture

- QUADS Server (Flask API)
- QUADS Web Interface
- PostgreSQL Database
- QUADS CLI Tool

- Foreman (Provisioning Backend)
- Juniper Switches (Network Management)
- JIRA Integration (Optional)
- Email/IRC Notification Systems
- Badfish (IPMI Management)

##### Data Flow Layers
Create distinct layers showing data flow:

a) User Interface Layer:
- Web UI (Flask-based)
- CLI Interface
- RESTful JSON API

b) Application Layer:
- Schedule Management
- Host Management
- Cloud Environment Management
- Validation Services
- Notification System

c) Infrastructure Layer:
- Network Configuration
- Bare Metal Provisioning
- Hardware Management

a) Control Flow:
- User requests → API/CLI → Database
- Scheduled Tasks → Provisioning Actions
- Validation Checks → Network/System Status

b) Data Flow:
- Configuration Management
- Host State Changes
- Schedule Updates
- Validation Results

##### Component Details

a) Database Schema (Show main entities):
- Clouds
- Hosts
- Schedules
- Assignments
- Interfaces
- Notifications

b) Service Modules (Group related components):
- CLI Tools
- Web Services
- External Tools Integration
- Validation Services

##### Operational Flows

a) Provisioning Workflow:
- Schedule Creation
- Host Assignment
- Network Configuration
- System Validation
- Notification Delivery

b) Management Workflow:
- Host Management
- Cloud Environment Management
- Schedule Management
- Interface Configuration

##### Scalability aspects

This system design should be created using a professional diagramming tool that supports:
- Clear hierarchical layouts
- Proper connector routing
- Consistent styling
- Export to high-resolution formats
- Easy updates and modifications

## Diagram (Mermaid)

```mermaid
graph TB
    subgraph "User Interface Layer"
        CLI["CLI Tool"]:::cli
        WebUI["Web Interface"]:::webui
        API["RESTful API"]:::api
    end

    subgraph "Application Layer"
        Server["QUADS Server"]:::server
        
        subgraph "Resource Management"
            Schedule["Schedule Management"]:::resource
            Host["Host Management"]:::resource
            Cloud["Cloud Management"]:::resource
            Interface["Interface Management"]:::resource
            VLAN["VLAN Management"]:::resource
        end
        
        subgraph "Data Access"
            BaseDAO["Base DAO"]:::dao
            CloudDAO["Cloud DAO"]:::dao
            HostDAO["Host DAO"]:::dao
            SchedDAO["Schedule DAO"]:::dao
        end
        
        subgraph "Notification System"
            Notif["Notification Service"]:::notification
            Templates["Notification Templates"]:::notification
        end
    end

    subgraph "Infrastructure Layer"
        DB[(PostgreSQL)]:::database
        
        subgraph "External Services"
            Foreman["Foreman"]:::external
            Juniper["Juniper Switches"]:::external
            JIRA["JIRA"]:::external
            Email["Email System"]:::external
            Badfish["Badfish IPMI"]:::external
        end
        
        subgraph "Configuration"
            MainConfig["Main Config"]:::config
            HostMeta["Host Metadata"]:::config
            VLANConfig["VLAN Config"]:::config
            IFConfig["Interface Config"]:::config
        end
    end

    %% Connections
    CLI --> Server
    WebUI --> Server
    API --> Server
    
    Server --> Schedule
    Server --> Host
    Server --> Cloud
    Server --> Interface
    Server --> VLAN
    
    Schedule --> BaseDAO
    Host --> BaseDAO
    Cloud --> CloudDAO
    Interface --> BaseDAO
    VLAN --> BaseDAO
    
    BaseDAO --> DB
    CloudDAO --> DB
    HostDAO --> DB
    SchedDAO --> DB
    
    Server --> Notif
    Notif --> Templates
    
    Server --> Foreman
    Server --> Juniper
    Server --> JIRA
    Notif --> Email
    Server --> Badfish

    %% Styles
    classDef cli fill:#f9f,stroke:#333
    classDef webui fill:#9ff,stroke:#333
    classDef api fill:#ff9,stroke:#333
    classDef server fill:#99f,stroke:#333
    classDef resource fill:#9f9,stroke:#333
    classDef dao fill:#f99,stroke:#333
    classDef notification fill:#ff9,stroke:#333
    classDef database fill:#999,stroke:#333
    classDef external fill:#f9f,stroke:#333
    classDef config fill:#9ff,stroke:#333

    %% Click Events
    click CLI "https://github.com/redhat-performance/quads/blob/latest/src/quads/cli/cli.py"
    click WebUI "https://github.com/redhat-performance/quads/blob/latest/src/quads/web/app.py"
    click Server "https://github.com/redhat-performance/quads/blob/latest/src/quads/server/app.py"
    click Schedule "https://github.com/redhat-performance/quads/blob/latest/src/quads/server/blueprints/schedules.py"
    click Host "https://github.com/redhat-performance/quads/blob/latest/src/quads/server/blueprints/hosts.py"
    click Cloud "https://github.com/redhat-performance/quads/blob/latest/src/quads/server/blueprints/clouds.py"
    click Interface "https://github.com/redhat-performance/quads/blob/latest/src/quads/server/blueprints/interfaces.py"
    click VLAN "https://github.com/redhat-performance/quads/blob/latest/src/quads/server/blueprints/vlans.py"
    click BaseDAO "https://github.com/redhat-performance/quads/blob/latest/src/quads/server/dao/baseDao.py"
    click CloudDAO "https://github.com/redhat-performance/quads/blob/latest/src/quads/server/dao/cloud.py"
    click HostDAO "https://github.com/redhat-performance/quads/blob/latest/src/quads/server/dao/host.py"
    click SchedDAO "https://github.com/redhat-performance/quads/blob/latest/src/quads/server/dao/schedule.py"
    click Notif "https://github.com/redhat-performance/quads/blob/latest/src/quads/server/blueprints/notifications.py"
    click Templates "https://github.com/redhat-performance/quads/tree/latest/src/quads/templates"
    click Foreman "https://github.com/redhat-performance/quads/blob/latest/src/quads/tools/external/foreman.py"
    click Juniper "https://github.com/redhat-performance/quads/blob/latest/src/quads/tools/external/juniper.py"
    click JIRA "https://github.com/redhat-performance/quads/blob/latest/src/quads/tools/external/jira.py"
    click Email "https://github.com/redhat-performance/quads/blob/latest/src/quads/tools/external/postman.py"
    click Badfish "https://github.com/redhat-performance/quads/blob/latest/src/quads/tools/external/badfish.py"
    click MainConfig "https://github.com/redhat-performance/quads/blob/latest/conf/quads.yml"
    click HostMeta "https://github.com/redhat-performance/quads/blob/latest/conf/hosts_metadata.yml"
    click VLANConfig "https://github.com/redhat-performance/quads/blob/latest/conf/vlans.yml"
    click IFConfig "https://github.com/redhat-performance/quads/blob/latest/conf/idrac_interfaces.yml"
```
