# incomestreamsurfer/wordpress-docker-claude-code architecture

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

- Interactive diagram: https://gitdiagram.com/incomestreamsurfer/wordpress-docker-claude-code
- Repository: https://github.com/incomestreamsurfer/wordpress-docker-claude-code

## Overview

##### Project Type and Purpose
- This is a Docker-based full-stack development environment combining:
- VS Code Server (web IDE)
- Claude Code CLI (AI coding assistant)
- WordPress (PHP/Apache CMS)
- MySQL 8.0 (database)
- phpMyAdmin (DB GUI)
- Supports multi-instance isolation via port-offsets and provides remote access via browser.

##### Main Components
a. Docker Host & Orchestration
- Docker Engine runs on the developer’s machine
- docker-compose.yml defines service graph and shared network
b. Containers
1) devenv (Ubuntu 22.04 base)
- VS Code Server on port 8080 (+offset)
- Apache+PHP serving WordPress on port 8000 (+offset)
- Claude Code CLI calls out to Anthropic API
- Developer’s home directory volumes: /home/developer/wordpress → host wordpress/
2) db (MySQL 8.0)
- Exposed port 13306 (internal 3306)
- Config files mounted from config/mysql/my.cnf
3) phpmyadmin
- Web UI on port 8081 (+offset)
- Connects to db service via Docker network
c. Host File System Volumes
- wordpress/ directory mounted into devenv for immediate sync
- config/ directory for code-server, PHP, MySQL, and WP settings
- scripts/ for bootstrap (install-claude-code.sh, setup.sh)
d. External Services
- Anthropic API endpoint (https://api.anthropic.com) used by Claude CLI
- Browser client (Chrome/Firefox) on developer machine

##### Component Relationships & Data Flows
- Browser → devenv:
- HTTP 8080 → VS Code Server
- HTTP 8000 → Apache-PHP → WordPress
- Browser → phpMyAdmin: HTTP 8081 → phpMyAdmin UI
- devenv ↔ db: MySQL protocol (3306) over Docker network
- phpMyAdmin ↔ db: MySQL protocol (3306) over Docker network
- devenv → Anthropic API: HTTPS calls for Claude Code
- docker-compose manages ephemeral network connecting all containers

##### Architectural Patterns & Principles
- Containerization: one service per container, clear separation of concerns
- Volume mounting: code hot-reload and config injection
- Port-offset multi-instance: parameterized via setup.sh and instance ID
- Environment encapsulation: all dev tools (GitHub CLI, Docker CLI, Xdebug) co-located in devenv

## Diagram (Mermaid)

```mermaid
flowchart TB
    %% External entities
    Browser["Browser (Chrome/Firefox)"]:::external
    ExternalAPI["Anthropic API"]:::external

    %% Docker Host boundary
    subgraph "Docker Host & Orchestration" 
        direction TB
        DockerCompose["docker-compose.yml"]:::host
        DockerEngine["Docker Engine"]:::host

        %% Containers grouping
        subgraph "Containers"
            direction TB
            Devenv["devenv Container<br/>(VS Code Server on 8080, Apache+PHP on 8000)"]:::frontend
            DB["MySQL 8.0 Container<br/>(3306→13306)"]:::db
            PHPMYADMIN["phpMyAdmin Container<br/>(8081)"]:::admin
        end

        %% Volumes and config
        subgraph "Volumes & Configs"
            direction TB
            WPVol["wordpress/ Volume"]:::volume
            ScriptsVol["scripts/ Volume"]:::volume
            SetupScript["setup.sh"]:::host
            ClaudeScript["install-claude-code.sh"]:::host
            CodeServerCfg["code-server-config.yaml"]:::config
            PHPcfg["php.ini"]:::config
            MyCnf["mysql/my.cnf"]:::config
            WPcfg["wp-config.php"]:::config
            MCPcfg["mcp-config.json"]:::config
        end
    end

    %% Connections - Browser to containers
    Browser -->|"HTTP 8080"| Devenv
    Browser -->|"HTTP 8000"| Devenv
    Browser -->|"HTTP 8081"| PHPMYADMIN

    %% Container to DB
    Devenv -->|"MySQL 3306"| DB
    PHPMYADMIN -->|"MySQL 3306"| DB

    %% Devenv to External API
    Devenv -->|"HTTPS"| ExternalAPI

    %% Orchestration arrows
    DockerCompose --> DockerEngine
    DockerEngine --> Devenv
    DockerEngine --> DB
    DockerEngine --> PHPMYADMIN

    %% Volume mounts into Devenv and DB
    WPVol --> Devenv
    ScriptsVol --> Devenv
    CodeServerCfg --> Devenv
    PHPcfg --> Devenv
    MyCnf --> DB
    WPcfg --> Devenv
    MCPcfg --> PHPMYADMIN
    SetupScript --> DockerCompose
    ClaudeScript --> Devenv

    %% Click events
    click DockerCompose "https://github.com/incomestreamsurfer/wordpress-docker-claude-code/blob/master/docker-compose.yml"
    click Devenv "https://github.com/incomestreamsurfer/wordpress-docker-claude-code/tree/master/Dockerfile"
    click SetupScript "https://github.com/incomestreamsurfer/wordpress-docker-claude-code/blob/master/setup.sh"
    click ClaudeScript "https://github.com/incomestreamsurfer/wordpress-docker-claude-code/blob/master/scripts/install-claude-code.sh"
    click CodeServerCfg "https://github.com/incomestreamsurfer/wordpress-docker-claude-code/blob/master/config/code-server-config.yaml"
    click PHPcfg "https://github.com/incomestreamsurfer/wordpress-docker-claude-code/blob/master/config/php.ini"
    click MyCnf "https://github.com/incomestreamsurfer/wordpress-docker-claude-code/blob/master/config/mysql/my.cnf"
    click WPcfg "https://github.com/incomestreamsurfer/wordpress-docker-claude-code/blob/master/config/wp-config.php"
    click MCPcfg "https://github.com/incomestreamsurfer/wordpress-docker-claude-code/blob/master/config/mcp-config.json"
    click WPVol "https://github.com/incomestreamsurfer/wordpress-docker-claude-code/tree/master/wordpress/"
    click ScriptsVol "https://github.com/incomestreamsurfer/wordpress-docker-claude-code/tree/master/scripts/"

    %% Styles
    classDef external fill:#bbdefb,stroke:#0d47a1,color:#0d47a1;
    classDef host fill:#eceff1,stroke:#78909c,color:#37474f;
    classDef frontend fill:#c8e6c9,stroke:#2e7d32,color:#2e7d32;
    classDef db fill:#ffe0b2,stroke:#ef6c00,color:#e65100;
    classDef admin fill:#fff9c4,stroke:#f9a825,color:#f57f17;
    classDef volume fill:#e0f7fa,stroke:#006064,color:#006064;
    classDef config fill:#f3e5f5,stroke:#6a1b9a,color:#4a148c;
```
