# bahmni/standard-config architecture

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

- Interactive diagram: https://gitdiagram.com/bahmni/standard-config
- Repository: https://github.com/bahmni/standard-config

## Overview

##### Project type and purpose
- This repository is a “configuration-only” project for Bahmni Standard. It provides master data (CIEL metadata), OpenMRS modules, OpenELIS modules, and packaging artifacts (Docker, Helm) used to assemble and deploy a Bahmni stack.

##### File structure
- Top-level directories:
- masterdata/configuration – CSV, XML, JSON files to bootstrap database metadata via Liquibase
- openmrs – JSON, Groovy, SQL, Beanshell, i18n, and migration scripts that make up the OpenMRS application layer
- openelis – Liquibase migration config for the OpenELIS laboratory system
- package/docker – Dockerfile and start script to bake a “bahmni/standard-config” image
- package/helm – Helm chart templates for deploying ConfigMaps, ServiceAccount, RBAC, and mounting volumes with this repo’s content
- .github/workflows – CI jobs that build and publish Docker image and handle translations

##### README for additional insights
- The README confirms that this is a default-config repository, describes how to build the Docker image locally, and how to reuse GitHub Actions and Dockerfile in your own config repo.

## Diagram (Mermaid)

```mermaid
flowchart TB
    %% Config Repo
    subgraph "Config Repository" 
        direction TB
        MD["Master Data Configuration"]:::config
        OMApps["OpenMRS Apps Definitions"]:::config
        OMMods["OpenMRS Database Migrations"]:::config
        OMIntl["OpenMRS i18n Bundles"]:::config
        OMBeans["OpenMRS Beanshell Extensions"]:::config
        OMGroovy1["OpenMRS Groovy: elisFeedInterceptor"]:::config
        OMGroovy2["OpenMRS Groovy: encounterModifier"]:::config
        OLMig["OpenELIS Migrations"]:::config
        OLImg["OpenELIS Images"]:::config
        DockerFiles["Docker Build Files"]:::code
        HelmCharts["Helm Chart Templates"]:::code
        CI1["GitHub Actions: build_upload"]:::pipeline
        CI2["GitHub Actions: pull_translations"]:::pipeline
        TX["Translation Config (Transifex)"]:::config
        Scripts["Packaging Helper Scripts"]:::code
    end

    %% CI/CD Pipeline
    subgraph "CI/CD Pipeline" 
        direction TB
        GH["GitHub Actions"]:::pipeline
    end

    %% Docker Build
    DockerFiles -->|"build image"| Image["bahmni/standard-config Image"]:::container

    %% Helm Deployment
    HelmCharts -->|"defines deployment"| K8s["Kubernetes Cluster"]:::runtime

    %% CI/CD triggers
    GH -->|"on push"| DockerFiles
    GH -->|"on push"| HelmCharts

    %% Kubernetes Components
    subgraph "Kubernetes Cluster" 
        direction TB
        ConfigMaps["ConfigMaps"]:::runtime
        OMSpod["OpenMRS Pod"]:::container
        OELISpod["OpenELIS Pod"]:::container
        DB["Database (MySQL/PostgreSQL)"]:::db
    end

    %% Mounting Config
    ConfigMaps -->|"mount"| OMSpod
    ConfigMaps -->|"mount"| OELISpod

    %% Pod Startup and Migration
    OMSpod -->|"Liquibase startup"| DB
    OELISpod -->|"Liquibase startup"| DB

    %% User Interaction
    Clinicians["Clinicians"]:::external -->|"use UI"| OMSpod
    LabStaff["Lab Staff"]:::external -->|"use UI"| OELISpod

    %% Click Events
    click MD "https://github.com/bahmni/standard-config/tree/master/masterdata/configuration"
    click OMApps "https://github.com/bahmni/standard-config/tree/master/openmrs/apps"
    click OMMods "https://github.com/bahmni/standard-config/tree/master/openmrs/migrations"
    click OMIntl "https://github.com/bahmni/standard-config/tree/master/openmrs/i18n"
    click OMBeans "https://github.com/bahmni/standard-config/tree/master/openmrs/beanshell"
    click OMGroovy1 "https://github.com/bahmni/standard-config/tree/master/openmrs/elisFeedInterceptor"
    click OMGroovy2 "https://github.com/bahmni/standard-config/tree/master/openmrs/encounterModifier"
    click OLMig "https://github.com/bahmni/standard-config/blob/master/openelis/migrations/liquibase.xml"
    click OLImg "https://github.com/bahmni/standard-config/tree/master/openelis/images"
    click DockerFiles "https://github.com/bahmni/standard-config/tree/master/package/docker/Dockerfile"
    click DockerFiles "https://github.com/bahmni/standard-config/blob/master/package/docker/start.sh"
    click HelmCharts "https://github.com/bahmni/standard-config/tree/master/package/helm"
    click CI1 "https://github.com/bahmni/standard-config/blob/master/.github/workflows/build_upload.yml"
    click CI2 "https://github.com/bahmni/standard-config/blob/master/.github/workflows/pull_translations.yml"
    click TX "https://github.com/bahmni/standard-config/tree/master/.tx/config"
    click Scripts "https://github.com/bahmni/standard-config/blob/master/scripts/package.sh"

    %% Styles
    classDef config fill:#E3F2FD,stroke:#42A5F5,color:#0D47A1
    classDef code fill:#FFF3E0,stroke:#FB8C00,color:#E65100
    classDef pipeline fill:#FFFDE7,stroke:#FDD835,color:#F57F17
    classDef container fill:#E8F5E9,stroke:#66BB6A,color:#1B5E20
    classDef runtime fill:#ECEFF1,stroke:#90A4AE,color:#263238
    classDef db fill:#FFE0B2,stroke:#FFB74D,color:#E65100
    classDef external fill:#F3E5F5,stroke:#BA68C8,color:#4A148C
```
