# aman-pannu/property-consultant-nextjs architecture

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

- Interactive diagram: https://gitdiagram.com/aman-pannu/property-consultant-nextjs
- Repository: https://github.com/aman-pannu/property-consultant-nextjs

## Overview

This is a Next.js property-consultant website with a public marketing and listings experience, suburb landing pages, lead capture, and a CRM-lite admin dashboard. A visitor can browse the site, submit a contact lead, and have it validated, stored, and optionally emailed; staff can search, stage, and export leads. Listings are selected through a provider-switching CMS layer, while services come from Supabase. The README also documents a weekly email digest and several CMS integrations. Relationships below follow excerpts and README statements; unsampled route or provider internals are not inferred.

Main entry points: [`app/page.jsx`](https://github.com/aman-pannu/property-consultant-nextjs/blob/main/app/page.jsx) (Home page), [`lib/cms/index.js`](https://github.com/aman-pannu/property-consultant-nextjs/blob/main/lib/cms/index.js) (Listings provider), [`lib/supabase.js`](https://github.com/aman-pannu/property-consultant-nextjs/blob/main/lib/supabase.js) (Supabase client), [`components/AdminTable.jsx`](https://github.com/aman-pannu/property-consultant-nextjs/blob/main/components/AdminTable.jsx) (Lead table)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_public["Public experience"]
  node_homepage["Home page<br/>[page.jsx]"]
  node_navbar["Navigation<br/>[Navbar.jsx]"]
  node_hero["Hero<br/>[Hero.jsx]"]
  node_metrics["Metrics<br/>[Metrics.jsx]"]
  node_services_view["Services section<br/>[Services.jsx]"]
  node_listings_view["Listings section<br/>[Listings.jsx]"]
  node_listing_modal["Listing details"]
  node_testimonials["Testimonials<br/>[Testimonials.jsx]"]
  node_about["About section<br/>[About.jsx]"]
  node_process["Process section<br/>[Process.jsx]"]
  node_contact["Contact form<br/>[Contact.jsx]"]
  node_footer["Footer<br/>[Footer.jsx]"]
  node_suburb_page["Suburb pages<br/>[page.jsx]"]
  node_sitemap["Sitemap<br/>[sitemap.js]"]
end

subgraph group_leads["Lead management"]
  node_admin["Admin dashboard<br/>[page.jsx]"]
  node_admin_table["Lead table<br/>[AdminTable.jsx]"]
  node_lead_capture["Lead capture API<br/>[route.js]"]
  node_lead_api["Lead list API<br/>[route.js]"]
  node_lead_update["Lead update API<br/>[route.js]"]
  node_lead_export["CSV export API<br/>[route.js]"]
  node_digest["Weekly digest<br/>[route.js]"]
  node_middleware["Basic Auth<br/>[middleware.js]"]
end

subgraph group_content["Content delivery"]
  node_cms_router["Listings provider<br/>[index.js]"]
  node_airtable["Airtable adapter<br/>[airtable.js]"]
  node_notion["Notion adapter<br/>[notion.js]"]
  node_sanity["Sanity adapter<br/>[sanity.js]"]
  node_supabase_cms["Supabase listings<br/>[supabase.js]"]
  node_listing_data["Local listings<br/>[listings.json]"]
  node_suburb_data["Suburb data<br/>[suburbs.json]"]
end

subgraph group_integrations["Data and integrations"]
  node_services_data["Services query<br/>[services.js]"]
  node_supabase_client["Supabase client<br/>[supabase.js]"]
  node_lead_store[("Supabase database")]
  node_email["Email sender<br/>[email.js]"]
end

node_visitor(("Site visitor"))

node_visitor -->|"browses"| node_homepage
node_homepage -->|"renders"| node_navbar
node_homepage -->|"renders"| node_hero
node_homepage -->|"renders"| node_metrics
node_homepage -->|"renders"| node_services_view
node_homepage -->|"renders"| node_listings_view
node_homepage -->|"renders"| node_testimonials
node_homepage -->|"renders"| node_about
node_homepage -->|"renders"| node_process
node_homepage -->|"renders"| node_contact
node_homepage -->|"renders"| node_footer
node_visitor -->|"submits inquiry"| node_contact
node_contact -.->|"posts lead"| node_lead_capture
node_listings_view -->|"loads listings"| node_cms_router
node_listings_view -->|"opens details"| node_listing_modal
node_cms_router -->|"dispatches"| node_airtable
node_cms_router -->|"dispatches"| node_notion
node_cms_router -->|"dispatches"| node_sanity
node_cms_router -->|"dispatches"| node_supabase_cms
node_cms_router -->|"reads local JSON"| node_listing_data
node_suburb_page -->|"loads listings"| node_cms_router
node_suburb_page -->|"loads suburbs"| node_cms_router
node_cms_router -->|"reads suburbs"| node_suburb_data
node_sitemap -->|"loads suburbs"| node_cms_router
node_services_view -->|"requests services"| node_services_data
node_services_data -->|"queries services"| node_supabase_client
node_admin -->|"renders"| node_admin_table
node_admin_table -->|"fetches leads"| node_lead_api
node_admin_table -->|"updates stage"| node_lead_update
node_admin_table -->|"downloads CSV"| node_lead_export
node_admin -->|"protected by"| node_middleware
node_lead_capture -->|"reads and writes"| node_supabase_client
node_lead_capture -->|"sends alert"| node_email
node_lead_api -->|"queries leads"| node_supabase_client
node_lead_update -->|"updates lead"| node_supabase_client
node_lead_export -->|"queries leads"| node_supabase_client
node_digest -->|"queries recent leads"| node_supabase_client
node_digest -->|"sends digest"| node_email
node_supabase_client -->|"accesses data"| node_lead_store
node_supabase_cms -->|"uses client"| node_supabase_client
node_email -.->|"notifies staff"| node_visitor

click node_homepage "https://github.com/aman-pannu/property-consultant-nextjs/blob/main/app/page.jsx"
click node_navbar "https://github.com/aman-pannu/property-consultant-nextjs/blob/main/components/Navbar.jsx"
click node_hero "https://github.com/aman-pannu/property-consultant-nextjs/blob/main/components/Hero.jsx"
click node_metrics "https://github.com/aman-pannu/property-consultant-nextjs/blob/main/components/Metrics.jsx"
click node_services_view "https://github.com/aman-pannu/property-consultant-nextjs/blob/main/components/Services.jsx"
click node_listings_view "https://github.com/aman-pannu/property-consultant-nextjs/blob/main/components/Listings.jsx"
click node_listing_modal "https://github.com/aman-pannu/property-consultant-nextjs/blob/main/components/ListingDetailsModal.jsx"
click node_testimonials "https://github.com/aman-pannu/property-consultant-nextjs/blob/main/components/Testimonials.jsx"
click node_about "https://github.com/aman-pannu/property-consultant-nextjs/blob/main/components/About.jsx"
click node_process "https://github.com/aman-pannu/property-consultant-nextjs/blob/main/components/Process.jsx"
click node_contact "https://github.com/aman-pannu/property-consultant-nextjs/blob/main/components/Contact.jsx"
click node_footer "https://github.com/aman-pannu/property-consultant-nextjs/blob/main/components/Footer.jsx"
click node_suburb_page "https://github.com/aman-pannu/property-consultant-nextjs/blob/main/app/suburbs/%5Bslug%5D/page.jsx"
click node_sitemap "https://github.com/aman-pannu/property-consultant-nextjs/blob/main/app/sitemap.js"
click node_admin "https://github.com/aman-pannu/property-consultant-nextjs/blob/main/app/admin/page.jsx"
click node_admin_table "https://github.com/aman-pannu/property-consultant-nextjs/blob/main/components/AdminTable.jsx"
click node_lead_capture "https://github.com/aman-pannu/property-consultant-nextjs/blob/main/app/api/lead/route.js"
click node_lead_api "https://github.com/aman-pannu/property-consultant-nextjs/blob/main/app/api/leads/route.js"
click node_lead_update "https://github.com/aman-pannu/property-consultant-nextjs/blob/main/app/api/leads/%5Bid%5D/route.js"
click node_lead_export "https://github.com/aman-pannu/property-consultant-nextjs/blob/main/app/api/leads/export/route.js"
click node_digest "https://github.com/aman-pannu/property-consultant-nextjs/blob/main/app/api/cron/digest/route.js"
click node_middleware "https://github.com/aman-pannu/property-consultant-nextjs/blob/main/middleware.js"
click node_cms_router "https://github.com/aman-pannu/property-consultant-nextjs/blob/main/lib/cms/index.js"
click node_airtable "https://github.com/aman-pannu/property-consultant-nextjs/blob/main/lib/cms/airtable.js"
click node_notion "https://github.com/aman-pannu/property-consultant-nextjs/blob/main/lib/cms/notion.js"
click node_sanity "https://github.com/aman-pannu/property-consultant-nextjs/blob/main/lib/cms/sanity.js"
click node_supabase_cms "https://github.com/aman-pannu/property-consultant-nextjs/blob/main/lib/cms/supabase.js"
click node_listing_data "https://github.com/aman-pannu/property-consultant-nextjs/blob/main/content/listings.json"
click node_suburb_data "https://github.com/aman-pannu/property-consultant-nextjs/blob/main/content/suburbs.json"
click node_services_data "https://github.com/aman-pannu/property-consultant-nextjs/blob/main/lib/services.js"
click node_supabase_client "https://github.com/aman-pannu/property-consultant-nextjs/blob/main/lib/supabase.js"
click node_email "https://github.com/aman-pannu/property-consultant-nextjs/blob/main/lib/email.js"

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_homepage,node_navbar,node_hero,node_metrics,node_services_view,node_listings_view,node_listing_modal,node_testimonials,node_about,node_process,node_contact,node_footer,node_suburb_page,node_sitemap toneBlue
class node_admin,node_admin_table,node_lead_capture,node_lead_api,node_lead_update,node_lead_export,node_digest,node_middleware toneAmber
class node_cms_router,node_airtable,node_notion,node_sanity,node_supabase_cms,node_listing_data,node_suburb_data toneMint
class node_services_data,node_supabase_client,node_lead_store,node_email toneRose
class node_visitor toneIndigo
```

## Components

### Public experience

- [Home page](https://github.com/aman-pannu/property-consultant-nextjs/blob/main/app/page.jsx): `app/page.jsx`
- [Navigation](https://github.com/aman-pannu/property-consultant-nextjs/blob/main/components/Navbar.jsx): `components/Navbar.jsx`
- [Hero](https://github.com/aman-pannu/property-consultant-nextjs/blob/main/components/Hero.jsx): `components/Hero.jsx`
- [Metrics](https://github.com/aman-pannu/property-consultant-nextjs/blob/main/components/Metrics.jsx): `components/Metrics.jsx`
- [Services section](https://github.com/aman-pannu/property-consultant-nextjs/blob/main/components/Services.jsx): `components/Services.jsx`
- [Listings section](https://github.com/aman-pannu/property-consultant-nextjs/blob/main/components/Listings.jsx): `components/Listings.jsx`
- [Listing details](https://github.com/aman-pannu/property-consultant-nextjs/blob/main/components/ListingDetailsModal.jsx): `components/ListingDetailsModal.jsx`
- [Testimonials](https://github.com/aman-pannu/property-consultant-nextjs/blob/main/components/Testimonials.jsx): `components/Testimonials.jsx`
- [About section](https://github.com/aman-pannu/property-consultant-nextjs/blob/main/components/About.jsx): `components/About.jsx`
- [Process section](https://github.com/aman-pannu/property-consultant-nextjs/blob/main/components/Process.jsx): `components/Process.jsx`
- [Contact form](https://github.com/aman-pannu/property-consultant-nextjs/blob/main/components/Contact.jsx): `components/Contact.jsx`
- [Footer](https://github.com/aman-pannu/property-consultant-nextjs/blob/main/components/Footer.jsx): `components/Footer.jsx`
- [Suburb pages](https://github.com/aman-pannu/property-consultant-nextjs/blob/main/app/suburbs/%5Bslug%5D/page.jsx): `app/suburbs/[slug]/page.jsx`
- [Sitemap](https://github.com/aman-pannu/property-consultant-nextjs/blob/main/app/sitemap.js): `app/sitemap.js`

### Lead management

- [Admin dashboard](https://github.com/aman-pannu/property-consultant-nextjs/blob/main/app/admin/page.jsx): `app/admin/page.jsx`
- [Lead table](https://github.com/aman-pannu/property-consultant-nextjs/blob/main/components/AdminTable.jsx): `components/AdminTable.jsx`
- [Lead capture API](https://github.com/aman-pannu/property-consultant-nextjs/blob/main/app/api/lead/route.js): `app/api/lead/route.js`
- [Lead list API](https://github.com/aman-pannu/property-consultant-nextjs/blob/main/app/api/leads/route.js): `app/api/leads/route.js`
- [Lead update API](https://github.com/aman-pannu/property-consultant-nextjs/blob/main/app/api/leads/%5Bid%5D/route.js): `app/api/leads/[id]/route.js`
- [CSV export API](https://github.com/aman-pannu/property-consultant-nextjs/blob/main/app/api/leads/export/route.js): `app/api/leads/export/route.js`
- [Weekly digest](https://github.com/aman-pannu/property-consultant-nextjs/blob/main/app/api/cron/digest/route.js): `app/api/cron/digest/route.js`
- [Basic Auth](https://github.com/aman-pannu/property-consultant-nextjs/blob/main/middleware.js): `middleware.js`

### Content delivery

- [Listings provider](https://github.com/aman-pannu/property-consultant-nextjs/blob/main/lib/cms/index.js): `lib/cms/index.js`
- [Airtable adapter](https://github.com/aman-pannu/property-consultant-nextjs/blob/main/lib/cms/airtable.js): `lib/cms/airtable.js`
- [Notion adapter](https://github.com/aman-pannu/property-consultant-nextjs/blob/main/lib/cms/notion.js): `lib/cms/notion.js`
- [Sanity adapter](https://github.com/aman-pannu/property-consultant-nextjs/blob/main/lib/cms/sanity.js): `lib/cms/sanity.js`
- [Supabase listings](https://github.com/aman-pannu/property-consultant-nextjs/blob/main/lib/cms/supabase.js): `lib/cms/supabase.js`
- [Local listings](https://github.com/aman-pannu/property-consultant-nextjs/blob/main/content/listings.json): `content/listings.json`
- [Suburb data](https://github.com/aman-pannu/property-consultant-nextjs/blob/main/content/suburbs.json): `content/suburbs.json`

### Data and integrations

- [Services query](https://github.com/aman-pannu/property-consultant-nextjs/blob/main/lib/services.js): `lib/services.js`
- [Supabase client](https://github.com/aman-pannu/property-consultant-nextjs/blob/main/lib/supabase.js): `lib/supabase.js`
- **Supabase database**
- [Email sender](https://github.com/aman-pannu/property-consultant-nextjs/blob/main/lib/email.js): `lib/email.js`

### Other components

- **Site visitor**

## Connections

- Site visitor → Home page: browses (evidence: `README.md`)
- Home page → Navigation: renders (evidence: `app/page.jsx`)
- Home page → Hero: renders (evidence: `app/page.jsx`)
- Home page → Metrics: renders (evidence: `app/page.jsx`)
- Home page → Services section: renders (evidence: `app/page.jsx`)
- Home page → Listings section: renders (evidence: `app/page.jsx`)
- Home page → Testimonials: renders (evidence: `app/page.jsx`)
- Home page → About section: renders (evidence: `app/page.jsx`)
- Home page → Process section: renders (evidence: `app/page.jsx`)
- Home page → Contact form: renders (evidence: `app/page.jsx`)
- Home page → Footer: renders (evidence: `app/page.jsx`)
- Site visitor → Contact form: submits inquiry (evidence: `README.md`)
- Contact form → Lead capture API: posts lead
- Listings section → Listings provider: loads listings (evidence: `components/Listings.jsx`)
- Listings section → Listing details: opens details (evidence: `components/Listings.jsx`)
- Listings provider → Airtable adapter: dispatches (evidence: `lib/cms/index.js`)
- Listings provider → Notion adapter: dispatches (evidence: `lib/cms/index.js`)
- Listings provider → Sanity adapter: dispatches (evidence: `lib/cms/index.js`)
- Listings provider → Supabase listings: dispatches (evidence: `lib/cms/index.js`)
- Listings provider → Local listings: reads local JSON (evidence: `lib/cms/index.js`)
- Suburb pages → Listings provider: loads listings (evidence: `app/suburbs/[slug]/page.jsx`)
- Suburb pages → Listings provider: loads suburbs (evidence: `app/suburbs/[slug]/page.jsx`)
- Listings provider → Suburb data: reads suburbs (evidence: `lib/cms/index.js`)
- Sitemap → Listings provider: loads suburbs (evidence: `app/sitemap.js`)
- Services section → Services query: requests services (evidence: `components/Services.jsx`)
- Services query → Supabase client: queries services (evidence: `lib/services.js`)
- Admin dashboard → Lead table: renders (evidence: `app/admin/page.jsx`)
- Lead table → Lead list API: fetches leads (evidence: `components/AdminTable.jsx`)
- Lead table → Lead update API: updates stage (evidence: `components/AdminTable.jsx`)
- Lead table → CSV export API: downloads CSV (evidence: `components/AdminTable.jsx`)
- Admin dashboard → Basic Auth: protected by (evidence: `README.md`)
- Lead capture API → Supabase client: reads and writes (evidence: `app/api/lead/route.js`)
- Lead capture API → Email sender: sends alert (evidence: `app/api/lead/route.js`)
- Lead list API → Supabase client: queries leads (evidence: `app/api/leads/route.js`)
- Lead update API → Supabase client: updates lead (evidence: `app/api/leads/[id]/route.js`)
- CSV export API → Supabase client: queries leads (evidence: `app/api/leads/export/route.js`)
- Weekly digest → Supabase client: queries recent leads (evidence: `app/api/cron/digest/route.js`)
- Weekly digest → Email sender: sends digest (evidence: `app/api/cron/digest/route.js`)
- Supabase client → Supabase database: accesses data (evidence: `lib/supabase.js`)
- Supabase listings → Supabase client: uses client (evidence: `lib/cms/supabase.js`)
- Email sender → Site visitor: notifies staff
