# romarllegomartin-code/ed_realty architecture

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

- Interactive diagram: https://gitdiagram.com/romarllegomartin-code/ed_realty
- Repository: https://github.com/romarllegomartin-code/ed_realty

## Overview

ED Realty is a PHP/MySQL real-estate sales website with a guest model-catalog and inquiry flow, plus Super Admin workflows for inquiry processing, payments, contracts, reporting, model management, audit history, and backups. The principal path is customer inquiry → admin processing → payment record → contract/receipt documents. Edges reflect shown calls and README-documented capabilities; unsampled endpoint behavior is represented only where documented, and evidence is limited to excerpts and the README.

Main entry points: [`admin.php`](https://github.com/romarllegomartin-code/ed_realty/blob/main/admin.php) (Admin portal), [`includes/db.php`](https://github.com/romarllegomartin-code/ed_realty/blob/main/includes/db.php) (Business records), [`process.php`](https://github.com/romarllegomartin-code/ed_realty/blob/main/process.php) (Client processing), [`includes/functions.php`](https://github.com/romarllegomartin-code/ed_realty/blob/main/includes/functions.php) (Data and audit helpers)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_public["Guest Website"]
  node_site["Model catalog<br/>[index.php]"]
  node_inquiry["Inquiry intake<br/>[inquiry.php]"]
  node_inquiry_route["Inquiry page<br/>[index.php]"]
end

subgraph group_sales["Sales Operations"]
  node_walkin["Walk-in intake<br/>[walkin.php]"]
  node_processing["Client processing<br/>[process.php]"]
  node_payment_rules["Payment calculations<br/>[payments.php]"]
  node_contract["Contract generation<br/>[contract.php]"]
  node_pdf_engine["PDF writer<br/>[pdf.php]"]
  node_documents["Inquiry documents<br/>[documents.php]"]
end

subgraph group_admin["Administration"]
  node_admin_portal["Admin portal<br/>[admin.php]"]
  node_print["Print reports<br/>[print.php]"]
  node_saved_files["Saved PDFs<br/>[save_pdf.php]"]
  node_model_admin["Model management<br/>[update_model.php]"]
  node_backup["Database backup<br/>[backup.php]"]
end

subgraph group_platform["Shared Runtime"]
  node_data_access["Data and audit helpers<br/>[functions.php]"]
  node_database[("Business records<br/>[db.php]")]
  node_config["Runtime configuration<br/>[config.php]"]
  node_schema["Database schema<br/>[ed_realty.sql]"]
end

node_visitor(("Home buyer"))
node_admin_user(("Super Admin"))

node_visitor -->|"browses"| node_site
node_site -->|"submits inquiry"| node_inquiry_route
node_inquiry_route -->|"validates and saves"| node_inquiry
node_inquiry -->|"stores inquiry"| node_database
node_admin_user -->|"signs in"| node_admin_portal
node_admin_portal -->|"opens client"| node_processing
node_admin_portal -->|"starts walk-in"| node_walkin
node_walkin -->|"uses intake"| node_inquiry
node_processing -->|"validates payment"| node_payment_rules
node_processing -->|"records payment"| node_database
node_processing -.->|"creates contract"| node_contract
node_contract -->|"renders PDF"| node_pdf_engine
node_contract -->|"uses payment terms"| node_payment_rules
node_admin_portal -->|"opens reports"| node_print
node_print -->|"queries inquiries"| node_data_access
node_admin_portal -.->|"manages saved PDFs"| node_saved_files
node_saved_files -->|"builds PDFs"| node_documents
node_documents -->|"renders PDF"| node_pdf_engine
node_admin_portal -->|"manages models"| node_model_admin
node_admin_portal -->|"downloads backup"| node_backup
node_backup -->|"checks access"| node_data_access
node_data_access -->|"queries records"| node_database
node_data_access -->|"loads settings"| node_config
node_database -.->|"reads connection settings"| node_config
node_database -->|"installs schema"| node_schema

click node_site "https://github.com/romarllegomartin-code/ed_realty/blob/main/index.php"
click node_inquiry "https://github.com/romarllegomartin-code/ed_realty/blob/main/includes/inquiry.php"
click node_inquiry_route "https://github.com/romarllegomartin-code/ed_realty/blob/main/index.php"
click node_walkin "https://github.com/romarllegomartin-code/ed_realty/blob/main/walkin.php"
click node_admin_portal "https://github.com/romarllegomartin-code/ed_realty/blob/main/admin.php"
click node_processing "https://github.com/romarllegomartin-code/ed_realty/blob/main/process.php"
click node_payment_rules "https://github.com/romarllegomartin-code/ed_realty/blob/main/includes/payments.php"
click node_contract "https://github.com/romarllegomartin-code/ed_realty/blob/main/includes/contract.php"
click node_pdf_engine "https://github.com/romarllegomartin-code/ed_realty/blob/main/includes/pdf.php"
click node_documents "https://github.com/romarllegomartin-code/ed_realty/blob/main/includes/documents.php"
click node_print "https://github.com/romarllegomartin-code/ed_realty/blob/main/print.php"
click node_saved_files "https://github.com/romarllegomartin-code/ed_realty/blob/main/save_pdf.php"
click node_model_admin "https://github.com/romarllegomartin-code/ed_realty/blob/main/update_model.php"
click node_backup "https://github.com/romarllegomartin-code/ed_realty/blob/main/backup.php"
click node_data_access "https://github.com/romarllegomartin-code/ed_realty/blob/main/includes/functions.php"
click node_database "https://github.com/romarllegomartin-code/ed_realty/blob/main/includes/db.php"
click node_config "https://github.com/romarllegomartin-code/ed_realty/blob/main/includes/config.php"
click node_schema "https://github.com/romarllegomartin-code/ed_realty/blob/main/database/ed_realty.sql"

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_site,node_inquiry,node_inquiry_route toneBlue
class node_walkin,node_processing,node_payment_rules,node_contract,node_pdf_engine,node_documents toneAmber
class node_admin_portal,node_print,node_saved_files,node_model_admin,node_backup toneMint
class node_data_access,node_database,node_config,node_schema toneRose
class node_visitor,node_admin_user toneIndigo
```

## Components

### Guest Website

- [Model catalog](https://github.com/romarllegomartin-code/ed_realty/blob/main/index.php): `index.php`
- [Inquiry intake](https://github.com/romarllegomartin-code/ed_realty/blob/main/includes/inquiry.php): `includes/inquiry.php`
- [Inquiry page](https://github.com/romarllegomartin-code/ed_realty/blob/main/index.php): `index.php`

### Sales Operations

- [Walk-in intake](https://github.com/romarllegomartin-code/ed_realty/blob/main/walkin.php): `walkin.php`
- [Client processing](https://github.com/romarllegomartin-code/ed_realty/blob/main/process.php): `process.php`
- [Payment calculations](https://github.com/romarllegomartin-code/ed_realty/blob/main/includes/payments.php): `includes/payments.php`
- [Contract generation](https://github.com/romarllegomartin-code/ed_realty/blob/main/includes/contract.php): `includes/contract.php`
- [PDF writer](https://github.com/romarllegomartin-code/ed_realty/blob/main/includes/pdf.php): `includes/pdf.php`
- [Inquiry documents](https://github.com/romarllegomartin-code/ed_realty/blob/main/includes/documents.php): `includes/documents.php`

### Administration

- [Admin portal](https://github.com/romarllegomartin-code/ed_realty/blob/main/admin.php): `admin.php`
- [Print reports](https://github.com/romarllegomartin-code/ed_realty/blob/main/print.php): `print.php`
- [Saved PDFs](https://github.com/romarllegomartin-code/ed_realty/blob/main/save_pdf.php): `save_pdf.php`
- [Model management](https://github.com/romarllegomartin-code/ed_realty/blob/main/update_model.php): `update_model.php`
- [Database backup](https://github.com/romarllegomartin-code/ed_realty/blob/main/backup.php): `backup.php`

### Shared Runtime

- [Data and audit helpers](https://github.com/romarllegomartin-code/ed_realty/blob/main/includes/functions.php): `includes/functions.php`
- [Business records](https://github.com/romarllegomartin-code/ed_realty/blob/main/includes/db.php): `includes/db.php`
- [Runtime configuration](https://github.com/romarllegomartin-code/ed_realty/blob/main/includes/config.php): `includes/config.php`
- [Database schema](https://github.com/romarllegomartin-code/ed_realty/blob/main/database/ed_realty.sql): `database/ed_realty.sql`

### Other components

- **Home buyer**
- **Super Admin**

## Connections

- Home buyer → Model catalog: browses (evidence: `README.txt`)
- Model catalog → Inquiry page: submits inquiry (evidence: `index.php`)
- Inquiry page → Inquiry intake: validates and saves (evidence: `index.php`)
- Inquiry intake → Business records: stores inquiry (evidence: `includes/inquiry.php`)
- Super Admin → Admin portal: signs in (evidence: `admin.php`)
- Admin portal → Client processing: opens client (evidence: `README.txt`)
- Admin portal → Walk-in intake: starts walk-in (evidence: `README.txt`)
- Walk-in intake → Inquiry intake: uses intake (evidence: `includes/inquiry.php`)
- Client processing → Payment calculations: validates payment (evidence: `process.php`)
- Client processing → Business records: records payment (evidence: `process.php`)
- Client processing → Contract generation: creates contract
- Contract generation → PDF writer: renders PDF (evidence: `includes/contract.php`)
- Contract generation → Payment calculations: uses payment terms (evidence: `includes/contract.php`)
- Admin portal → Print reports: opens reports (evidence: `README.txt`)
- Print reports → Data and audit helpers: queries inquiries (evidence: `print.php`)
- Admin portal → Saved PDFs: manages saved PDFs
- Saved PDFs → Inquiry documents: builds PDFs (evidence: `save_pdf.php`)
- Inquiry documents → PDF writer: renders PDF (evidence: `includes/documents.php`)
- Admin portal → Model management: manages models (evidence: `README.txt`)
- Admin portal → Database backup: downloads backup (evidence: `README.txt`)
- Database backup → Data and audit helpers: checks access (evidence: `backup.php`)
- Data and audit helpers → Business records: queries records (evidence: `includes/functions.php`)
- Data and audit helpers → Runtime configuration: loads settings (evidence: `includes/functions.php`)
- Business records → Runtime configuration: reads connection settings
- Business records → Database schema: installs schema (evidence: `includes/db.php`)
