# steinovehelset/djangobnb architecture

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

- Interactive diagram: https://gitdiagram.com/steinovehelset/djangobnb
- Repository: https://github.com/steinovehelset/djangobnb

## Overview

Djangobnb is a Next.js frontend for a Django-backed short-term rental marketplace. Visitors browse and filter properties, view landlord and property details, and can sign in to favorite listings, manage reservations or properties, and contact hosts through inbox conversations. The frontend centralizes authenticated API access and cookie-based session handling. The README also documents image uploads and live chat; the chat UI is present, but the sampled source does not establish its websocket wiring. Edges reflect excerpted code, SOURCE INDEX references, or README statements.

Main entry points: [`app/services/apiService.ts`](https://github.com/steinovehelset/djangobnb/blob/main/app/services/apiService.ts) (API client), [`app/components/properties/PropertyList.tsx`](https://github.com/steinovehelset/djangobnb/blob/main/app/components/properties/PropertyList.tsx) (Property list), [`app/components/modals/LoginModal.tsx`](https://github.com/steinovehelset/djangobnb/blob/main/app/components/modals/LoginModal.tsx) (Login and signup), [`app/lib/actions.ts`](https://github.com/steinovehelset/djangobnb/blob/main/app/lib/actions.ts) (Session actions)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_discovery["Property discovery"]
  node_home["Home page<br/>[page.tsx]"]
  node_categories["Categories<br/>[Categories.tsx]"]
  node_search["Search modal<br/>[SearchModal.tsx]"]
  node_searchstate["Search state<br/>[useSearchModal.ts]"]
  node_propertylist["Property list<br/>[PropertyList.tsx]"]
  node_propertyitem["Property card"]
end

subgraph group_account["Accounts and hosting"]
  node_landlord["Landlord detail<br/>[page.tsx]"]
  node_favorites["Favorites page<br/>[page.tsx]"]
  node_favoritebutton["Favorite action<br/>[FavoriteButton.tsx]"]
  node_hosting["Property management"]
  node_hostcategories["Listing categories<br/>[Categories.tsx]"]
  node_myproperties["My properties<br/>[page.tsx]"]
  node_authui["Login and signup<br/>[LoginModal.tsx]"]
  node_authstate["Auth modal state<br/>[useLoginModal.ts]"]
end

subgraph group_booking["Reservations and messaging"]
  node_propertydetail["Property detail<br/>[page.tsx]"]
  node_reservation["Reservation sidebar"]
  node_myreservations["My reservations<br/>[page.tsx]"]
  node_inbox["Inbox<br/>[page.tsx]"]
  node_conversation["Conversation detail"]
  node_conversationpage["Conversation page<br/>[page.tsx]"]
  node_contact["Contact host<br/>[ContactButton.tsx]"]
end

subgraph group_platform["Frontend services"]
  node_session["Session actions<br/>[actions.ts]"]
  node_api["API client<br/>[apiService.ts]"]
  node_backend{{"Django REST API"}}
  node_websocket{{"Chat websocket"}}
  node_layout["App layout<br/>[layout.tsx]"]
  node_navbar["Navigation<br/>[Navbar.tsx]"]
end

node_visitor(("Visitor"))

node_visitor -->|"opens"| node_home
node_home -->|"renders"| node_categories
node_home -->|"renders"| node_propertylist
node_categories -->|"sets category"| node_searchstate
node_search -->|"sets query"| node_searchstate
node_propertylist -->|"reads filters"| node_searchstate
node_propertylist -->|"fetches listings"| node_api
node_propertylist -->|"renders cards"| node_propertyitem
node_propertyitem -->|"renders action"| node_favoritebutton
node_favoritebutton -->|"updates favorite"| node_api
node_propertydetail -->|"loads listing"| node_api
node_propertydetail -->|"renders booking"| node_reservation
node_reservation -->|"submits reservation"| node_api
node_landlord -->|"loads host"| node_api
node_landlord -->|"lists host properties"| node_propertylist
node_landlord -->|"offers contact"| node_contact
node_favorites -->|"shows favorites"| node_propertylist
node_myproperties -->|"shows listings"| node_propertylist
node_hosting -->|"creates listing"| node_api
node_hosting -->|"uses categories"| node_hostcategories
node_authui -->|"uses modal state"| node_authstate
node_authui -->|"submits credentials"| node_api
node_authui -->|"sets session"| node_session
node_myreservations -->|"loads reservations"| node_api
node_inbox -->|"loads conversations"| node_api
node_inbox -->|"checks user"| node_session
node_conversationpage -->|"loads conversation"| node_api
node_conversationpage -->|"renders messages"| node_conversation
node_conversation -.->|"live messaging"| node_websocket
node_contact -->|"starts contact"| node_api
node_api -->|"gets access token"| node_session
node_api -->|"sends HTTP requests"| node_backend
node_session -->|"refreshes token"| node_backend
node_layout -->|"renders navigation"| node_navbar
node_layout -->|"renders modal"| node_search
node_layout -->|"renders auth"| node_authui

click node_home "https://github.com/steinovehelset/djangobnb/blob/main/app/page.tsx"
click node_categories "https://github.com/steinovehelset/djangobnb/blob/main/app/components/Categories.tsx"
click node_search "https://github.com/steinovehelset/djangobnb/blob/main/app/components/modals/SearchModal.tsx"
click node_searchstate "https://github.com/steinovehelset/djangobnb/blob/main/app/hooks/useSearchModal.ts"
click node_propertylist "https://github.com/steinovehelset/djangobnb/blob/main/app/components/properties/PropertyList.tsx"
click node_propertyitem "https://github.com/steinovehelset/djangobnb/blob/main/app/components/properties/PropertyListItem.tsx"
click node_propertydetail "https://github.com/steinovehelset/djangobnb/blob/main/app/properties/%5Bid%5D/page.tsx"
click node_landlord "https://github.com/steinovehelset/djangobnb/blob/main/app/landlords/%5Bid%5D/page.tsx"
click node_favorites "https://github.com/steinovehelset/djangobnb/blob/main/app/myfavorites/page.tsx"
click node_favoritebutton "https://github.com/steinovehelset/djangobnb/blob/main/app/components/FavoriteButton.tsx"
click node_hosting "https://github.com/steinovehelset/djangobnb/blob/main/app/components/modals/AddPropertyModal.tsx"
click node_hostcategories "https://github.com/steinovehelset/djangobnb/blob/main/app/components/addproperty/Categories.tsx"
click node_myproperties "https://github.com/steinovehelset/djangobnb/blob/main/app/myproperties/page.tsx"
click node_authui "https://github.com/steinovehelset/djangobnb/blob/main/app/components/modals/LoginModal.tsx"
click node_authstate "https://github.com/steinovehelset/djangobnb/blob/main/app/hooks/useLoginModal.ts"
click node_session "https://github.com/steinovehelset/djangobnb/blob/main/app/lib/actions.ts"
click node_reservation "https://github.com/steinovehelset/djangobnb/blob/main/app/components/properties/ReservationSidebar.tsx"
click node_myreservations "https://github.com/steinovehelset/djangobnb/blob/main/app/myreservations/page.tsx"
click node_inbox "https://github.com/steinovehelset/djangobnb/blob/main/app/inbox/page.tsx"
click node_conversation "https://github.com/steinovehelset/djangobnb/blob/main/app/components/inbox/ConversationDetail.tsx"
click node_conversationpage "https://github.com/steinovehelset/djangobnb/blob/main/app/inbox/%5Bid%5D/page.tsx"
click node_contact "https://github.com/steinovehelset/djangobnb/blob/main/app/components/ContactButton.tsx"
click node_api "https://github.com/steinovehelset/djangobnb/blob/main/app/services/apiService.ts"
click node_layout "https://github.com/steinovehelset/djangobnb/blob/main/app/layout.tsx"
click node_navbar "https://github.com/steinovehelset/djangobnb/blob/main/app/components/navbar/Navbar.tsx"

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_home,node_categories,node_search,node_searchstate,node_propertylist,node_propertyitem toneBlue
class node_landlord,node_favorites,node_favoritebutton,node_hosting,node_hostcategories,node_myproperties,node_authui,node_authstate toneAmber
class node_propertydetail,node_reservation,node_myreservations,node_inbox,node_conversation,node_conversationpage,node_contact toneMint
class node_session,node_api,node_backend,node_websocket,node_layout,node_navbar toneRose
class node_visitor toneIndigo
```

## Components

### Property discovery

- [Home page](https://github.com/steinovehelset/djangobnb/blob/main/app/page.tsx): `app/page.tsx`
- [Categories](https://github.com/steinovehelset/djangobnb/blob/main/app/components/Categories.tsx): `app/components/Categories.tsx`
- [Search modal](https://github.com/steinovehelset/djangobnb/blob/main/app/components/modals/SearchModal.tsx): `app/components/modals/SearchModal.tsx`
- [Search state](https://github.com/steinovehelset/djangobnb/blob/main/app/hooks/useSearchModal.ts): `app/hooks/useSearchModal.ts`
- [Property list](https://github.com/steinovehelset/djangobnb/blob/main/app/components/properties/PropertyList.tsx): `app/components/properties/PropertyList.tsx`
- [Property card](https://github.com/steinovehelset/djangobnb/blob/main/app/components/properties/PropertyListItem.tsx): `app/components/properties/PropertyListItem.tsx`

### Accounts and hosting

- [Landlord detail](https://github.com/steinovehelset/djangobnb/blob/main/app/landlords/%5Bid%5D/page.tsx): `app/landlords/[id]/page.tsx`
- [Favorites page](https://github.com/steinovehelset/djangobnb/blob/main/app/myfavorites/page.tsx): `app/myfavorites/page.tsx`
- [Favorite action](https://github.com/steinovehelset/djangobnb/blob/main/app/components/FavoriteButton.tsx): `app/components/FavoriteButton.tsx`
- [Property management](https://github.com/steinovehelset/djangobnb/blob/main/app/components/modals/AddPropertyModal.tsx): `app/components/modals/AddPropertyModal.tsx`
- [Listing categories](https://github.com/steinovehelset/djangobnb/blob/main/app/components/addproperty/Categories.tsx): `app/components/addproperty/Categories.tsx`
- [My properties](https://github.com/steinovehelset/djangobnb/blob/main/app/myproperties/page.tsx): `app/myproperties/page.tsx`
- [Login and signup](https://github.com/steinovehelset/djangobnb/blob/main/app/components/modals/LoginModal.tsx): `app/components/modals/LoginModal.tsx`
- [Auth modal state](https://github.com/steinovehelset/djangobnb/blob/main/app/hooks/useLoginModal.ts): `app/hooks/useLoginModal.ts`

### Reservations and messaging

- [Property detail](https://github.com/steinovehelset/djangobnb/blob/main/app/properties/%5Bid%5D/page.tsx): `app/properties/[id]/page.tsx`
- [Reservation sidebar](https://github.com/steinovehelset/djangobnb/blob/main/app/components/properties/ReservationSidebar.tsx): `app/components/properties/ReservationSidebar.tsx`
- [My reservations](https://github.com/steinovehelset/djangobnb/blob/main/app/myreservations/page.tsx): `app/myreservations/page.tsx`
- [Inbox](https://github.com/steinovehelset/djangobnb/blob/main/app/inbox/page.tsx): `app/inbox/page.tsx`
- [Conversation detail](https://github.com/steinovehelset/djangobnb/blob/main/app/components/inbox/ConversationDetail.tsx): `app/components/inbox/ConversationDetail.tsx`
- [Conversation page](https://github.com/steinovehelset/djangobnb/blob/main/app/inbox/%5Bid%5D/page.tsx): `app/inbox/[id]/page.tsx`
- [Contact host](https://github.com/steinovehelset/djangobnb/blob/main/app/components/ContactButton.tsx): `app/components/ContactButton.tsx`

### Frontend services

- [Session actions](https://github.com/steinovehelset/djangobnb/blob/main/app/lib/actions.ts): `app/lib/actions.ts`
- [API client](https://github.com/steinovehelset/djangobnb/blob/main/app/services/apiService.ts): `app/services/apiService.ts`
- **Django REST API**
- **Chat websocket**
- [App layout](https://github.com/steinovehelset/djangobnb/blob/main/app/layout.tsx): `app/layout.tsx`
- [Navigation](https://github.com/steinovehelset/djangobnb/blob/main/app/components/navbar/Navbar.tsx): `app/components/navbar/Navbar.tsx`

### Other components

- **Visitor**

## Connections

- Visitor → Home page: opens (evidence: `app/page.tsx`)
- Home page → Categories: renders (evidence: `app/page.tsx`)
- Home page → Property list: renders (evidence: `app/page.tsx`)
- Categories → Search state: sets category (evidence: `app/components/Categories.tsx`)
- Search modal → Search state: sets query (evidence: `app/components/modals/SearchModal.tsx`)
- Property list → Search state: reads filters (evidence: `app/components/properties/PropertyList.tsx`)
- Property list → API client: fetches listings (evidence: `app/components/properties/PropertyList.tsx`)
- Property list → Property card: renders cards (evidence: `app/components/properties/PropertyList.tsx`)
- Property card → Favorite action: renders action (evidence: `app/components/properties/PropertyListItem.tsx`)
- Favorite action → API client: updates favorite (evidence: `app/components/FavoriteButton.tsx`)
- Property detail → API client: loads listing (evidence: `app/properties/[id]/page.tsx`)
- Property detail → Reservation sidebar: renders booking (evidence: `app/properties/[id]/page.tsx`)
- Reservation sidebar → API client: submits reservation (evidence: `app/components/properties/ReservationSidebar.tsx`)
- Landlord detail → API client: loads host (evidence: `app/landlords/[id]/page.tsx`)
- Landlord detail → Property list: lists host properties (evidence: `app/landlords/[id]/page.tsx`)
- Landlord detail → Contact host: offers contact (evidence: `app/landlords/[id]/page.tsx`)
- Favorites page → Property list: shows favorites (evidence: `app/myfavorites/page.tsx`)
- My properties → Property list: shows listings (evidence: `app/myproperties/page.tsx`)
- Property management → API client: creates listing (evidence: `app/components/modals/AddPropertyModal.tsx`)
- Property management → Listing categories: uses categories (evidence: `app/components/modals/AddPropertyModal.tsx`)
- Login and signup → Auth modal state: uses modal state (evidence: `app/components/modals/LoginModal.tsx`)
- Login and signup → API client: submits credentials (evidence: `app/components/modals/LoginModal.tsx`)
- Login and signup → Session actions: sets session (evidence: `app/components/modals/LoginModal.tsx`)
- My reservations → API client: loads reservations (evidence: `app/myreservations/page.tsx`)
- Inbox → API client: loads conversations (evidence: `app/inbox/page.tsx`)
- Inbox → Session actions: checks user (evidence: `app/inbox/page.tsx`)
- Conversation page → API client: loads conversation (evidence: `app/inbox/[id]/page.tsx`)
- Conversation page → Conversation detail: renders messages (evidence: `app/inbox/[id]/page.tsx`)
- Conversation detail → Chat websocket: live messaging (evidence: `README.md`)
- Contact host → API client: starts contact (evidence: `app/components/ContactButton.tsx`)
- API client → Session actions: gets access token (evidence: `app/services/apiService.ts`)
- API client → Django REST API: sends HTTP requests (evidence: `app/services/apiService.ts`)
- Session actions → Django REST API: refreshes token (evidence: `app/lib/actions.ts`)
- App layout → Navigation: renders navigation (evidence: `app/layout.tsx`)
- App layout → Search modal: renders modal (evidence: `app/layout.tsx`)
- App layout → Login and signup: renders auth (evidence: `app/layout.tsx`)
