# pbgeorge/pvs_new_website architecture

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

- Interactive diagram: https://gitdiagram.com/pbgeorge/pvs_new_website
- Repository: https://github.com/pbgeorge/pvs_new_website

## Overview

This repository combines a Power Vantage Solutions marketing/contact site with a separate PHP food diary. The food-log workflow is account sign-in, then logging meals or activities, reviewing dashboard/diary summaries, and exporting records. Meal entry estimates nutrition before saving; users can also manage account settings and recover passwords. Shared bootstrap code supplies authentication, database access, schema setup, and diary helpers. The excerpts establish the principal calls and page links; several other capabilities are represented from the file index, so unsampled relationships are omitted.

Main entry points: [`food/bootstrap.php`](https://github.com/pbgeorge/pvs_new_website/blob/main/food/bootstrap.php) (Auth And Diary Helpers), [`food/diary.php`](https://github.com/pbgeorge/pvs_new_website/blob/main/food/diary.php) (Meal Diary), [`submit.php`](https://github.com/pbgeorge/pvs_new_website/blob/main/submit.php) (Lead Handler), [`food/activity.php`](https://github.com/pbgeorge/pvs_new_website/blob/main/food/activity.php) (Activity Entry)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_marketing["Marketing Site"]
  node_contact_form["Contact Form<br/>[index.html]"]
  node_lead_handler["Lead Handler<br/>[submit.php]"]
  node_lead_config["Lead Configuration<br/>[db_config.php]"]
end

subgraph group_food_ui["Food Log Pages"]
  node_food_auth["Sign In And Recovery<br/>[login.php]"]
  node_dashboard["Nutrition Dashboard<br/>[index.php]"]
  node_diary["Meal Diary<br/>[diary.php]"]
  node_meal_editor["Meal Entry<br/>[meal.php]"]
  node_activity_editor["Activity Entry<br/>[activity.php]"]
  node_add_router["Entry Choice<br/>[add.php]"]
  node_export_ui["Export Options<br/>[exports.php]"]
  node_spreadsheet_export["Spreadsheet Export<br/>[export.php]"]
  node_print_export["Printable Diary<br/>[print.php]"]
  node_account["Account Settings<br/>[password.php]"]
end

subgraph group_food_core["Food Log Core"]
  node_food_bootstrap["Auth And Diary Helpers<br/>[bootstrap.php]"]
  node_food_config["Food Configuration<br/>[config.php]"]
  node_shared_header["Shared Page Header<br/>[header.php]"]
  node_shared_footer["Shared Page Footer<br/>[footer.php]"]
  node_food_mailer["SMTP Mailer<br/>[mailer.php]"]
end

subgraph group_data_integrations["Data And Services"]
  node_food_database[("Food Log Database")]
  node_lead_database[("Leads Database")]
  node_smtp_service["SMTP Service"]
  node_nutrition_service{{"Nutrition Estimation API"}}
end

node_visitor(("Site Visitor"))
node_food_user(("Food Log User"))

node_visitor -->|"submits enquiry"| node_contact_form
node_contact_form -->|"posts form"| node_lead_handler
node_visitor -.->|"sends request"| node_lead_handler
node_lead_handler -->|"loads settings"| node_lead_config
node_lead_handler -->|"stores enquiry"| node_lead_database
node_lead_handler -->|"sends notification"| node_smtp_service
node_food_user -.->|"signs in"| node_food_auth
node_food_user -.->|"views summary"| node_dashboard
node_food_user -.->|"reviews entries"| node_diary
node_food_user -->|"starts entry"| node_add_router
node_food_user -.->|"chooses export"| node_export_ui
node_dashboard -->|"loads summaries"| node_food_bootstrap
node_diary -->|"builds diary view"| node_food_bootstrap
node_diary -->|"links meal edits"| node_meal_editor
node_diary -->|"links activity edits"| node_activity_editor
node_add_router -.->|"routes meal entry"| node_meal_editor
node_add_router -.->|"routes activity entry"| node_activity_editor
node_meal_editor -->|"uses helpers"| node_food_bootstrap
node_meal_editor -.->|"requests estimates"| node_nutrition_service
node_activity_editor -->|"uses helpers"| node_food_bootstrap
node_export_ui -->|"fetches rows"| node_spreadsheet_export
node_export_ui -->|"opens print view"| node_print_export
node_spreadsheet_export -->|"uses helpers"| node_food_bootstrap
node_print_export -->|"builds export view"| node_food_bootstrap
node_food_auth -->|"uses auth helpers"| node_food_bootstrap
node_food_auth -->|"sends recovery mail"| node_food_mailer
node_food_mailer -.->|"sends email"| node_smtp_service
node_account -.->|"uses helpers"| node_food_bootstrap
node_food_bootstrap -->|"loads settings"| node_food_config
node_food_bootstrap -->|"connects and initializes"| node_food_database
node_dashboard -->|"renders header"| node_shared_header
node_diary -->|"renders header"| node_shared_header
node_activity_editor -->|"renders header"| node_shared_header
node_print_export -->|"renders header"| node_shared_header
node_diary -->|"renders footer"| node_shared_footer
node_activity_editor -->|"renders footer"| node_shared_footer
node_print_export -->|"renders footer"| node_shared_footer

click node_contact_form "https://github.com/pbgeorge/pvs_new_website/blob/main/index.html"
click node_lead_handler "https://github.com/pbgeorge/pvs_new_website/blob/main/submit.php"
click node_lead_config "https://github.com/pbgeorge/pvs_new_website/blob/main/db_config.php"
click node_food_auth "https://github.com/pbgeorge/pvs_new_website/blob/main/food/login.php"
click node_dashboard "https://github.com/pbgeorge/pvs_new_website/blob/main/food/index.php"
click node_diary "https://github.com/pbgeorge/pvs_new_website/blob/main/food/diary.php"
click node_meal_editor "https://github.com/pbgeorge/pvs_new_website/blob/main/food/meal.php"
click node_activity_editor "https://github.com/pbgeorge/pvs_new_website/blob/main/food/activity.php"
click node_add_router "https://github.com/pbgeorge/pvs_new_website/blob/main/food/add.php"
click node_export_ui "https://github.com/pbgeorge/pvs_new_website/blob/main/food/exports.php"
click node_spreadsheet_export "https://github.com/pbgeorge/pvs_new_website/blob/main/food/export.php"
click node_print_export "https://github.com/pbgeorge/pvs_new_website/blob/main/food/print.php"
click node_account "https://github.com/pbgeorge/pvs_new_website/blob/main/food/password.php"
click node_food_bootstrap "https://github.com/pbgeorge/pvs_new_website/blob/main/food/bootstrap.php"
click node_food_config "https://github.com/pbgeorge/pvs_new_website/blob/main/food/config.php"
click node_shared_header "https://github.com/pbgeorge/pvs_new_website/blob/main/food/header.php"
click node_shared_footer "https://github.com/pbgeorge/pvs_new_website/blob/main/food/footer.php"
click node_food_mailer "https://github.com/pbgeorge/pvs_new_website/blob/main/food/mailer.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_contact_form,node_lead_handler,node_lead_config,node_food_user toneBlue
class node_food_auth,node_dashboard,node_diary,node_meal_editor,node_activity_editor,node_add_router,node_export_ui,node_spreadsheet_export,node_print_export,node_account toneAmber
class node_food_bootstrap,node_food_config,node_shared_header,node_shared_footer,node_food_mailer toneMint
class node_food_database,node_lead_database,node_smtp_service,node_nutrition_service toneRose
class node_visitor toneIndigo
```

## Components

### Marketing Site

- [Contact Form](https://github.com/pbgeorge/pvs_new_website/blob/main/index.html): `index.html`
- [Lead Handler](https://github.com/pbgeorge/pvs_new_website/blob/main/submit.php): `submit.php`
- [Lead Configuration](https://github.com/pbgeorge/pvs_new_website/blob/main/db_config.php): `db_config.php`

### Food Log Pages

- [Sign In And Recovery](https://github.com/pbgeorge/pvs_new_website/blob/main/food/login.php): `food/login.php`
- [Nutrition Dashboard](https://github.com/pbgeorge/pvs_new_website/blob/main/food/index.php): `food/index.php`
- [Meal Diary](https://github.com/pbgeorge/pvs_new_website/blob/main/food/diary.php): `food/diary.php`
- [Meal Entry](https://github.com/pbgeorge/pvs_new_website/blob/main/food/meal.php): `food/meal.php`
- [Activity Entry](https://github.com/pbgeorge/pvs_new_website/blob/main/food/activity.php): `food/activity.php`
- [Entry Choice](https://github.com/pbgeorge/pvs_new_website/blob/main/food/add.php): `food/add.php`
- [Export Options](https://github.com/pbgeorge/pvs_new_website/blob/main/food/exports.php): `food/exports.php`
- [Spreadsheet Export](https://github.com/pbgeorge/pvs_new_website/blob/main/food/export.php): `food/export.php`
- [Printable Diary](https://github.com/pbgeorge/pvs_new_website/blob/main/food/print.php): `food/print.php`
- [Account Settings](https://github.com/pbgeorge/pvs_new_website/blob/main/food/password.php): `food/password.php`

### Food Log Core

- [Auth And Diary Helpers](https://github.com/pbgeorge/pvs_new_website/blob/main/food/bootstrap.php): `food/bootstrap.php`
- [Food Configuration](https://github.com/pbgeorge/pvs_new_website/blob/main/food/config.php): `food/config.php`
- [Shared Page Header](https://github.com/pbgeorge/pvs_new_website/blob/main/food/header.php): `food/header.php`
- [Shared Page Footer](https://github.com/pbgeorge/pvs_new_website/blob/main/food/footer.php): `food/footer.php`
- [SMTP Mailer](https://github.com/pbgeorge/pvs_new_website/blob/main/food/mailer.php): `food/mailer.php`

### Data And Services

- **Food Log Database**
- **Leads Database**
- **SMTP Service**
- **Nutrition Estimation API**

### Other components

- **Site Visitor**
- **Food Log User**

## Connections

- Site Visitor → Contact Form: submits enquiry
- Contact Form → Lead Handler: posts form
- Site Visitor → Lead Handler: sends request
- Lead Handler → Lead Configuration: loads settings (evidence: `submit.php`)
- Lead Handler → Leads Database: stores enquiry (evidence: `submit.php`)
- Lead Handler → SMTP Service: sends notification (evidence: `submit.php`)
- Food Log User → Sign In And Recovery: signs in
- Food Log User → Nutrition Dashboard: views summary
- Food Log User → Meal Diary: reviews entries
- Food Log User → Entry Choice: starts entry
- Food Log User → Export Options: chooses export
- Nutrition Dashboard → Auth And Diary Helpers: loads summaries (evidence: `food/index.php`)
- Meal Diary → Auth And Diary Helpers: builds diary view (evidence: `food/diary.php`)
- Meal Diary → Meal Entry: links meal edits (evidence: `food/diary.php`)
- Meal Diary → Activity Entry: links activity edits (evidence: `food/diary.php`)
- Entry Choice → Meal Entry: routes meal entry
- Entry Choice → Activity Entry: routes activity entry
- Meal Entry → Auth And Diary Helpers: uses helpers (evidence: `food/meal.php`)
- Meal Entry → Nutrition Estimation API: requests estimates (evidence: `food/meal.php`)
- Activity Entry → Auth And Diary Helpers: uses helpers (evidence: `food/activity.php`)
- Export Options → Spreadsheet Export: fetches rows (evidence: `food/exports.php`)
- Export Options → Printable Diary: opens print view (evidence: `food/exports.php`)
- Spreadsheet Export → Auth And Diary Helpers: uses helpers (evidence: `food/export.php`)
- Printable Diary → Auth And Diary Helpers: builds export view (evidence: `food/print.php`)
- Sign In And Recovery → Auth And Diary Helpers: uses auth helpers (evidence: `food/login.php`)
- Sign In And Recovery → SMTP Mailer: sends recovery mail
- SMTP Mailer → SMTP Service: sends email
- Account Settings → Auth And Diary Helpers: uses helpers
- Auth And Diary Helpers → Food Configuration: loads settings (evidence: `food/bootstrap.php`)
- Auth And Diary Helpers → Food Log Database: connects and initializes (evidence: `food/bootstrap.php`)
- Nutrition Dashboard → Shared Page Header: renders header (evidence: `food/index.php`)
- Meal Diary → Shared Page Header: renders header (evidence: `food/diary.php`)
- Activity Entry → Shared Page Header: renders header (evidence: `food/activity.php`)
- Printable Diary → Shared Page Header: renders header (evidence: `food/print.php`)
- Meal Diary → Shared Page Footer: renders footer (evidence: `food/diary.php`)
- Activity Entry → Shared Page Footer: renders footer (evidence: `food/activity.php`)
- Printable Diary → Shared Page Footer: renders footer (evidence: `food/print.php`)
