# choiwoojae1547/hospital architecture

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

- Interactive diagram: https://gitdiagram.com/choiwoojae1547/hospital
- Repository: https://github.com/choiwoojae1547/hospital

## Overview

##### Project type and purpose
- From the file tree and README, this is a containerized PHP web application (“hospital”) that connects to AWS. It uses Composer for dependency management (composer.json), has a single entry point (index.php), and is deployed to AWS using Kubernetes manifests and AWS CI/CD descriptors (buildspec.yaml, aws-auth.yaml).

##### File structure
- Top-level code artifacts:
- Dockerfile – builds a PHP container image
- composer.json – PHP dependencies
- index.php – application entrypoint
- AWS CI/CD and infra-as-code:
- buildspec.yaml – AWS CodeBuild instructions
- aws-auth.yaml – IAM permissions for EKS
- Kubernetes deployment:
- deployment.yaml – Deployment spec for EKS
- service.yaml – Service spec (ClusterIP or LoadBalancer)
- configmap.yaml – Application configuration
- There is no dedicated “frontend” folder, so this is a back-end/monolith service container.

##### README for additional insights
- README simply says “hospital – connection to AWS,” confirming that the main goal is to run the hospital application in AWS.

## Diagram (Mermaid)

```mermaid
graph TD
    %% Developer Workstation
    subgraph "Developer Workstation" 
        DevWork["Developer Workstation"]:::developer
    end

    %% Source Code Repository
    subgraph "Source Repository" 
        Repo["Git Repository"]:::repository
        ReadmeNode["README.md"]:::repository
        DockerfileNode["Dockerfile"]:::repository
        ComposerNode["composer.json"]:::repository
        IndexNode["index.php"]:::repository
    end

    %% CI/CD Pipeline
    subgraph "CI/CD Pipeline" 
        CodePipeline["AWS CodePipeline"]:::cicd
        CodeBuild["AWS CodeBuild"]:::cicd
        BuildspecNode["buildspec.yaml"]:::cicd
        AwsAuthNode["aws-auth.yaml"]:::cicd
    end

    %% Container Registry
    subgraph "Container Registry"
        ECR["Amazon ECR"]:::aws
    end

    %% Kubernetes Cluster
    subgraph "Amazon EKS Cluster"
        EKSControl["EKS Control Plane"]:::aws
        subgraph "Kubernetes Resources"
            DeploymentNode["Deployment<br/>(deployment.yaml)"]:::k8s
            ConfigMapNode["ConfigMap<br/>(configmap.yaml)"]:::k8s
            ServiceNode["Service<br/>(service.yaml)"]:::k8s
            PodNode["Pod: hospital-app"]:::k8s
        end
    end

    %% External Clients
    subgraph "External"
        Client["External Client"]:::external
    end

    %% Connections
    DevWork -->|push code| Repo
    Repo -->|triggers| CodePipeline
    CodePipeline -->|invokes| CodeBuild
    CodeBuild -->|reads| BuildspecNode
    CodeBuild -->|reads| AwsAuthNode
    CodeBuild -->|builds image| ECR
    CodeBuild -->|uses| DockerfileNode
    ECR -->|pull image| EKSControl
    EKSControl -->|applies| DeploymentNode
    EKSControl -->|applies| ConfigMapNode
    EKSControl -->|applies| ServiceNode
    DeploymentNode -->|manages| PodNode
    ConfigMapNode -->|mounted in| PodNode
    ServiceNode -->|routes to| PodNode
    Client -->|sends HTTP| ServiceNode

    %% Click Events
    click DockerfileNode "https://github.com/choiwoojae1547/hospital/tree/main/Dockerfile"
    click ComposerNode "https://github.com/choiwoojae1547/hospital/blob/main/composer.json"
    click IndexNode "https://github.com/choiwoojae1547/hospital/blob/main/index.php"
    click ReadmeNode "https://github.com/choiwoojae1547/hospital/blob/main/README.md"
    click BuildspecNode "https://github.com/choiwoojae1547/hospital/blob/main/buildspec.yaml"
    click AwsAuthNode "https://github.com/choiwoojae1547/hospital/blob/main/aws-auth.yaml"
    click DeploymentNode "https://github.com/choiwoojae1547/hospital/blob/main/deployment.yaml"
    click ServiceNode "https://github.com/choiwoojae1547/hospital/blob/main/service.yaml"
    click ConfigMapNode "https://github.com/choiwoojae1547/hospital/blob/main/configmap.yaml"

    %% Styles
    classDef developer fill:#f9f,stroke:#333,stroke-width:1px
    classDef repository fill:#ffeb99,stroke:#333,stroke-width:1px
    classDef cicd fill:#9fe6ff,stroke:#333,stroke-width:1px
    classDef aws fill:#ffd1dc,stroke:#333,stroke-width:1px
    classDef k8s fill:#d1ffd1,stroke:#333,stroke-width:1px
    classDef external fill:#ccccff,stroke:#333,stroke-width:1px
```
