# navidnasro/upon-word architecture

> Architecture diagram of the GitHub repository navidnasro/upon-word, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-11-13). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/navidnasro/upon-word
- Repository: https://github.com/navidnasro/upon-word

## Overview

UponWord is a WordPress theme-development framework, with a bundled theme engine providing storefront and admin features. The principal workflow is theme startup, request-aware service injection, then WordPress-facing services and theme output; separate branches cover settings, database access, security, and WooCommerce. The README documents theme setup, reusable helpers, and demo templates. The graph uses the supplied excerpts and source index; unsampled subsystems are represented conservatively, without assuming undocumented wiring.

Main entry points: [`UponWord/services/runners/ServiceInjector.php`](https://github.com/navidnasro/upon-word/blob/master/UponWord/services/runners/ServiceInjector.php) (Service Injector), [`UponWord/services/injectors/WpWidgetServiceInjector.php`](https://github.com/navidnasro/upon-word/blob/master/UponWord/services/injectors/WpWidgetServiceInjector.php) (Widget Injector), [`UponWord/utils/Request.php`](https://github.com/navidnasro/upon-word/blob/master/UponWord/utils/Request.php) (Request Utilities), [`engine/services/services.php`](https://github.com/navidnasro/upon-word/blob/master/engine/services/services.php) (Theme Services)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_startup["Theme Runtime"]
  node_bootstrap["Framework Bootstrap<br/>[Bootstrap.php]"]
  node_initializer["Theme Initializer"]
end

subgraph group_framework["Framework Services"]
  node_scope["Request Scope<br/>[Scope.php]"]
  node_service_injector["Service Injector"]
  node_widget_injector["Widget Injector"]
  node_helpers["Theme Helpers<br/>[Theme.php]"]
  node_request["Request Utilities<br/>[Request.php]"]
  node_user_helpers["User Utilities<br/>[User.php]"]
  node_woocommerce_helpers["Commerce Utilities<br/>[Woocommerce.php]"]
end

subgraph group_theme["Theme Features"]
  node_service_config["Service Registry<br/>[services.php]"]
  node_theme_services["Theme Services<br/>[services.php]"]
  node_live_search["Live Search<br/>[LiveSearch.php]"]
  node_woocommerce_hooks["WooCommerce Features<br/>[Hooks.php]"]
  node_admin_ajax["Admin AJAX<br/>[AjaxHandler.php]"]
  node_templates["Demo Templates<br/>[DemoFactory.php]"]
end

subgraph group_data["Data and Security"]
  node_sanitize["Input Sanitization<br/>[Sanitize.php]"]
  node_escape["Output Escaping<br/>[Escape.php]"]
  node_json["JSON Storage<br/>[Json.php]"]
  node_query_builder["Query Builder<br/>[QueryBuilder.php]"]
  node_table_manager["Table Manager<br/>[TableManager.php]"]
  node_wordpress_db[("WordPress Database")]
end

subgraph group_settings["Configuration"]
  node_settings["Theme Settings<br/>[Loader.php]"]
  node_codestar["Codestar Options<br/>[setup.class.php]"]
end

node_wordpress(("WordPress"))

node_wordpress -.->|"initializes theme"| node_initializer
node_bootstrap -.->|"starts services"| node_service_injector
node_initializer -.->|"configures runtime"| node_service_injector
node_service_injector -->|"reads request"| node_request
node_service_injector -->|"checks scope"| node_scope
node_service_injector -->|"dispatches widgets"| node_widget_injector
node_widget_injector -->|"checks widgets"| node_helpers
node_widget_injector -.->|"injects handlers"| node_theme_services
node_service_config -->|"registers service"| node_live_search
node_service_config -->|"declares handlers"| node_theme_services
node_request -->|"sanitizes input"| node_sanitize
node_admin_ajax -->|"reads request"| node_request
node_admin_ajax -->|"reads location data"| node_json
node_woocommerce_hooks -->|"loads favorites"| node_user_helpers
node_woocommerce_hooks -.->|"uses commerce helpers"| node_woocommerce_helpers
node_theme_services -->|"escapes labels"| node_escape
node_table_manager -->|"queries tables"| node_query_builder
node_query_builder -->|"executes queries"| node_wordpress_db
node_settings -.->|"uses options framework"| node_codestar
node_wordpress -.->|"renders theme parts"| node_templates
node_wordpress -.->|"configures theme"| node_settings

click node_bootstrap "https://github.com/navidnasro/upon-word/blob/master/UponWord/Bootstrap.php"
click node_initializer "https://github.com/navidnasro/upon-word/blob/master/engine/ThemeInitializer.php"
click node_scope "https://github.com/navidnasro/upon-word/blob/master/UponWord/Scope.php"
click node_service_injector "https://github.com/navidnasro/upon-word/blob/master/UponWord/services/runners/ServiceInjector.php"
click node_widget_injector "https://github.com/navidnasro/upon-word/blob/master/UponWord/services/injectors/WpWidgetServiceInjector.php"
click node_service_config "https://github.com/navidnasro/upon-word/blob/master/engine/services/services.php"
click node_theme_services "https://github.com/navidnasro/upon-word/blob/master/engine/services/services.php"
click node_live_search "https://github.com/navidnasro/upon-word/blob/master/engine/services/ajax/LiveSearch.php"
click node_woocommerce_hooks "https://github.com/navidnasro/upon-word/blob/master/engine/woocommerce/Hooks.php"
click node_admin_ajax "https://github.com/navidnasro/upon-word/blob/master/engine/admin/AjaxHandler.php"
click node_templates "https://github.com/navidnasro/upon-word/blob/master/UponWord/template/DemoFactory.php"
click node_helpers "https://github.com/navidnasro/upon-word/blob/master/UponWord/utils/Theme.php"
click node_request "https://github.com/navidnasro/upon-word/blob/master/UponWord/utils/Request.php"
click node_sanitize "https://github.com/navidnasro/upon-word/blob/master/UponWord/security/Sanitize.php"
click node_escape "https://github.com/navidnasro/upon-word/blob/master/UponWord/security/Escape.php"
click node_json "https://github.com/navidnasro/upon-word/blob/master/UponWord/storage/Json.php"
click node_query_builder "https://github.com/navidnasro/upon-word/blob/master/UponWord/database/QueryBuilder.php"
click node_table_manager "https://github.com/navidnasro/upon-word/blob/master/UponWord/database/TableManager.php"
click node_settings "https://github.com/navidnasro/upon-word/blob/master/engine/settings/Loader.php"
click node_codestar "https://github.com/navidnasro/upon-word/blob/master/codestar/classes/setup.class.php"
click node_user_helpers "https://github.com/navidnasro/upon-word/blob/master/UponWord/utils/User.php"
click node_woocommerce_helpers "https://github.com/navidnasro/upon-word/blob/master/UponWord/utils/Woocommerce.php"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_bootstrap,node_initializer toneBlue
class node_scope,node_service_injector,node_widget_injector,node_helpers,node_request,node_user_helpers,node_woocommerce_helpers toneAmber
class node_service_config,node_theme_services,node_live_search,node_woocommerce_hooks,node_admin_ajax,node_templates toneMint
class node_sanitize,node_escape,node_json,node_query_builder,node_table_manager,node_wordpress_db toneRose
class node_settings,node_codestar,node_wordpress toneIndigo
```

## Components

### Theme Runtime

- [Framework Bootstrap](https://github.com/navidnasro/upon-word/blob/master/UponWord/Bootstrap.php): `UponWord/Bootstrap.php`
- [Theme Initializer](https://github.com/navidnasro/upon-word/blob/master/engine/ThemeInitializer.php): `engine/ThemeInitializer.php`

### Framework Services

- [Request Scope](https://github.com/navidnasro/upon-word/blob/master/UponWord/Scope.php): `UponWord/Scope.php`
- [Service Injector](https://github.com/navidnasro/upon-word/blob/master/UponWord/services/runners/ServiceInjector.php): `UponWord/services/runners/ServiceInjector.php`
- [Widget Injector](https://github.com/navidnasro/upon-word/blob/master/UponWord/services/injectors/WpWidgetServiceInjector.php): `UponWord/services/injectors/WpWidgetServiceInjector.php`
- [Theme Helpers](https://github.com/navidnasro/upon-word/blob/master/UponWord/utils/Theme.php): `UponWord/utils/Theme.php`
- [Request Utilities](https://github.com/navidnasro/upon-word/blob/master/UponWord/utils/Request.php): `UponWord/utils/Request.php`
- [User Utilities](https://github.com/navidnasro/upon-word/blob/master/UponWord/utils/User.php): `UponWord/utils/User.php`
- [Commerce Utilities](https://github.com/navidnasro/upon-word/blob/master/UponWord/utils/Woocommerce.php): `UponWord/utils/Woocommerce.php`

### Theme Features

- [Service Registry](https://github.com/navidnasro/upon-word/blob/master/engine/services/services.php): `engine/services/services.php`
- [Theme Services](https://github.com/navidnasro/upon-word/blob/master/engine/services/services.php): `engine/services/services.php`
- [Live Search](https://github.com/navidnasro/upon-word/blob/master/engine/services/ajax/LiveSearch.php): `engine/services/ajax/LiveSearch.php`
- [WooCommerce Features](https://github.com/navidnasro/upon-word/blob/master/engine/woocommerce/Hooks.php): `engine/woocommerce/Hooks.php`
- [Admin AJAX](https://github.com/navidnasro/upon-word/blob/master/engine/admin/AjaxHandler.php): `engine/admin/AjaxHandler.php`
- [Demo Templates](https://github.com/navidnasro/upon-word/blob/master/UponWord/template/DemoFactory.php): `UponWord/template/DemoFactory.php`

### Data and Security

- [Input Sanitization](https://github.com/navidnasro/upon-word/blob/master/UponWord/security/Sanitize.php): `UponWord/security/Sanitize.php`
- [Output Escaping](https://github.com/navidnasro/upon-word/blob/master/UponWord/security/Escape.php): `UponWord/security/Escape.php`
- [JSON Storage](https://github.com/navidnasro/upon-word/blob/master/UponWord/storage/Json.php): `UponWord/storage/Json.php`
- [Query Builder](https://github.com/navidnasro/upon-word/blob/master/UponWord/database/QueryBuilder.php): `UponWord/database/QueryBuilder.php`
- [Table Manager](https://github.com/navidnasro/upon-word/blob/master/UponWord/database/TableManager.php): `UponWord/database/TableManager.php`
- **WordPress Database**

### Configuration

- [Theme Settings](https://github.com/navidnasro/upon-word/blob/master/engine/settings/Loader.php): `engine/settings/Loader.php`
- [Codestar Options](https://github.com/navidnasro/upon-word/blob/master/codestar/classes/setup.class.php): `codestar/classes/setup.class.php`

### Other components

- **WordPress**

## Connections

- WordPress → Theme Initializer: initializes theme
- Framework Bootstrap → Service Injector: starts services
- Theme Initializer → Service Injector: configures runtime
- Service Injector → Request Utilities: reads request (evidence: `UponWord/services/runners/ServiceInjector.php`)
- Service Injector → Request Scope: checks scope (evidence: `UponWord/services/runners/ServiceInjector.php`)
- Service Injector → Widget Injector: dispatches widgets (evidence: `UponWord/services/runners/ServiceInjector.php`)
- Widget Injector → Theme Helpers: checks widgets (evidence: `UponWord/services/injectors/WpWidgetServiceInjector.php`)
- Widget Injector → Theme Services: injects handlers
- Service Registry → Live Search: registers service (evidence: `engine/services/services.php`)
- Service Registry → Theme Services: declares handlers (evidence: `engine/services/services.php`)
- Request Utilities → Input Sanitization: sanitizes input (evidence: `UponWord/utils/Request.php`)
- Admin AJAX → Request Utilities: reads request (evidence: `engine/admin/AjaxHandler.php`)
- Admin AJAX → JSON Storage: reads location data (evidence: `engine/admin/AjaxHandler.php`)
- WooCommerce Features → User Utilities: loads favorites (evidence: `engine/woocommerce/Hooks.php`)
- WooCommerce Features → Commerce Utilities: uses commerce helpers (evidence: `engine/woocommerce/Hooks.php`)
- Theme Services → Output Escaping: escapes labels (evidence: `engine/services/services.php`)
- Table Manager → Query Builder: queries tables (evidence: `UponWord/database/TableManager.php`)
- Query Builder → WordPress Database: executes queries (evidence: `UponWord/database/QueryBuilder.php`)
- Theme Settings → Codestar Options: uses options framework
- WordPress → Demo Templates: renders theme parts
- WordPress → Theme Settings: configures theme
