# akii90/scripts architecture

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

- Interactive diagram: https://gitdiagram.com/akii90/scripts
- Repository: https://github.com/akii90/scripts

## Overview

##### Project type and purpose
- This is a small “utility script” repository: a collection of standalone shell scripts with a shared library of common functions.
- Each script automates a specific operational task (e.g., container lookup, setting a Postgres user to read-only, uploading to MinIO).

##### File structure
- Top level:
- README.md – describes the repo
- general_functions.sh – shared helper functions
- search-container-with-pid.sh – finds running Docker containers by PID
- set_pg_readonly_user.sh – toggles a Postgres user to read-only
- upload_file_to_muti_minio.sh – uploads a file to multiple MinIO buckets
- No deeper directories—each script lives side-by-side and sources general_functions.sh.

##### README for additional insights
- README is minimal: “Common shell scripts.”

##### Detail without over-splitting
- Script as a separate component.
- Exactly which external system it talks to.
- Shared library as the single code-reuse point.

## Diagram (Mermaid)

```mermaid
flowchart TB
    %% Code Components
    subgraph "Code Components"
        direction TB
        README["README.md"]:::doc
        GeneralFunctions["general_functions.sh"]:::code
        SearchScript["search-container-with-pid.sh"]:::code
        PgScript["set_pg_readonly_user.sh"]:::code
        MinioScript["upload_file_to_muti_minio.sh"]:::code
    end

    %% External Systems
    subgraph "External Systems"
        direction TB
        Docker["Docker Engine"]:::external
        Postgres[(PostgreSQL Database)]:::external
        MinIOCloud["MinIO Cluster"]:::external
    end

    %% Relationships
    SearchScript -->|"sources"| GeneralFunctions
    PgScript -->|"sources"| GeneralFunctions
    MinioScript -->|"sources"| GeneralFunctions

    SearchScript -->|"docker CLI"| Docker
    PgScript -->|"psql CLI"| Postgres
    MinioScript -->|"mc/REST API"| MinIOCloud

    README -->|documents| GeneralFunctions

    %% Click Events
    click README "https://github.com/akii90/scripts/blob/main/README.md"
    click GeneralFunctions "https://github.com/akii90/scripts/blob/main/general_functions.sh"
    click SearchScript "https://github.com/akii90/scripts/blob/main/search-container-with-pid.sh"
    click PgScript "https://github.com/akii90/scripts/blob/main/set_pg_readonly_user.sh"
    click MinioScript "https://github.com/akii90/scripts/blob/main/upload_file_to_muti_minio.sh"

    %% Styles
    classDef code fill:#D6EAF8,stroke:#1B4F72,stroke-width:1px
    classDef external fill:#FCF3CF,stroke:#B7950B,stroke-width:1px
    classDef doc fill:#F2F3F4,stroke:#566573,stroke-width:1px
```
