# imikerussell/mailchimp-power-tools architecture

> Architecture diagram of the GitHub repository imikerussell/mailchimp-power-tools, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2025-06-14). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/imikerussell/mailchimp-power-tools
- Repository: https://github.com/imikerussell/mailchimp-power-tools

## Overview

##### Project type and purpose
- This is a small PHP-based web application (“MailChimp Power Tools”) that sits on your web server, exposes simple endpoints, and provides a UI for generating embed codes for MailChimp lead-magnet automations and interest tracking.
- It is neither a monolithic CMS nor a heavy SPA—rather it’s a thin frontend (static HTML + PHP) that calls backend PHP scripts which in turn call the MailChimp API v3.0.

##### File structure
- Top-level:
- LICENSE, README.md, images/
- mc-end-point/ – PHP scripts that act as lightweight API endpoints (keyword.php, interest.php, lead-magnet.php, checkout-success.php).
- mc-power-tools/ – Frontend UI pages (index.html + PHP pages for generating code: mc-automation.php, mc-interest.php, mc-test.php).
- Config requirement: a config.php in mc-end-point/ to hold API key, list ID, URLs.
- No internal database; relies entirely on the external MailChimp API.
- Static assets (images) used in README and possibly in the UI.

##### README for additional insights
- Describes the problem (MailChimp’s 60-group limit), the solution (unlimited lead-magnet automations via API), and the installation steps.
- Lists the flow: user visits UI → picks an automation or interest → UI calls endpoint → endpoint calls MailChimp API → returns embed code.

- Clear labels: “Browser”, “UI Module (/mc-power-tools/)”, “API Endpoints (/mc-end-point/)”, “MailChimp API”, “Config (config.php)”
- Orange cloud for external MailChimp service
- Annotations: note HTTP methods (GET/POST), data formats (JSON, HTML snippets), and authentication via API key

## Diagram (Mermaid)

```mermaid
flowchart TD
    %% Client
    Browser["Client (Browser)"]:::external

    %% Presentation Layer
    subgraph "Presentation Layer"
        direction TB
        Index["index.html"]:::frontend
        Auto["mc-automation.php"]:::frontend
        InterestUI["mc-interest.php"]:::frontend
        TestUI["mc-test.php"]:::frontend
    end

    %% Asset Store
    Assets["images/"]:::asset

    %% API Layer
    subgraph "API Endpoint Module (/mc-end-point/)"
        direction TB
        Config(("config.php")):::config
        KeywordEP["keyword.php"]:::api
        InterestEP["interest.php"]:::api
        LeadMagnetEP["lead-magnet.php"]:::api
        SuccessEP["checkout-success.php"]:::api
    end

    %% External Service
    MailChimp(("MailChimp API v3.0")):::externalService

    %% Flows
    Browser-->Index
    Index-->KeywordEP
    Index-->InterestEP
    Index-->LeadMagnetEP
    Index-->SuccessEP
    Auto-->LeadMagnetEP
    InterestUI-->InterestEP
    TestUI-->KeywordEP

    KeywordEP-->MailChimp
    InterestEP-->MailChimp
    LeadMagnetEP-->MailChimp
    SuccessEP-->MailChimp

    MailChimp-->KeywordEP
    MailChimp-->InterestEP
    MailChimp-->LeadMagnetEP
    MailChimp-->SuccessEP

    KeywordEP-->Index
    InterestEP-->Index
    LeadMagnetEP-->Index
    SuccessEP-->Index
    Index-->Browser

    %% Click Events
    click Index "https://github.com/imikerussell/mailchimp-power-tools/blob/master/mc-power-tools/index.html"
    click Auto "https://github.com/imikerussell/mailchimp-power-tools/blob/master/mc-power-tools/mc-automation.php"
    click InterestUI "https://github.com/imikerussell/mailchimp-power-tools/blob/master/mc-power-tools/mc-interest.php"
    click TestUI "https://github.com/imikerussell/mailchimp-power-tools/blob/master/mc-power-tools/mc-test.php"
    click KeywordEP "https://github.com/imikerussell/mailchimp-power-tools/blob/master/mc-end-point/keyword.php"
    click InterestEP "https://github.com/imikerussell/mailchimp-power-tools/blob/master/mc-end-point/interest.php"
    click LeadMagnetEP "https://github.com/imikerussell/mailchimp-power-tools/blob/master/mc-end-point/lead-magnet.php"
    click SuccessEP "https://github.com/imikerussell/mailchimp-power-tools/blob/master/mc-end-point/checkout-success.php"
    click Config "https://github.com/imikerussell/mailchimp-power-tools/blob/master/mc-end-point/config.php"
    click Assets "https://github.com/imikerussell/mailchimp-power-tools/tree/master/images/"

    %% Styles
    classDef frontend fill:#E0F7FA,stroke:#00796B,color:#004D40;
    classDef api fill:#E3F2FD,stroke:#1976D2,color:#0D47A1;
    classDef config fill:#E8F5E9,stroke:#388E3C,color:#1B5E20;
    classDef asset fill:#FFF3E0,stroke:#FB8C00,color:#E65100;
    classDef externalService fill:#FFF8E1,stroke:#FFA000,color:#FF6F00;
    classDef external fill:#ECEFF1,stroke:#90A4AE,color:#37474F;
```
