# easypropertylistings/easy-property-listings architecture

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

- Interactive diagram: https://gitdiagram.com/easypropertylistings/easy-property-listings
- Repository: https://github.com/easypropertylistings/easy-property-listings

## Overview

##### Project type and purpose
- This is a monolithic WordPress plugin (“Easy Property Listings”) written in PHP, with supporting JS/CSS assets, language translations, templates, and auto-generated API docs via ApiGen.

##### File structure
- Top-level:
- easy-property-listings.php (main plugin entry)
- languages/ – .mo/.po files for localization
- apigen/ – docs generation config & theme
- README.md, readme.txt, license.txt, Gruntfile.js, package.json for build & project metadata
- Config/build: Grunt + Prettier + JSHint, ApiGen for PHP docs.

##### README for additional insights
- Confirms it’s a WordPress plugin with custom post types (Property, Rental, Commercial, etc.), uses REST API, shortcodes for [listing], [listing_search], and hooks/filters for extensibility.

##### Architectural patterns & principles
- Hook-and-Filter (observer) pattern: plugin registers callbacks
- Modular separation: each functional area in its own directory
- Template fallback: load theme overrides before plugin defaults
- RESTful endpoint support: class-based REST API in lib/includes/class-epl-rest-api.php
- Extensibility via filters & actions in every module

## Diagram (Mermaid)

```mermaid
flowchart TD
    subgraph "WordPress Core"
        WP_Core["WordPress Core"]:::wp
        WP_DB["Database (wp_posts, wp_postmeta, wp_terms)"]:::db
        WP_Admin["WP Admin UI"]:::wp
        WP_Front["WP Front End"]:::wp
        WP_API["WP REST API"]:::wp
    end

    subgraph "Plugin"
        PEG["Plugin Entry"]:::plugin
        LANG["Language Translations"]:::plugin

        subgraph "Modules"
            PT["Post-Types"]:::plugin
            TX["Taxonomies"]:::plugin
            MB["Meta-Boxes"]:::plugin
            BL["Business Logic"]:::plugin
            REST["REST API"]:::plugin
            SC["Shortcodes"]:::plugin
            WD["Widgets"]:::plugin
            TMP["Templates"]:::plugin
            AS["Assets"]:::plugin
            COMP["Compatibility"]:::plugin
            UPD["Update & Licensing"]:::plugin
        end
    end

    subgraph "External Services"
        GM["Google Maps API"]:::external
        IC["iCal Generator"]:::external
    end

    subgraph "Build System"
        GR["Grunt Build"]:::build
        API_G["ApiGen Docs"]:::build
        API_CFG["ApiGen Config"]:::build
    end

    %% Initialization & Hooks
    WP_Core -->|loads| PEG
    WP_Core -->|dispatches hooks/filters| BL

    %% Plugin module initialization
    PEG --> PT
    PEG --> TX
    PEG --> MB
    PEG --> BL
    PEG --> SC
    PEG --> WD
    PEG --> TMP
    PEG --> AS
    PEG --> COMP
    PEG --> UPD
    PEG --> LANG

    %% Module interactions
    BL --> REST
    PT --> WP_DB
    TX --> WP_DB
    MB --> WP_Admin
    MB --> WP_DB
    SC --> WP_Front
    SC --> TMP
    WD --> WP_Front
    WD --> WP_DB
    TMP --> WP_Front
    REST --> WP_API
    REST --> WP_DB

    %% External integrations
    BL -->|calls| GM
    BL -->|generates| IC

    %% Build flows
    GR -->|minify JS/CSS| AS
    API_G -->|doc generation| BL
    API_G -->|uses| API_CFG

    %% User flows
    WP_Admin -->|CRUD operations| WP_DB
    WP_Front -->|render via| TMP
    WP_Front -->|shortcodes/widgets| SC
    WP_Front -->|shortcodes/widgets| WD

    %% Click Events
    click PEG "https://github.com/easypropertylistings/easy-property-listings/blob/master/easy-property-listings.php"
    click PT "https://github.com/easypropertylistings/easy-property-listings/tree/master/lib/post-types/"
    click TX "https://github.com/easypropertylistings/easy-property-listings/tree/master/lib/taxonomies/"
    click MB "https://github.com/easypropertylistings/easy-property-listings/tree/master/lib/meta-boxes/"
    click BL "https://github.com/easypropertylistings/easy-property-listings/tree/master/lib/includes/"
    click REST "https://github.com/easypropertylistings/easy-property-listings/blob/master/lib/includes/class-epl-rest-api.php"
    click SC "https://github.com/easypropertylistings/easy-property-listings/tree/master/lib/shortcodes/"
    click WD "https://github.com/easypropertylistings/easy-property-listings/tree/master/lib/widgets/"
    click TMP "https://github.com/easypropertylistings/easy-property-listings/tree/master/lib/templates/"
    click AS "https://github.com/easypropertylistings/easy-property-listings/tree/master/lib/assets/"
    click COMP "https://github.com/easypropertylistings/easy-property-listings/tree/master/lib/compatibility/"
    click UPD "https://github.com/easypropertylistings/easy-property-listings/tree/master/lib/updates/"
    click UPD "https://github.com/easypropertylistings/easy-property-listings/blob/master/lib/includes/class-epl-sl-plugin-updater.php"
    click LANG "https://github.com/easypropertylistings/easy-property-listings/tree/master/languages/"
    click API_CFG "https://github.com/easypropertylistings/easy-property-listings/blob/master/apigen.neon"
    click API_G "https://github.com/easypropertylistings/easy-property-listings/tree/master/apigen/"

    %% Styles
    classDef wp fill:#e0e0e0,stroke:#999,stroke-width:1px
    classDef plugin fill:#cce5ff,stroke:#004085,stroke-width:1px
    classDef external fill:#d4edda,stroke:#155724,stroke-width:1px
    classDef db fill:#ffeeba,stroke:#856404,stroke-width:1px
    classDef build fill:#f0e68c,stroke:#b8860b,stroke-width:1px
```
