# deltawebmaroc/rewardly-loyalty architecture

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

- Interactive diagram: https://gitdiagram.com/deltawebmaroc/rewardly-loyalty
- Repository: https://github.com/deltawebmaroc/rewardly-loyalty

## Overview

Nodevora Customer Rewards is a WooCommerce loyalty plugin. Store purchases earn points; customers can view balances and history, then apply points toward cart or checkout discounts. Store owners configure rules and manually adjust balances. The graph also preserves product-level earning notices, account and shortcode displays, styling, and documented Blocks support. Source excerpts show selected calls and table setup; several runtime registrations and storage interactions are unsampled, so those links are omitted rather than inferred.

Main entry points: [`includes/core/class-rewardly-loyalty-helpers.php`](https://github.com/deltawebmaroc/rewardly-loyalty/blob/main/includes/core/class-rewardly-loyalty-helpers.php) (Points calculations), [`includes/core/class-rewardly-loyalty-redeem.php`](https://github.com/deltawebmaroc/rewardly-loyalty/blob/main/includes/core/class-rewardly-loyalty-redeem.php) (Cart redemption), [`includes/shortcodes/class-rewardly-loyalty-shortcodes.php`](https://github.com/deltawebmaroc/rewardly-loyalty/blob/main/includes/shortcodes/class-rewardly-loyalty-shortcodes.php) (Shortcode displays), [`includes/admin/class-rewardly-loyalty-settings.php`](https://github.com/deltawebmaroc/rewardly-loyalty/blob/main/includes/admin/class-rewardly-loyalty-settings.php) (Loyalty settings)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_setup["Plugin Setup"]
  node_bootstrap["Plugin bootstrap"]
  node_logtable[("Points log table")]
end

subgraph group_admin["Store Administration"]
  node_adminui["Admin screens"]
  node_settings["Loyalty settings"]
  node_adjustments["Manual adjustments"]
  node_rules["Feature access"]
end

subgraph group_rewards["Points and Redemption"]
  node_points["Earn and reverse points"]
  node_redeem["Cart redemption"]
  node_helpers["Points calculations"]
  node_emails["Reward emails"]
end

subgraph group_customer["Customer Experience"]
  node_account["Account history"]
  node_shortcodes["Shortcode displays"]
  node_product["Product earn notice"]
end

subgraph group_presentation["Display and Blocks"]
  node_design["Loyalty styling"]
  node_blocks["Blocks support<br/>[loyalty-blocks.js]"]
  node_cartjs["Product interactions<br/>[loyalty-product.js]"]
  node_adminjs["Admin interactions<br/>[admin-pro.js]"]
  node_css["Frontend styles<br/>[loyalty.css]"]
end

node_owner(("Store owner"))
node_shopper(("Shopper"))

node_owner -->|"configures"| node_settings
node_owner -->|"adjusts balances"| node_adjustments
node_shopper -->|"earns points"| node_points
node_shopper -->|"redeems points"| node_redeem
node_bootstrap -->|"creates table"| node_logtable
node_adjustments -->|"changes balance"| node_helpers
node_points -->|"awards points"| node_helpers
node_redeem -->|"calculates value"| node_helpers
node_account -->|"reads points"| node_helpers
node_shortcodes -->|"reads points"| node_helpers
node_shortcodes -->|"renders loyalty card"| node_redeem
node_product -->|"calculates earn notice"| node_helpers
node_design -->|"reads style settings"| node_helpers
node_settings -->|"uses defaults"| node_helpers

click node_bootstrap "https://github.com/deltawebmaroc/rewardly-loyalty/blob/main/nodevora-customer-rewards-for-woocommerce.php"
click node_adminui "https://github.com/deltawebmaroc/rewardly-loyalty/blob/main/includes/admin/class-rewardly-loyalty-admin.php"
click node_settings "https://github.com/deltawebmaroc/rewardly-loyalty/blob/main/includes/admin/class-rewardly-loyalty-settings.php"
click node_adjustments "https://github.com/deltawebmaroc/rewardly-loyalty/blob/main/includes/admin/class-rewardly-loyalty-admin-adjustments.php"
click node_rules "https://github.com/deltawebmaroc/rewardly-loyalty/blob/main/includes/core/class-rewardly-loyalty-pro.php"
click node_points "https://github.com/deltawebmaroc/rewardly-loyalty/blob/main/includes/core/class-rewardly-loyalty-points.php"
click node_redeem "https://github.com/deltawebmaroc/rewardly-loyalty/blob/main/includes/core/class-rewardly-loyalty-redeem.php"
click node_helpers "https://github.com/deltawebmaroc/rewardly-loyalty/blob/main/includes/core/class-rewardly-loyalty-helpers.php"
click node_emails "https://github.com/deltawebmaroc/rewardly-loyalty/blob/main/includes/core/class-rewardly-loyalty-emails.php"
click node_account "https://github.com/deltawebmaroc/rewardly-loyalty/blob/main/includes/front/class-rewardly-loyalty-account.php"
click node_shortcodes "https://github.com/deltawebmaroc/rewardly-loyalty/blob/main/includes/shortcodes/class-rewardly-loyalty-shortcodes.php"
click node_product "https://github.com/deltawebmaroc/rewardly-loyalty/blob/main/includes/front/class-rewardly-loyalty-product.php"
click node_design "https://github.com/deltawebmaroc/rewardly-loyalty/blob/main/includes/design/class-rewardly-loyalty-design.php"
click node_blocks "https://github.com/deltawebmaroc/rewardly-loyalty/blob/main/assets/js/loyalty-blocks.js"
click node_cartjs "https://github.com/deltawebmaroc/rewardly-loyalty/blob/main/assets/js/loyalty-product.js"
click node_adminjs "https://github.com/deltawebmaroc/rewardly-loyalty/blob/main/assets/js/admin-pro.js"
click node_css "https://github.com/deltawebmaroc/rewardly-loyalty/blob/main/assets/css/loyalty.css"

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_logtable toneBlue
class node_adminui,node_settings,node_adjustments,node_rules toneAmber
class node_points,node_redeem,node_helpers,node_emails toneMint
class node_account,node_shortcodes,node_product toneRose
class node_design,node_blocks,node_cartjs,node_adminjs,node_css,node_owner,node_shopper toneIndigo
```

## Components

### Plugin Setup

- [Plugin bootstrap](https://github.com/deltawebmaroc/rewardly-loyalty/blob/main/nodevora-customer-rewards-for-woocommerce.php): `nodevora-customer-rewards-for-woocommerce.php`
- **Points log table**

### Store Administration

- [Admin screens](https://github.com/deltawebmaroc/rewardly-loyalty/blob/main/includes/admin/class-rewardly-loyalty-admin.php): `includes/admin/class-rewardly-loyalty-admin.php`
- [Loyalty settings](https://github.com/deltawebmaroc/rewardly-loyalty/blob/main/includes/admin/class-rewardly-loyalty-settings.php): `includes/admin/class-rewardly-loyalty-settings.php`
- [Manual adjustments](https://github.com/deltawebmaroc/rewardly-loyalty/blob/main/includes/admin/class-rewardly-loyalty-admin-adjustments.php): `includes/admin/class-rewardly-loyalty-admin-adjustments.php`
- [Feature access](https://github.com/deltawebmaroc/rewardly-loyalty/blob/main/includes/core/class-rewardly-loyalty-pro.php): `includes/core/class-rewardly-loyalty-pro.php`

### Points and Redemption

- [Earn and reverse points](https://github.com/deltawebmaroc/rewardly-loyalty/blob/main/includes/core/class-rewardly-loyalty-points.php): `includes/core/class-rewardly-loyalty-points.php`
- [Cart redemption](https://github.com/deltawebmaroc/rewardly-loyalty/blob/main/includes/core/class-rewardly-loyalty-redeem.php): `includes/core/class-rewardly-loyalty-redeem.php`
- [Points calculations](https://github.com/deltawebmaroc/rewardly-loyalty/blob/main/includes/core/class-rewardly-loyalty-helpers.php): `includes/core/class-rewardly-loyalty-helpers.php`
- [Reward emails](https://github.com/deltawebmaroc/rewardly-loyalty/blob/main/includes/core/class-rewardly-loyalty-emails.php): `includes/core/class-rewardly-loyalty-emails.php`

### Customer Experience

- [Account history](https://github.com/deltawebmaroc/rewardly-loyalty/blob/main/includes/front/class-rewardly-loyalty-account.php): `includes/front/class-rewardly-loyalty-account.php`
- [Shortcode displays](https://github.com/deltawebmaroc/rewardly-loyalty/blob/main/includes/shortcodes/class-rewardly-loyalty-shortcodes.php): `includes/shortcodes/class-rewardly-loyalty-shortcodes.php`
- [Product earn notice](https://github.com/deltawebmaroc/rewardly-loyalty/blob/main/includes/front/class-rewardly-loyalty-product.php): `includes/front/class-rewardly-loyalty-product.php`

### Display and Blocks

- [Loyalty styling](https://github.com/deltawebmaroc/rewardly-loyalty/blob/main/includes/design/class-rewardly-loyalty-design.php): `includes/design/class-rewardly-loyalty-design.php`
- [Blocks support](https://github.com/deltawebmaroc/rewardly-loyalty/blob/main/assets/js/loyalty-blocks.js): `assets/js/loyalty-blocks.js`
- [Product interactions](https://github.com/deltawebmaroc/rewardly-loyalty/blob/main/assets/js/loyalty-product.js): `assets/js/loyalty-product.js`
- [Admin interactions](https://github.com/deltawebmaroc/rewardly-loyalty/blob/main/assets/js/admin-pro.js): `assets/js/admin-pro.js`
- [Frontend styles](https://github.com/deltawebmaroc/rewardly-loyalty/blob/main/assets/css/loyalty.css): `assets/css/loyalty.css`

### Other components

- **Store owner**
- **Shopper**

## Connections

- Store owner → Loyalty settings: configures (evidence: `README.md`)
- Store owner → Manual adjustments: adjusts balances (evidence: `README.md`)
- Shopper → Earn and reverse points: earns points (evidence: `README.md`)
- Shopper → Cart redemption: redeems points (evidence: `README.md`)
- Plugin bootstrap → Points log table: creates table (evidence: `nodevora-customer-rewards-for-woocommerce.php`)
- Manual adjustments → Points calculations: changes balance (evidence: `includes/admin/class-rewardly-loyalty-admin-adjustments.php`)
- Earn and reverse points → Points calculations: awards points (evidence: `includes/core/class-rewardly-loyalty-points.php`)
- Cart redemption → Points calculations: calculates value (evidence: `includes/core/class-rewardly-loyalty-redeem.php`)
- Account history → Points calculations: reads points (evidence: `includes/front/class-rewardly-loyalty-account.php`)
- Shortcode displays → Points calculations: reads points (evidence: `includes/shortcodes/class-rewardly-loyalty-shortcodes.php`)
- Shortcode displays → Cart redemption: renders loyalty card (evidence: `includes/shortcodes/class-rewardly-loyalty-shortcodes.php`)
- Product earn notice → Points calculations: calculates earn notice (evidence: `includes/front/class-rewardly-loyalty-product.php`)
- Loyalty styling → Points calculations: reads style settings (evidence: `includes/design/class-rewardly-loyalty-design.php`)
- Loyalty settings → Points calculations: uses defaults (evidence: `includes/admin/class-rewardly-loyalty-settings.php`)
