# ganeshreddy333/realestatemain architecture

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

- Interactive diagram: https://gitdiagram.com/ganeshreddy333/realestatemain
- Repository: https://github.com/ganeshreddy333/realestatemain

## Overview

NEXSTRUCT is a construction-services website with an enquiry flow and an authenticated lead workspace. Visitors browse the public site, submit project details, and can choose to continue through WhatsApp; the PHP API validates and stores enquiries in MySQL. Administrators sign in to search and filter leads, update statuses and notes, and export CSV. A substantial Java entry point also implements an alternate HTTP server and file-backed enquiry storage. Source excerpts establish the key PHP and Java relationships; unsampled page markup and schema details are represented only where documented.

Main entry points: [`public/api/index.php`](https://github.com/ganeshreddy333/realestatemain/blob/main/public/api/index.php) (PHP API routes), [`public/script.js`](https://github.com/ganeshreddy333/realestatemain/blob/main/public/script.js) (Site interactions), [`public/index.html`](https://github.com/ganeshreddy333/realestatemain/blob/main/public/index.html) (Public page), [`public/admin.js`](https://github.com/ganeshreddy333/realestatemain/blob/main/public/admin.js) (Admin dashboard)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_public_site["Public website"]
  node_public_page["Public page<br/>[index.html]"]
  node_site_behavior["Site interactions<br/>[script.js]"]
  node_admin_ui["Admin dashboard<br/>[admin.js]"]
end

subgraph group_php_runtime["PHP application"]
  node_api["PHP API routes<br/>[index.php]"]
  node_php_core["PHP services<br/>[bootstrap.php]"]
  node_configuration["App configuration<br/>[config.example.php]"]
end

subgraph group_lead_data["Lead data"]
  node_mysql[("MySQL enquiries<br/>[schema.sql]")]
end

subgraph group_java_runtime["Java alternative"]
  node_java_server["Java HTTP server"]
  node_java_store[("File-backed leads")]
end

node_visitor(("Visitor"))
node_whatsapp["WhatsApp"]

node_visitor -->|"browses"| node_public_page
node_public_page -->|"uses interactions"| node_site_behavior
node_site_behavior -->|"requests settings"| node_api
node_site_behavior -->|"submits enquiry"| node_api
node_site_behavior -->|"opens enquiry"| node_whatsapp
node_visitor -->|"manages leads"| node_admin_ui
node_admin_ui -->|"calls admin routes"| node_api
node_api -->|"uses services"| node_php_core
node_php_core -->|"loads settings"| node_configuration
node_api -->|"reads and writes"| node_mysql
node_java_server -->|"reads and writes"| node_java_store

click node_public_page "https://github.com/ganeshreddy333/realestatemain/blob/main/public/index.html"
click node_site_behavior "https://github.com/ganeshreddy333/realestatemain/blob/main/public/script.js"
click node_admin_ui "https://github.com/ganeshreddy333/realestatemain/blob/main/public/admin.js"
click node_api "https://github.com/ganeshreddy333/realestatemain/blob/main/public/api/index.php"
click node_php_core "https://github.com/ganeshreddy333/realestatemain/blob/main/app/bootstrap.php"
click node_configuration "https://github.com/ganeshreddy333/realestatemain/blob/main/app/config.example.php"
click node_mysql "https://github.com/ganeshreddy333/realestatemain/blob/main/database/schema.sql"
click node_java_server "https://github.com/ganeshreddy333/realestatemain/blob/main/src/main/java/com/nexstruct/NexstructApplication.java"
click node_java_store "https://github.com/ganeshreddy333/realestatemain/blob/main/src/main/java/com/nexstruct/NexstructApplication.java"

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_public_page,node_site_behavior,node_admin_ui toneBlue
class node_api,node_php_core,node_configuration toneAmber
class node_mysql toneMint
class node_java_server,node_java_store toneRose
class node_visitor,node_whatsapp toneIndigo
```

## Components

### Public website

- [Public page](https://github.com/ganeshreddy333/realestatemain/blob/main/public/index.html): `public/index.html`
- [Site interactions](https://github.com/ganeshreddy333/realestatemain/blob/main/public/script.js): `public/script.js`
- [Admin dashboard](https://github.com/ganeshreddy333/realestatemain/blob/main/public/admin.js): `public/admin.js`

### PHP application

- [PHP API routes](https://github.com/ganeshreddy333/realestatemain/blob/main/public/api/index.php): `public/api/index.php`
- [PHP services](https://github.com/ganeshreddy333/realestatemain/blob/main/app/bootstrap.php): `app/bootstrap.php`
- [App configuration](https://github.com/ganeshreddy333/realestatemain/blob/main/app/config.example.php): `app/config.example.php`

### Lead data

- [MySQL enquiries](https://github.com/ganeshreddy333/realestatemain/blob/main/database/schema.sql): `database/schema.sql`

### Java alternative

- [Java HTTP server](https://github.com/ganeshreddy333/realestatemain/blob/main/src/main/java/com/nexstruct/NexstructApplication.java): `src/main/java/com/nexstruct/NexstructApplication.java`
- [File-backed leads](https://github.com/ganeshreddy333/realestatemain/blob/main/src/main/java/com/nexstruct/NexstructApplication.java): `src/main/java/com/nexstruct/NexstructApplication.java`

### Other components

- **Visitor**
- **WhatsApp**

## Connections

- Visitor → Public page: browses (evidence: `README.md`)
- Public page → Site interactions: uses interactions (evidence: `README.md`)
- Site interactions → PHP API routes: requests settings (evidence: `public/script.js`)
- Site interactions → PHP API routes: submits enquiry (evidence: `public/script.js`)
- Site interactions → WhatsApp: opens enquiry (evidence: `public/script.js`)
- Visitor → Admin dashboard: manages leads (evidence: `README.md`)
- Admin dashboard → PHP API routes: calls admin routes (evidence: `public/admin.js`)
- PHP API routes → PHP services: uses services (evidence: `public/api/index.php`)
- PHP services → App configuration: loads settings (evidence: `app/bootstrap.php`)
- PHP API routes → MySQL enquiries: reads and writes (evidence: `public/api/index.php`)
- Java HTTP server → File-backed leads: reads and writes (evidence: `src/main/java/com/nexstruct/NexstructApplication.java`)
