@startuml
title Overview of the Frinex build server when configured to deploy into a Docker Swarm.
left to right direction
package "DatabaseHost" {
  database "StagingPostgres" {
    card S_Postgres[
      S_ExperimentA_DB
      ----
      S_ExperimentB_DB
      ----
      S_ExperimentC_DB
    ]
  }
  database "ProductionPostgres" {
    card P_Postgres [
      P_ExperimentA_DB
      ----
      P_ExperimentB_DB
      ----
      P_ExperimentC_DB
    ]
  }
}

package "DockerSwarm" {

  package "SwarmManager1" {
    GIT -- [BuildProcess]
    [BuildProcess] -- BuildListing
    [BuildProcess] -> [DatabaseManager]
    [DatabaseManager] ==> DatabaseHost
    [Registry]
    card Staging1 [
      S_ExperimentA
      ----
      S_ExperimentB
      ----
      S_ExperimentC
    ]
    Staging1 --> S_Postgres
    card Production1 [
      P_ExperimentA
      ----
      P_ExperimentB
      ----
      P_ExperimentC
    ]
    Production1 --> P_Postgres
  }

  package "SwarmWorker2" {
    card Staging2 [
      S_ExperimentA
      ----
      S_ExperimentB
      ----
      S_ExperimentC
    ]
    Staging2 --> S_Postgres
    card Production2 [
      P_ExperimentA
      ----
      P_ExperimentB
      ----
      P_ExperimentC
    ]
    Production2 --> P_Postgres
  }

  package "SwarmWorker3" {
    card Staging3 [
      S_ExperimentA
      ----
      S_ExperimentB
      ----
      S_ExperimentC
    ]
    Staging3 --> S_Postgres
    card Production3 [
      P_ExperimentA
      ----
      P_ExperimentB
      ----
      P_ExperimentC
    ]
    Production3 --> P_Postgres
  }
}

XML --> GIT
JSON --> GIT

BuildProcess -ri-> ElectronApps
BuildProcess -ri-> MobileApps

BuildProcess --> Registry
@enduml