# blacksk81/pizzeriatheme architecture

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

- Interactive diagram: https://gitdiagram.com/blacksk81/pizzeriatheme
- Repository: https://github.com/blacksk81/pizzeriatheme

## Overview

##### Project type and purpose
- This is a WordPress theme (“pizzeriaTheme”) built with Bootstrap 4 for a pizzeria website.
- It bundles the “Advanced Custom Fields” (ACF) plugin and provides reservation functionality, Google Maps integration, and Google reCAPTCHA.

##### File structure
- Top-level theme files (style.css, functions.php, header.php, footer.php, page-*.php, single.php, index.php).
- Asset directories (css/, js/, images/, webfonts/).
- Template partials under parts/ (hero, form-reserva).
- Custom logic under inc/ (admin-options, database-reservations, logic-reservations, shortcodes).
- Bundled plugin under advanced-custom-fields/.
- Admin UI overrides under admin-parts/.

##### README insights
- Confirms use of ACF plugin, Bootstrap 4, Google Maps & reCAPTCHA APIs, WP Duplicator zip for full environment.

##### Components
a. Presentation Layer
- Web Browser (User)
- Theme front-end assets (Bootstrap CSS/JS, theme CSS, scripts.js, lightbox, FontAwesome)
- Template hierarchy (front-page.php, page-*.php, single.php)
- Template partials (parts/hero, parts/form-reserva, sidebar, searchform)
b. Application Layer
- WordPress Core (PHP engine, routing, loop, theme hooks)
- Theme functions (functions.php, inc/shortcodes.php, admin-options.php)
- ACF Plugin (advanced-custom-fields/core controllers, fields, views)
- Custom reservation logic (inc/logic-reservations.php)
- Reservation data access (inc/database-reservations.php)
- Admin UI overrides (admin-parts/theme-settings.php, view-reservation-list.php)
c. Data Layer
- MySQL Database (wp_posts, wp_postmeta for ACF fields, custom reservation tables if any)
d. External Services
- Google Maps API (via front-end JS)
- Google reCAPTCHA API (via contact/reservation form)
- WP Duplicator (deployment artifact)

##### Relationships and interactions
- Browser → Web server: HTTP(S) requests for pages, assets, AJAX.
- WordPress Core → Theme: theme hooks, template loader, enqueues CSS/JS.
- Theme → ACF Plugin: registers field groups, renders custom fields in admin & front-end.
- Theme → inc/logic-reservations: processes form submissions, calls database-reservations.
- logic-reservations → MySQL: reads/writes reservation records.
- Front-end JS → Google APIs: map display, CAPTCHA validation.
- Admin UI parts → WordPress Dashboard: custom settings page & reservation list.

##### Architectural patterns and design principles
- Layered architecture: Presentation → Application → Data.
- WP hook system (action/filters) for extensibility.
- MVC-style separation: templates (View), inc/logic (Controller), database scripts (Model).
- Modularization via inc/, parts/, and plugin folder.

##### Detail
- Every folder as a sub-component: parts/, inc/, advanced-custom-fields/.
- Files: functions.php (enqueue, hooks), logic-reservations.php (business rules), database-reservations.php (SQL queries), advanced-custom-fields/core/controllers/etc.

## Diagram (Mermaid)

```mermaid
flowchart TB
    subgraph "Presentation Layer"
        Browser(("Web Browser (User)")):::browser
        subgraph "Theme Front-end Assets"
            CSS(("CSS Files")):::assets
            JS(("JS Files")):::assets
            IMGS(("Images")):::assets
            FONTS(("Webfonts")):::assets
            Style(("style.css")):::assets
        end
        subgraph "Templates"
            FrontPage(("front-page.php")):::template
            Page(("page.php")):::template
            PageContacto(("page-contacto.php")):::template
            PageMenu(("page-menu.php")):::template
            PageNos(("page-nosotros.php")):::template
            Single(("single.php")):::template
            Index(("index.php")):::template
        end
        subgraph "Partials"
            Hero(("parts/hero.php")):::partial
            FormReserva(("parts/form-reserva.php")):::partial
            Sidebar(("sidebar.php")):::partial
            SearchForm(("searchform.php")):::partial
        end
    end

    subgraph "Application Layer"
        WP(("WordPress Core")):::core
        subgraph "Theme Functions"
            Func(("functions.php")):::theme
            Shortcodes(("inc/shortcodes.php")):::theme
            AdminOpts(("inc/admin-options.php")):::theme
        end
        subgraph "Custom Reservation Logic"
            LogicRes(("inc/logic-reservations.php")):::logic
            DBRes(("inc/database-reservations.php")):::data
        end
        subgraph "ACF Plugin"
            ACFBootstrap(("acf.php")):::plugin
            ACFDir(("advanced-custom-fields/")):::plugin
        end
        subgraph "Admin UI Overrides"
            ThemeSettings(("admin-parts/theme-settings.php")):::theme
            ViewResList(("admin-parts/view-reservation-list.php")):::theme
        end
    end

    subgraph "Data Layer"
        MySQL(("MySQL Database")):::data
    end

    subgraph "External Services"
        GoogleMaps(("Google Maps API")):::external
        Recaptcha(("Google reCAPTCHA API")):::external
        Duplicator(("WP Duplicator")):::external
    end

    %% Relationships
    Browser -->|requests pages/assets| WP
    WP -->|hooks/enqueue| Func
    Func -->|enqueues| CSS
    Func -->|enqueues| JS
    WP -->|loads template| FrontPage
    WP -->|loads template| Page
    WP -->|loads template| PageContacto
    WP -->|loads template| PageMenu
    WP -->|loads template| PageNos
    WP -->|loads template| Single
    WP -->|loads template| Index
    FrontPage -->|includes| Hero
    Page -->|includes| FormReserva
    Page -->|includes| Sidebar
    Page -->|includes| SearchForm
    Func -->|registers shortcodes| Shortcodes
    Func -->|registers settings| AdminOpts
    WP -->|initializes| ACFBootstrap
    ACFBootstrap -->|loads core| ACFDir
    Func -->|uses ACF fields| ACFDir
    FormReserva -->|submits data| LogicRes
    LogicRes -->|calls| DBRes
    DBRes -->|reads/writes| MySQL
    LogicRes -->|reads/writes| MySQL
    ThemeSettings -->|adds settings page| WP
    ViewResList -->|adds admin list| WP
    JS -->|calls| GoogleMaps
    JS -->|calls| Recaptcha
    Duplicator -->|deployment artifact| WP

    %% Click Events
    click CSS "https://github.com/blacksk81/pizzeriatheme/tree/master/css/"
    click JS "https://github.com/blacksk81/pizzeriatheme/tree/master/js/"
    click IMGS "https://github.com/blacksk81/pizzeriatheme/tree/master/images/"
    click FONTS "https://github.com/blacksk81/pizzeriatheme/tree/master/webfonts/"
    click Style "https://github.com/blacksk81/pizzeriatheme/blob/master/style.css"
    click FrontPage "https://github.com/blacksk81/pizzeriatheme/blob/master/front-page.php"
    click Page "https://github.com/blacksk81/pizzeriatheme/blob/master/page.php"
    click PageContacto "https://github.com/blacksk81/pizzeriatheme/blob/master/page-contacto.php"
    click PageMenu "https://github.com/blacksk81/pizzeriatheme/blob/master/page-menu.php"
    click PageNos "https://github.com/blacksk81/pizzeriatheme/blob/master/page-nosotros.php"
    click Single "https://github.com/blacksk81/pizzeriatheme/blob/master/single.php"
    click Index "https://github.com/blacksk81/pizzeriatheme/blob/master/index.php"
    click Hero "https://github.com/blacksk81/pizzeriatheme/blob/master/parts/hero.php"
    click FormReserva "https://github.com/blacksk81/pizzeriatheme/blob/master/parts/form-reserva.php"
    click Sidebar "https://github.com/blacksk81/pizzeriatheme/blob/master/sidebar.php"
    click SearchForm "https://github.com/blacksk81/pizzeriatheme/blob/master/searchform.php"
    click Func "https://github.com/blacksk81/pizzeriatheme/blob/master/functions.php"
    click Shortcodes "https://github.com/blacksk81/pizzeriatheme/blob/master/inc/shortcodes.php"
    click AdminOpts "https://github.com/blacksk81/pizzeriatheme/blob/master/inc/admin-options.php"
    click LogicRes "https://github.com/blacksk81/pizzeriatheme/blob/master/inc/logic-reservations.php"
    click DBRes "https://github.com/blacksk81/pizzeriatheme/blob/master/inc/database-reservations.php"
    click ThemeSettings "https://github.com/blacksk81/pizzeriatheme/blob/master/admin-parts/theme-settings.php"
    click ViewResList "https://github.com/blacksk81/pizzeriatheme/blob/master/admin-parts/view-reservation-list.php"
    click ACFDir "https://github.com/blacksk81/pizzeriatheme/tree/master/advanced-custom-fields/"
    click ACFBootstrap "https://github.com/blacksk81/pizzeriatheme/blob/master/acf.php"

    %% Styles
    classDef browser fill:#f9f,stroke:#333,stroke-width:1px
    classDef assets fill:#ff9,stroke:#333,stroke-width:1px
    classDef template fill:#9ff,stroke:#333,stroke-width:1px
    classDef partial fill:#cfc,stroke:#333,stroke-width:1px
    classDef core fill:#fdd,stroke:#333,stroke-width:1px
    classDef theme fill:#dfd,stroke:#333,stroke-width:1px
    classDef plugin fill:#ddf,stroke:#333,stroke-width:1px
    classDef logic fill:#ffd,stroke:#333,stroke-width:1px
    classDef data fill:#fee,stroke:#333,stroke-width:1px
    classDef external fill:#def,stroke:#333,stroke-width:1px
```
