# kellybytes/property-pulse architecture

> Architecture diagram of the GitHub repository kellybytes/property-pulse, 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/kellybytes/property-pulse
- Repository: https://github.com/kellybytes/property-pulse

## Overview

Property Pulse is a Next.js real-estate marketplace. Users authenticate, browse or search listings, view a property, bookmark it, and send an inquiry; owners create and manage listings and handle incoming messages. The graph preserves the documented media, mapping, pagination, and unread-message capabilities. Relationships are based on excerpts, SOURCE INDEX references, or README statements; some documented integrations are shown as unverified where implementation wiring was not sampled.

Main entry points: [`app/properties/[id]/page.jsx`](https://github.com/kellybytes/property-pulse/blob/main/app/properties/%5Bid%5D/page.jsx) (Property detail), [`config/database.js`](https://github.com/kellybytes/property-pulse/blob/main/config/database.js) (MongoDB connection), [`app/properties/page.jsx`](https://github.com/kellybytes/property-pulse/blob/main/app/properties/page.jsx) (Listing browse), [`utils/authOptions.js`](https://github.com/kellybytes/property-pulse/blob/main/utils/authOptions.js) (Auth configuration)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_identity["Identity"]
  node_auth["Auth configuration<br/>[authOptions.js]"]
  node_authroute["Auth route<br/>[route.js]"]
  node_session["Session lookup<br/>[getSessionUser.js]"]
  node_middleware["Route protection<br/>[middleware.js]"]
end

subgraph group_discovery["Listing discovery"]
  node_home["Home page<br/>[page.jsx]"]
  node_searchform["Search form"]
  node_searchresults["Search results<br/>[page.jsx]"]
  node_listingbrowse["Listing browse<br/>[page.jsx]"]
  node_detail["Property detail<br/>[page.jsx]"]
  node_listingui["Listing cards and views<br/>[PropertyCard.jsx]"]
  node_bookmark["Bookmarks<br/>[BookmarkButton.jsx]"]
end

subgraph group_management["Listing management"]
  node_listingforms["Listing forms"]
  node_listingactions["Listing actions"]
  node_profile["Owner profile<br/>[page.jsx]"]
end

subgraph group_messaging["Messaging"]
  node_messageform["Inquiry form"]
  node_messageactions["Message actions"]
  node_messagespage["Owner inbox<br/>[page.jsx]"]
  node_messagecard["Message controls<br/>[MessageCard.jsx]"]
  node_messagecount["Unread count state<br/>[GlobalContext.js]"]
end

subgraph group_data["Data and integrations"]
  node_propertymodel[("Property model<br/>[Property.js]")]
  node_usermodel[("User model<br/>[User.js]")]
  node_messagemodel[("Message model<br/>[Message.js]")]
  node_database["MongoDB connection<br/>[database.js]"]
  node_cloudinary{{"Cloudinary media<br/>[cloudinary.js]"}}
  node_map["Map and geocoding<br/>[PropertyMap.jsx]"]
  node_serializer["Document serialization<br/>[convertToObject.js]"]
end

node_user(("User"))
node_google{{"Google OAuth"}}

node_user -->|"signs in"| node_authroute
node_authroute -->|"uses options"| node_auth
node_auth -->|"authenticates with"| node_google
node_auth -->|"connects to"| node_database
node_auth -->|"finds or creates"| node_usermodel
node_session -->|"reads session"| node_auth
node_user -->|"visits"| node_home
node_home -->|"offers listings"| node_listingbrowse
node_home -->|"offers search"| node_searchform
node_searchform -->|"routes query"| node_searchresults
node_searchresults -->|"connects to"| node_database
node_searchresults -->|"queries listings"| node_propertymodel
node_listingbrowse -->|"connects to"| node_database
node_listingbrowse -->|"queries listings"| node_propertymodel
node_listingbrowse -->|"renders cards"| node_listingui
node_searchresults -->|"renders cards"| node_listingui
node_listingui -.->|"opens listing"| node_detail
node_detail -->|"connects to"| node_database
node_detail -->|"loads listing"| node_propertymodel
node_detail -->|"renders control"| node_bookmark
node_detail -->|"renders inquiry"| node_messageform
node_detail -.->|"shows location"| node_map
node_user -->|"submits listing"| node_listingforms
node_listingforms -->|"calls add action"| node_listingactions
node_listingactions -->|"connects to"| node_database
node_listingactions -->|"creates or updates"| node_propertymodel
node_listingactions -.->|"uploads images"| node_cloudinary
node_profile -->|"gets user"| node_session
node_profile -->|"connects to"| node_database
node_profile -->|"loads owner listings"| node_propertymodel
node_profile -->|"renders listings"| node_listingui
node_messageform -->|"calls add action"| node_messageactions
node_messageactions -.->|"stores inquiry"| node_messagemodel
node_messagespage -->|"connects to"| node_database
node_messagespage -->|"loads inbox"| node_messagemodel
node_messagespage -->|"renders messages"| node_messagecard
node_messagecard -->|"marks or deletes"| node_messageactions
node_messagecount -->|"fetches unread count"| node_messageactions
node_messageactions -.->|"updates messages"| node_messagemodel
node_listingbrowse -.->|"serializes results"| node_serializer
node_detail -->|"serializes listing"| node_serializer

click node_auth "https://github.com/kellybytes/property-pulse/blob/main/utils/authOptions.js"
click node_authroute "https://github.com/kellybytes/property-pulse/blob/main/app/api/auth/%5B...nextauth%5D/route.js"
click node_session "https://github.com/kellybytes/property-pulse/blob/main/utils/getSessionUser.js"
click node_middleware "https://github.com/kellybytes/property-pulse/blob/main/middleware.js"
click node_home "https://github.com/kellybytes/property-pulse/blob/main/app/page.jsx"
click node_searchform "https://github.com/kellybytes/property-pulse/blob/main/components/PropertySearchForm.jsx"
click node_searchresults "https://github.com/kellybytes/property-pulse/blob/main/app/properties/search-results/page.jsx"
click node_listingbrowse "https://github.com/kellybytes/property-pulse/blob/main/app/properties/page.jsx"
click node_detail "https://github.com/kellybytes/property-pulse/blob/main/app/properties/%5Bid%5D/page.jsx"
click node_listingui "https://github.com/kellybytes/property-pulse/blob/main/components/PropertyCard.jsx"
click node_bookmark "https://github.com/kellybytes/property-pulse/blob/main/components/BookmarkButton.jsx"
click node_listingforms "https://github.com/kellybytes/property-pulse/blob/main/components/PropertyAddForm.jsx"
click node_listingactions "https://github.com/kellybytes/property-pulse/tree/main/app/actions"
click node_profile "https://github.com/kellybytes/property-pulse/blob/main/app/profile/page.jsx"
click node_propertymodel "https://github.com/kellybytes/property-pulse/blob/main/models/Property.js"
click node_usermodel "https://github.com/kellybytes/property-pulse/blob/main/models/User.js"
click node_messageform "https://github.com/kellybytes/property-pulse/blob/main/components/PropertyContactForm.jsx"
click node_messageactions "https://github.com/kellybytes/property-pulse/tree/main/app/actions"
click node_messagespage "https://github.com/kellybytes/property-pulse/blob/main/app/messages/page.jsx"
click node_messagecard "https://github.com/kellybytes/property-pulse/blob/main/components/MessageCard.jsx"
click node_messagecount "https://github.com/kellybytes/property-pulse/blob/main/context/GlobalContext.js"
click node_messagemodel "https://github.com/kellybytes/property-pulse/blob/main/models/Message.js"
click node_database "https://github.com/kellybytes/property-pulse/blob/main/config/database.js"
click node_cloudinary "https://github.com/kellybytes/property-pulse/blob/main/config/cloudinary.js"
click node_map "https://github.com/kellybytes/property-pulse/blob/main/components/PropertyMap.jsx"
click node_serializer "https://github.com/kellybytes/property-pulse/blob/main/utils/convertToObject.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_auth,node_authroute,node_session,node_middleware,node_user toneBlue
class node_home,node_searchform,node_searchresults,node_listingbrowse,node_detail,node_listingui,node_bookmark toneAmber
class node_listingforms,node_listingactions,node_profile toneMint
class node_messageform,node_messageactions,node_messagespage,node_messagecard,node_messagecount toneRose
class node_propertymodel,node_usermodel,node_messagemodel,node_database,node_cloudinary,node_map,node_serializer,node_google toneIndigo
```

## Components

### Identity

- [Auth configuration](https://github.com/kellybytes/property-pulse/blob/main/utils/authOptions.js): `utils/authOptions.js`
- [Auth route](https://github.com/kellybytes/property-pulse/blob/main/app/api/auth/%5B...nextauth%5D/route.js): `app/api/auth/[...nextauth]/route.js`
- [Session lookup](https://github.com/kellybytes/property-pulse/blob/main/utils/getSessionUser.js): `utils/getSessionUser.js`
- [Route protection](https://github.com/kellybytes/property-pulse/blob/main/middleware.js): `middleware.js`

### Listing discovery

- [Home page](https://github.com/kellybytes/property-pulse/blob/main/app/page.jsx): `app/page.jsx`
- [Search form](https://github.com/kellybytes/property-pulse/blob/main/components/PropertySearchForm.jsx): `components/PropertySearchForm.jsx`
- [Search results](https://github.com/kellybytes/property-pulse/blob/main/app/properties/search-results/page.jsx): `app/properties/search-results/page.jsx`
- [Listing browse](https://github.com/kellybytes/property-pulse/blob/main/app/properties/page.jsx): `app/properties/page.jsx`
- [Property detail](https://github.com/kellybytes/property-pulse/blob/main/app/properties/%5Bid%5D/page.jsx): `app/properties/[id]/page.jsx`
- [Listing cards and views](https://github.com/kellybytes/property-pulse/blob/main/components/PropertyCard.jsx): `components/PropertyCard.jsx`
- [Bookmarks](https://github.com/kellybytes/property-pulse/blob/main/components/BookmarkButton.jsx): `components/BookmarkButton.jsx`

### Listing management

- [Listing forms](https://github.com/kellybytes/property-pulse/blob/main/components/PropertyAddForm.jsx): `components/PropertyAddForm.jsx`
- [Listing actions](https://github.com/kellybytes/property-pulse/tree/main/app/actions): `app/actions`
- [Owner profile](https://github.com/kellybytes/property-pulse/blob/main/app/profile/page.jsx): `app/profile/page.jsx`

### Messaging

- [Inquiry form](https://github.com/kellybytes/property-pulse/blob/main/components/PropertyContactForm.jsx): `components/PropertyContactForm.jsx`
- [Message actions](https://github.com/kellybytes/property-pulse/tree/main/app/actions): `app/actions`
- [Owner inbox](https://github.com/kellybytes/property-pulse/blob/main/app/messages/page.jsx): `app/messages/page.jsx`
- [Message controls](https://github.com/kellybytes/property-pulse/blob/main/components/MessageCard.jsx): `components/MessageCard.jsx`
- [Unread count state](https://github.com/kellybytes/property-pulse/blob/main/context/GlobalContext.js): `context/GlobalContext.js`

### Data and integrations

- [Property model](https://github.com/kellybytes/property-pulse/blob/main/models/Property.js): `models/Property.js`
- [User model](https://github.com/kellybytes/property-pulse/blob/main/models/User.js): `models/User.js`
- [Message model](https://github.com/kellybytes/property-pulse/blob/main/models/Message.js): `models/Message.js`
- [MongoDB connection](https://github.com/kellybytes/property-pulse/blob/main/config/database.js): `config/database.js`
- [Cloudinary media](https://github.com/kellybytes/property-pulse/blob/main/config/cloudinary.js): `config/cloudinary.js`
- [Map and geocoding](https://github.com/kellybytes/property-pulse/blob/main/components/PropertyMap.jsx): `components/PropertyMap.jsx`
- [Document serialization](https://github.com/kellybytes/property-pulse/blob/main/utils/convertToObject.js): `utils/convertToObject.js`

### Other components

- **User**
- **Google OAuth**

## Connections

- User → Auth route: signs in
- Auth route → Auth configuration: uses options (evidence: `app/api/auth/[...nextauth]/route.js`)
- Auth configuration → Google OAuth: authenticates with (evidence: `utils/authOptions.js`)
- Auth configuration → MongoDB connection: connects to (evidence: `utils/authOptions.js`)
- Auth configuration → User model: finds or creates (evidence: `utils/authOptions.js`)
- Session lookup → Auth configuration: reads session (evidence: `utils/getSessionUser.js`)
- User → Home page: visits
- Home page → Listing browse: offers listings (evidence: `app/page.jsx`)
- Home page → Search form: offers search (evidence: `app/page.jsx`)
- Search form → Search results: routes query (evidence: `components/PropertySearchForm.jsx`)
- Search results → MongoDB connection: connects to (evidence: `app/properties/search-results/page.jsx`)
- Search results → Property model: queries listings (evidence: `app/properties/search-results/page.jsx`)
- Listing browse → MongoDB connection: connects to (evidence: `app/properties/page.jsx`)
- Listing browse → Property model: queries listings (evidence: `app/properties/page.jsx`)
- Listing browse → Listing cards and views: renders cards (evidence: `app/properties/page.jsx`)
- Search results → Listing cards and views: renders cards (evidence: `app/properties/search-results/page.jsx`)
- Listing cards and views → Property detail: opens listing
- Property detail → MongoDB connection: connects to (evidence: `app/properties/[id]/page.jsx`)
- Property detail → Property model: loads listing (evidence: `app/properties/[id]/page.jsx`)
- Property detail → Bookmarks: renders control (evidence: `app/properties/[id]/page.jsx`)
- Property detail → Inquiry form: renders inquiry (evidence: `app/properties/[id]/page.jsx`)
- Property detail → Map and geocoding: shows location
- User → Listing forms: submits listing
- Listing forms → Listing actions: calls add action (evidence: `components/PropertyAddForm.jsx`)
- Listing actions → MongoDB connection: connects to (evidence: `app/actions/addProperty.js`)
- Listing actions → Property model: creates or updates (evidence: `app/actions/addProperty.js`)
- Listing actions → Cloudinary media: uploads images (evidence: `app/actions/addProperty.js`)
- Owner profile → Session lookup: gets user (evidence: `app/profile/page.jsx`)
- Owner profile → MongoDB connection: connects to (evidence: `app/profile/page.jsx`)
- Owner profile → Property model: loads owner listings (evidence: `app/profile/page.jsx`)
- Owner profile → Listing cards and views: renders listings (evidence: `app/profile/page.jsx`)
- Inquiry form → Message actions: calls add action (evidence: `components/PropertyContactForm.jsx`)
- Message actions → Message model: stores inquiry (evidence: `app/actions/getUnreadMessageCount.js`)
- Owner inbox → MongoDB connection: connects to (evidence: `app/messages/page.jsx`)
- Owner inbox → Message model: loads inbox (evidence: `app/messages/page.jsx`)
- Owner inbox → Message controls: renders messages (evidence: `app/messages/page.jsx`)
- Message controls → Message actions: marks or deletes (evidence: `components/MessageCard.jsx`)
- Unread count state → Message actions: fetches unread count (evidence: `context/GlobalContext.js`)
- Message actions → Message model: updates messages (evidence: `app/actions/getUnreadMessageCount.js`)
- Listing browse → Document serialization: serializes results
- Property detail → Document serialization: serializes listing (evidence: `app/properties/[id]/page.jsx`)
