# etewiah/property_web_builder architecture

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

- Interactive diagram: https://gitdiagram.com/etewiah/property_web_builder
- Repository: https://github.com/etewiah/property_web_builder

## Overview

PropertyWebBuilder is a multi-tenant SaaS for creating and operating real-estate websites. The principal workflow is: a visitor arrives on a tenant domain, tenant resolution scopes the website, pages and listings are rendered, and search returns filtered property results. Site administrators then manage content, themes, listings, media, and reports; tenant administrators provision websites and subscriptions. The tree and README establish these capabilities, while sampled source most directly confirms routing, tenant isolation, page-part behavior, AI services, and ActiveStorage operations.

Main entry points: [`app/models/pwb/realty_asset.rb`](https://github.com/etewiah/property_web_builder/blob/master/app/models/pwb/realty_asset.rb) (Property Listings), [`app/controllers/pwb/pages_controller.rb`](https://github.com/etewiah/property_web_builder/blob/master/app/controllers/pwb/pages_controller.rb) (Public Websites), [`app/controllers/pwb/search_controller.rb`](https://github.com/etewiah/property_web_builder/blob/master/app/controllers/pwb/search_controller.rb) (Property Search), [`app/services/pwb/page_part_manager.rb`](https://github.com/etewiah/property_web_builder/blob/master/app/services/pwb/page_part_manager.rb) (Page Rendering)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_public["Public Experience"]
  node_public_web["Public Websites"]
  node_property_search["Property Search"]
  node_public_api["Public API"]
end

subgraph group_content["Content Management"]
  node_page_rendering["Page Rendering"]
  node_theme_system["Themes And Palettes<br/>[theme.rb]"]
  node_content_admin["Content Editor"]
  node_site_admin["Site Administration"]
end

subgraph group_property["Property Operations"]
  node_property_domain["Property Listings<br/>[realty_asset.rb]"]
  node_faceted_search["Faceted Search"]
  node_property_admin["Listing Administration"]
  node_imports_feeds["Imports And Feeds"]
end

subgraph group_platform["Platform Administration"]
  node_tenant_resolution["Tenant Resolution"]
  node_tenant_admin["Tenant Administration"]
  node_provisioning["Website Provisioning"]
  node_subscriptions["Subscriptions"]
  node_authentication["Authentication"]
end

subgraph group_integrations["Integrations"]
  node_widget_delivery["Embeddable Widgets"]
  node_ai_content["AI Content Generation"]
  node_cma_reports["CMA Reports<br/>[cma_generator.rb]"]
  node_analytics["Tenant Analytics"]
  node_active_storage[("ActiveStorage Data")]
  node_storage_monitoring["Storage Monitoring"]
  node_cleanup_job["Blob Cleanup"]
end

node_visitor(("Visitor"))
node_site_admin_actor(("Site Admin"))
node_tenant_admin_actor(("Tenant Admin"))
node_external_site(("External Website"))
node_ai_provider(("AI Provider"))
node_object_storage[("Object Storage")]

node_visitor -->|"browses site"| node_public_web
node_public_web -->|"resolves tenant"| node_tenant_resolution
node_tenant_resolution -->|"scopes listings"| node_property_domain
node_public_web -->|"renders pages"| node_page_rendering
node_page_rendering -->|"loads theme"| node_theme_system
node_page_rendering -->|"returns page"| node_visitor
node_visitor -->|"searches listings"| node_property_search
node_property_search -->|"builds facets"| node_faceted_search
node_property_search -->|"reads listings"| node_property_domain
node_property_search -->|"returns results"| node_visitor
node_visitor -->|"requests data"| node_public_api
node_public_api -->|"reads properties"| node_property_domain
node_site_admin_actor -->|"opens admin"| node_site_admin
node_site_admin -->|"manages content"| node_content_admin
node_content_admin -->|"updates page parts"| node_page_rendering
node_site_admin_actor -->|"manages listings"| node_property_admin
node_property_admin -->|"updates listings"| node_property_domain
node_property_admin -->|"imports properties"| node_imports_feeds
node_tenant_admin_actor -->|"manages tenants"| node_tenant_admin
node_tenant_admin -->|"provisions websites"| node_provisioning
node_tenant_admin -->|"manages subscriptions"| node_subscriptions
node_public_web -.->|"authenticates users"| node_authentication
node_external_site -->|"embeds listings"| node_widget_delivery
node_widget_delivery -->|"reads listings"| node_property_domain
node_site_admin_actor -.->|"requests copy"| node_ai_content
node_ai_content -.->|"generates content"| node_ai_provider
node_site_admin_actor -->|"requests report"| node_cma_reports
node_cma_reports -->|"finds comparables"| node_property_domain
node_public_web -.->|"tracks activity"| node_analytics
node_site_admin_actor -->|"checks storage"| node_storage_monitoring
node_storage_monitoring -->|"reads statistics"| node_active_storage
node_storage_monitoring -->|"queues cleanup"| node_cleanup_job
node_active_storage -->|"stores blobs"| node_object_storage

click node_public_web "https://github.com/etewiah/property_web_builder/blob/master/app/controllers/pwb/pages_controller.rb"
click node_property_search "https://github.com/etewiah/property_web_builder/blob/master/app/controllers/pwb/search_controller.rb"
click node_public_api "https://github.com/etewiah/property_web_builder/blob/master/app/controllers/api_public/v1/properties_controller.rb"
click node_tenant_resolution "https://github.com/etewiah/property_web_builder/blob/master/app/controllers/concerns/subdomain_tenant.rb"
click node_page_rendering "https://github.com/etewiah/property_web_builder/blob/master/app/services/pwb/page_part_manager.rb"
click node_theme_system "https://github.com/etewiah/property_web_builder/blob/master/app/models/pwb/theme.rb"
click node_content_admin "https://github.com/etewiah/property_web_builder/blob/master/app/controllers/site_admin/pages_controller.rb"
click node_site_admin "https://github.com/etewiah/property_web_builder/blob/master/app/controllers/site_admin_controller.rb"
click node_property_domain "https://github.com/etewiah/property_web_builder/blob/master/app/models/pwb/realty_asset.rb"
click node_faceted_search "https://github.com/etewiah/property_web_builder/blob/master/app/services/pwb/search_facets_service.rb"
click node_property_admin "https://github.com/etewiah/property_web_builder/blob/master/app/controllers/site_admin/props_controller.rb"
click node_imports_feeds "https://github.com/etewiah/property_web_builder/blob/master/app/services/pwb/property_bulk_import_service.rb"
click node_tenant_admin "https://github.com/etewiah/property_web_builder/blob/master/app/controllers/tenant_admin_controller.rb"
click node_provisioning "https://github.com/etewiah/property_web_builder/blob/master/app/services/pwb/provisioning_service.rb"
click node_subscriptions "https://github.com/etewiah/property_web_builder/blob/master/app/services/pwb/subscription_service.rb"
click node_authentication "https://github.com/etewiah/property_web_builder/blob/master/app/services/pwb/firebase_auth_service.rb"
click node_widget_delivery "https://github.com/etewiah/property_web_builder/blob/master/app/controllers/widgets_controller.rb"
click node_ai_content "https://github.com/etewiah/property_web_builder/blob/master/app/services/ai/listing_description_generator.rb"
click node_cma_reports "https://github.com/etewiah/property_web_builder/blob/master/app/services/reports/cma_generator.rb"
click node_analytics "https://github.com/etewiah/property_web_builder/blob/master/app/services/pwb/analytics_service.rb"
click node_active_storage "https://github.com/etewiah/property_web_builder/blob/master/db/migrate/20251129181658_create_active_storage_tables.active_storage.rb"
click node_storage_monitoring "https://github.com/etewiah/property_web_builder/blob/master/app/controllers/site_admin/storage_stats_controller.rb"
click node_cleanup_job "https://github.com/etewiah/property_web_builder/blob/master/app/jobs/cleanup_orphaned_blobs_job.rb"

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_web,node_property_search,node_public_api toneBlue
class node_page_rendering,node_theme_system,node_content_admin,node_site_admin,node_object_storage toneAmber
class node_property_domain,node_faceted_search,node_property_admin,node_imports_feeds toneMint
class node_tenant_resolution,node_tenant_admin,node_provisioning,node_subscriptions,node_authentication toneRose
class node_widget_delivery,node_ai_content,node_cma_reports,node_analytics,node_active_storage,node_storage_monitoring,node_cleanup_job,node_visitor,node_site_admin_actor,node_tenant_admin_actor,node_external_site,node_ai_provider toneIndigo
```

## Components

### Public Experience

- [Public Websites](https://github.com/etewiah/property_web_builder/blob/master/app/controllers/pwb/pages_controller.rb): `app/controllers/pwb/pages_controller.rb`
- [Property Search](https://github.com/etewiah/property_web_builder/blob/master/app/controllers/pwb/search_controller.rb): `app/controllers/pwb/search_controller.rb`
- [Public API](https://github.com/etewiah/property_web_builder/blob/master/app/controllers/api_public/v1/properties_controller.rb): `app/controllers/api_public/v1/properties_controller.rb`

### Content Management

- [Page Rendering](https://github.com/etewiah/property_web_builder/blob/master/app/services/pwb/page_part_manager.rb): `app/services/pwb/page_part_manager.rb`
- [Themes And Palettes](https://github.com/etewiah/property_web_builder/blob/master/app/models/pwb/theme.rb): `app/models/pwb/theme.rb`
- [Content Editor](https://github.com/etewiah/property_web_builder/blob/master/app/controllers/site_admin/pages_controller.rb): `app/controllers/site_admin/pages_controller.rb`
- [Site Administration](https://github.com/etewiah/property_web_builder/blob/master/app/controllers/site_admin_controller.rb): `app/controllers/site_admin_controller.rb`

### Property Operations

- [Property Listings](https://github.com/etewiah/property_web_builder/blob/master/app/models/pwb/realty_asset.rb): `app/models/pwb/realty_asset.rb`
- [Faceted Search](https://github.com/etewiah/property_web_builder/blob/master/app/services/pwb/search_facets_service.rb): `app/services/pwb/search_facets_service.rb`
- [Listing Administration](https://github.com/etewiah/property_web_builder/blob/master/app/controllers/site_admin/props_controller.rb): `app/controllers/site_admin/props_controller.rb`
- [Imports And Feeds](https://github.com/etewiah/property_web_builder/blob/master/app/services/pwb/property_bulk_import_service.rb): `app/services/pwb/property_bulk_import_service.rb`

### Platform Administration

- [Tenant Resolution](https://github.com/etewiah/property_web_builder/blob/master/app/controllers/concerns/subdomain_tenant.rb): `app/controllers/concerns/subdomain_tenant.rb`
- [Tenant Administration](https://github.com/etewiah/property_web_builder/blob/master/app/controllers/tenant_admin_controller.rb): `app/controllers/tenant_admin_controller.rb`
- [Website Provisioning](https://github.com/etewiah/property_web_builder/blob/master/app/services/pwb/provisioning_service.rb): `app/services/pwb/provisioning_service.rb`
- [Subscriptions](https://github.com/etewiah/property_web_builder/blob/master/app/services/pwb/subscription_service.rb): `app/services/pwb/subscription_service.rb`
- [Authentication](https://github.com/etewiah/property_web_builder/blob/master/app/services/pwb/firebase_auth_service.rb): `app/services/pwb/firebase_auth_service.rb`

### Integrations

- [Embeddable Widgets](https://github.com/etewiah/property_web_builder/blob/master/app/controllers/widgets_controller.rb): `app/controllers/widgets_controller.rb`
- [AI Content Generation](https://github.com/etewiah/property_web_builder/blob/master/app/services/ai/listing_description_generator.rb): `app/services/ai/listing_description_generator.rb`
- [CMA Reports](https://github.com/etewiah/property_web_builder/blob/master/app/services/reports/cma_generator.rb): `app/services/reports/cma_generator.rb`
- [Tenant Analytics](https://github.com/etewiah/property_web_builder/blob/master/app/services/pwb/analytics_service.rb): `app/services/pwb/analytics_service.rb`
- [ActiveStorage Data](https://github.com/etewiah/property_web_builder/blob/master/db/migrate/20251129181658_create_active_storage_tables.active_storage.rb): `db/migrate/20251129181658_create_active_storage_tables.active_storage.rb`
- [Storage Monitoring](https://github.com/etewiah/property_web_builder/blob/master/app/controllers/site_admin/storage_stats_controller.rb): `app/controllers/site_admin/storage_stats_controller.rb`
- [Blob Cleanup](https://github.com/etewiah/property_web_builder/blob/master/app/jobs/cleanup_orphaned_blobs_job.rb): `app/jobs/cleanup_orphaned_blobs_job.rb`

### Other components

- **Visitor**
- **Site Admin**
- **Tenant Admin**
- **External Website**
- **AI Provider**
- **Object Storage**

## Connections

- Visitor → Public Websites: browses site
- Public Websites → Tenant Resolution: resolves tenant
- Tenant Resolution → Property Listings: scopes listings
- Public Websites → Page Rendering: renders pages
- Page Rendering → Themes And Palettes: loads theme
- Page Rendering → Visitor: returns page
- Visitor → Property Search: searches listings
- Property Search → Faceted Search: builds facets
- Property Search → Property Listings: reads listings
- Property Search → Visitor: returns results
- Visitor → Public API: requests data
- Public API → Property Listings: reads properties
- Site Admin → Site Administration: opens admin
- Site Administration → Content Editor: manages content
- Content Editor → Page Rendering: updates page parts
- Site Admin → Listing Administration: manages listings
- Listing Administration → Property Listings: updates listings
- Listing Administration → Imports And Feeds: imports properties
- Tenant Admin → Tenant Administration: manages tenants
- Tenant Administration → Website Provisioning: provisions websites
- Tenant Administration → Subscriptions: manages subscriptions
- Public Websites → Authentication: authenticates users
- External Website → Embeddable Widgets: embeds listings
- Embeddable Widgets → Property Listings: reads listings
- Site Admin → AI Content Generation: requests copy
- AI Content Generation → AI Provider: generates content
- Site Admin → CMA Reports: requests report
- CMA Reports → Property Listings: finds comparables
- Public Websites → Tenant Analytics: tracks activity
- Site Admin → Storage Monitoring: checks storage
- Storage Monitoring → ActiveStorage Data: reads statistics
- Storage Monitoring → Blob Cleanup: queues cleanup
- ActiveStorage Data → Object Storage: stores blobs
