# belal-i/smartestate architecture

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

- Interactive diagram: https://gitdiagram.com/belal-i/smartestate
- Repository: https://github.com/belal-i/smartestate

## Overview

SmartEstate is a Django real-estate broker website and management backend. Visitors browse and filter rental or sale listings; brokers manage listings and prospective clients, then track possible matches. The graph separates property and client records, public browsing, broker workflows, site configuration/pages, and the REST API. The README documents these major capabilities; some subsystem internals are unsampled, so only documented or indexed relationships are shown. Static JavaScript behavior is represented narrowly because its templates and runtime wiring were not provided.

Main entry points: [`smartestate/views.py`](https://github.com/belal-i/smartestate/blob/develop/smartestate/views.py) (Site views), [`listings/views.py`](https://github.com/belal-i/smartestate/blob/develop/listings/views.py) (Listing views), [`rest/views.py`](https://github.com/belal-i/smartestate/blob/develop/rest/views.py) (API endpoints), [`smartestate/urls.py`](https://github.com/belal-i/smartestate/blob/develop/smartestate/urls.py) (Django routes)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_entry["Web entry"]
  node_django_routes["Django routes<br/>[urls.py]"]
  node_site_views["Site views<br/>[views.py]"]
  node_project_settings["Project settings<br/>[settings.py]"]
end

subgraph group_property["Property listings"]
  node_listing_views["Listing views<br/>[views.py]"]
  node_listing_search["Listing search<br/>[utils.py]"]
  node_listing_records[("Property records<br/>[models.py]")]
  node_listing_helpers["Listing helpers<br/>[functions.py]"]
end

subgraph group_broker["Broker management"]
  node_broker_views["Broker views<br/>[views.py]"]
  node_broker_forms["Broker forms<br/>[forms.py]"]
  node_broker_records[("Client and match records<br/>[models.py]")]
end

subgraph group_site["Site experience"]
  node_site_config[("Site configuration<br/>[models.py]")]
  node_custom_pages[("Custom pages<br/>[models.py]")]
  node_cookie_ui["Cookie and theme UI<br/>[main.js]"]
  node_cookie_library["Cookie library<br/>[js.cookie.mjs]"]
end

subgraph group_api["REST API"]
  node_rest_routes["API routes<br/>[urls.py]"]
  node_rest_views["API endpoints<br/>[views.py]"]
  node_rest_serializers["API serializers<br/>[serializers.py]"]
end

node_visitor(("Website visitor"))
node_broker_user(("Broker user"))
node_database[("Configured database")]

node_visitor -->|"requests pages"| node_django_routes
node_broker_user -->|"uses backend"| node_django_routes
node_django_routes -->|"routes requests"| node_site_views
node_django_routes -->|"routes listings"| node_listing_views
node_listing_views -->|"queries listings"| node_listing_records
node_listing_views -->|"filters listings"| node_listing_search
node_listing_views -->|"validates search"| node_listing_helpers
node_broker_views -->|"uses forms"| node_broker_forms
node_broker_views -->|"queries records"| node_broker_records
node_broker_views -->|"queries listings"| node_listing_records
node_site_views -->|"reads configuration"| node_site_config
node_site_views -->|"uses settings"| node_project_settings
node_listing_views -->|"uses language settings"| node_project_settings
node_django_routes -.->|"serves API"| node_rest_routes
node_rest_routes -->|"routes endpoints"| node_rest_views
node_rest_views -->|"filters listings"| node_listing_search
node_rest_views -->|"serializes results"| node_rest_serializers
node_rest_views -->|"reads listings"| node_listing_records
node_rest_views -->|"reads and saves"| node_broker_records
node_project_settings -->|"configures connection"| node_database
node_cookie_ui -->|"uses cookies"| node_cookie_library
node_visitor -.->|"interacts with site"| node_cookie_ui
node_site_views -->|"renders pages"| node_custom_pages
node_site_views -.->|"serves site assets"| node_cookie_ui

click node_django_routes "https://github.com/belal-i/smartestate/blob/develop/smartestate/urls.py"
click node_site_views "https://github.com/belal-i/smartestate/blob/develop/smartestate/views.py"
click node_listing_views "https://github.com/belal-i/smartestate/blob/develop/listings/views.py"
click node_listing_search "https://github.com/belal-i/smartestate/blob/develop/broker/utils.py"
click node_listing_records "https://github.com/belal-i/smartestate/blob/develop/listings/models.py"
click node_listing_helpers "https://github.com/belal-i/smartestate/blob/develop/listings/functions.py"
click node_broker_views "https://github.com/belal-i/smartestate/blob/develop/broker/views.py"
click node_broker_forms "https://github.com/belal-i/smartestate/blob/develop/broker/forms.py"
click node_broker_records "https://github.com/belal-i/smartestate/blob/develop/broker/models.py"
click node_site_config "https://github.com/belal-i/smartestate/blob/develop/config/models.py"
click node_custom_pages "https://github.com/belal-i/smartestate/blob/develop/pages/models.py"
click node_rest_routes "https://github.com/belal-i/smartestate/blob/develop/rest/urls.py"
click node_rest_views "https://github.com/belal-i/smartestate/blob/develop/rest/views.py"
click node_rest_serializers "https://github.com/belal-i/smartestate/blob/develop/rest/serializers.py"
click node_project_settings "https://github.com/belal-i/smartestate/blob/develop/smartestate/settings.py"
click node_cookie_ui "https://github.com/belal-i/smartestate/blob/develop/static/js/main.js"
click node_cookie_library "https://github.com/belal-i/smartestate/blob/develop/static/js/js.cookie.mjs"

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_django_routes,node_site_views,node_project_settings,node_broker_user toneBlue
class node_listing_views,node_listing_search,node_listing_records,node_listing_helpers,node_database toneAmber
class node_broker_views,node_broker_forms,node_broker_records toneMint
class node_site_config,node_custom_pages,node_cookie_ui,node_cookie_library toneRose
class node_rest_routes,node_rest_views,node_rest_serializers,node_visitor toneIndigo
```

## Components

### Web entry

- [Django routes](https://github.com/belal-i/smartestate/blob/develop/smartestate/urls.py): `smartestate/urls.py`
- [Site views](https://github.com/belal-i/smartestate/blob/develop/smartestate/views.py): `smartestate/views.py`
- [Project settings](https://github.com/belal-i/smartestate/blob/develop/smartestate/settings.py): `smartestate/settings.py`

### Property listings

- [Listing views](https://github.com/belal-i/smartestate/blob/develop/listings/views.py): `listings/views.py`
- [Listing search](https://github.com/belal-i/smartestate/blob/develop/broker/utils.py): `broker/utils.py`
- [Property records](https://github.com/belal-i/smartestate/blob/develop/listings/models.py): `listings/models.py`
- [Listing helpers](https://github.com/belal-i/smartestate/blob/develop/listings/functions.py): `listings/functions.py`

### Broker management

- [Broker views](https://github.com/belal-i/smartestate/blob/develop/broker/views.py): `broker/views.py`
- [Broker forms](https://github.com/belal-i/smartestate/blob/develop/broker/forms.py): `broker/forms.py`
- [Client and match records](https://github.com/belal-i/smartestate/blob/develop/broker/models.py): `broker/models.py`

### Site experience

- [Site configuration](https://github.com/belal-i/smartestate/blob/develop/config/models.py): `config/models.py`
- [Custom pages](https://github.com/belal-i/smartestate/blob/develop/pages/models.py): `pages/models.py`
- [Cookie and theme UI](https://github.com/belal-i/smartestate/blob/develop/static/js/main.js): `static/js/main.js`
- [Cookie library](https://github.com/belal-i/smartestate/blob/develop/static/js/js.cookie.mjs): `static/js/js.cookie.mjs`

### REST API

- [API routes](https://github.com/belal-i/smartestate/blob/develop/rest/urls.py): `rest/urls.py`
- [API endpoints](https://github.com/belal-i/smartestate/blob/develop/rest/views.py): `rest/views.py`
- [API serializers](https://github.com/belal-i/smartestate/blob/develop/rest/serializers.py): `rest/serializers.py`

### Other components

- **Website visitor**
- **Broker user**
- **Configured database**

## Connections

- Website visitor → Django routes: requests pages (evidence: `README.md`)
- Broker user → Django routes: uses backend (evidence: `README.md`)
- Django routes → Site views: routes requests (evidence: `smartestate/urls.py`)
- Django routes → Listing views: routes listings (evidence: `smartestate/urls.py`)
- Listing views → Property records: queries listings (evidence: `listings/views.py`)
- Listing views → Listing search: filters listings (evidence: `listings/views.py`)
- Listing views → Listing helpers: validates search (evidence: `listings/views.py`)
- Broker views → Broker forms: uses forms (evidence: `broker/views.py`)
- Broker views → Client and match records: queries records (evidence: `broker/views.py`)
- Broker views → Property records: queries listings (evidence: `broker/views.py`)
- Site views → Site configuration: reads configuration (evidence: `smartestate/views.py`)
- Site views → Project settings: uses settings (evidence: `smartestate/views.py`)
- Listing views → Project settings: uses language settings (evidence: `listings/views.py`)
- Django routes → API routes: serves API
- API routes → API endpoints: routes endpoints (evidence: `rest/urls.py`)
- API endpoints → Listing search: filters listings (evidence: `rest/views.py`)
- API endpoints → API serializers: serializes results (evidence: `rest/views.py`)
- API endpoints → Property records: reads listings (evidence: `rest/views.py`)
- API endpoints → Client and match records: reads and saves (evidence: `rest/views.py`)
- Project settings → Configured database: configures connection (evidence: `smartestate/settings.py`)
- Cookie and theme UI → Cookie library: uses cookies (evidence: `static/js/main.js`)
- Website visitor → Cookie and theme UI: interacts with site
- Site views → Custom pages: renders pages
- Site views → Cookie and theme UI: serves site assets
