# joshdigitalconcept/staynest architecture

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

- Interactive diagram: https://gitdiagram.com/joshdigitalconcept/staynest
- Repository: https://github.com/joshdigitalconcept/staynest

## Overview

StayNest is a Firebase-backed accommodation marketplace. Guests browse listings, inspect property details, and book; hosts create and manage listings, while users manage profiles, favorites, and messages. Administrative routes cover marketplace operations including listings, users, finance, disputes, reviews, content, and trust and safety. The sampled code confirms Firestore-backed listing queries and profile booking reads, plus listing-card favorite and delete writes. Most route implementations were not sampled, so their internal interactions are not asserted.

Main entry points: [`src/firebase/index.ts`](https://github.com/joshdigitalconcept/staynest/blob/main/src/firebase/index.ts) (Firebase services), [`src/components/property-card.tsx`](https://github.com/joshdigitalconcept/staynest/blob/main/src/components/property-card.tsx) (Listing cards), [`src/app/profile/page.tsx`](https://github.com/joshdigitalconcept/staynest/blob/main/src/app/profile/page.tsx) (Profile and bookings), [`src/app/admin`](https://github.com/joshdigitalconcept/staynest/tree/main/src/app/admin) (Admin console)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_guest["Guest marketplace"]
  node_home["Browse listings<br/>[page.tsx]"]
  node_search["Search<br/>[page.tsx]"]
  node_cards["Listing cards<br/>[property-card.tsx]"]
  node_property["Property details<br/>[page.tsx]"]
  node_booking["Booking flow<br/>[page.tsx]"]
  node_favorites["Favorites<br/>[page.tsx]"]
end

subgraph group_host["Host and account"]
  node_host(("Host"))
  node_onboarding["Listing creation"]
  node_listing_edit["Listing management<br/>[page.tsx]"]
  node_profile["Profile and bookings<br/>[page.tsx]"]
  node_account["Account settings"]
  node_messages["Messaging<br/>[page.tsx]"]
end

subgraph group_admin["Administration"]
  node_admin["Admin console"]
  node_admin_content["Content management<br/>[page.tsx]"]
  node_admin_settings["Platform settings<br/>[page.tsx]"]
  node_admin_safety["Trust and safety<br/>[page.tsx]"]
end

subgraph group_platform["Firebase platform"]
  node_firebase["Firebase services<br/>[index.ts]"]
  node_firestore[("Firestore")]
  node_types["Marketplace data types<br/>[types.ts]"]
  node_image_upload["Image upload<br/>[image-upload.ts]"]
end

node_guest(("Guest"))
node_admin_user(("Administrator"))

node_guest -->|"browses"| node_home
node_home -->|"queries listings"| node_firestore
node_home -->|"renders"| node_cards
node_cards -->|"links to"| node_property
node_cards -->|"writes favorites"| node_firestore
node_cards -->|"deletes listing"| node_firestore
node_property -->|"uses services"| node_firebase
node_booking -->|"uses services"| node_firebase
node_search -.->|"searches listings"| node_firestore
node_host -->|"creates listings"| node_onboarding
node_onboarding -.->|"uploads photos"| node_image_upload
node_host -->|"manages listings"| node_listing_edit
node_host -->|"manages account"| node_profile
node_profile -->|"reads listings and bookings"| node_firestore
node_profile -->|"uses services"| node_firebase
node_host -->|"updates settings"| node_account
node_host -->|"sends messages"| node_messages
node_admin_user -->|"operates"| node_admin
node_admin -->|"manages content"| node_admin_content
node_admin -->|"configures platform"| node_admin_settings
node_admin -->|"handles safety"| node_admin_safety
node_admin_content -->|"uses services"| node_firebase
node_admin_settings -->|"uses services"| node_firebase
node_admin_safety -->|"uses services"| node_firebase
node_firebase -->|"initializes"| node_firestore
node_profile -->|"uses domain types"| node_types
node_booking -->|"uses domain types"| node_types
node_admin_content -->|"uses uploads"| node_image_upload

click node_home "https://github.com/joshdigitalconcept/staynest/blob/main/src/app/page.tsx"
click node_search "https://github.com/joshdigitalconcept/staynest/blob/main/src/app/search/page.tsx"
click node_cards "https://github.com/joshdigitalconcept/staynest/blob/main/src/components/property-card.tsx"
click node_property "https://github.com/joshdigitalconcept/staynest/blob/main/src/app/properties/%5Bid%5D/page.tsx"
click node_booking "https://github.com/joshdigitalconcept/staynest/blob/main/src/app/book/%5Bid%5D/page.tsx"
click node_favorites "https://github.com/joshdigitalconcept/staynest/blob/main/src/app/favorites/page.tsx"
click node_onboarding "https://github.com/joshdigitalconcept/staynest/tree/main/src/app/host/create"
click node_listing_edit "https://github.com/joshdigitalconcept/staynest/blob/main/src/app/properties/edit/%5Bid%5D/page.tsx"
click node_profile "https://github.com/joshdigitalconcept/staynest/blob/main/src/app/profile/page.tsx"
click node_account "https://github.com/joshdigitalconcept/staynest/tree/main/src/app/account"
click node_messages "https://github.com/joshdigitalconcept/staynest/blob/main/src/app/messages/page.tsx"
click node_admin "https://github.com/joshdigitalconcept/staynest/tree/main/src/app/admin"
click node_admin_content "https://github.com/joshdigitalconcept/staynest/blob/main/src/app/admin/content/page.tsx"
click node_admin_settings "https://github.com/joshdigitalconcept/staynest/blob/main/src/app/admin/settings/page.tsx"
click node_admin_safety "https://github.com/joshdigitalconcept/staynest/blob/main/src/app/admin/trust-safety/page.tsx"
click node_firebase "https://github.com/joshdigitalconcept/staynest/blob/main/src/firebase/index.ts"
click node_types "https://github.com/joshdigitalconcept/staynest/blob/main/src/lib/types.ts"
click node_image_upload "https://github.com/joshdigitalconcept/staynest/blob/main/src/lib/image-upload.ts"

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_search,node_cards,node_property,node_booking,node_favorites toneBlue
class node_host,node_onboarding,node_listing_edit,node_profile,node_account,node_messages toneAmber
class node_admin,node_admin_content,node_admin_settings,node_admin_safety toneMint
class node_firebase,node_firestore,node_types,node_image_upload toneRose
class node_guest,node_admin_user toneIndigo
```

## Components

### Guest marketplace

- [Browse listings](https://github.com/joshdigitalconcept/staynest/blob/main/src/app/page.tsx): `src/app/page.tsx`
- [Search](https://github.com/joshdigitalconcept/staynest/blob/main/src/app/search/page.tsx): `src/app/search/page.tsx`
- [Listing cards](https://github.com/joshdigitalconcept/staynest/blob/main/src/components/property-card.tsx): `src/components/property-card.tsx`
- [Property details](https://github.com/joshdigitalconcept/staynest/blob/main/src/app/properties/%5Bid%5D/page.tsx): `src/app/properties/[id]/page.tsx`
- [Booking flow](https://github.com/joshdigitalconcept/staynest/blob/main/src/app/book/%5Bid%5D/page.tsx): `src/app/book/[id]/page.tsx`
- [Favorites](https://github.com/joshdigitalconcept/staynest/blob/main/src/app/favorites/page.tsx): `src/app/favorites/page.tsx`

### Host and account

- **Host**
- [Listing creation](https://github.com/joshdigitalconcept/staynest/tree/main/src/app/host/create): `src/app/host/create`
- [Listing management](https://github.com/joshdigitalconcept/staynest/blob/main/src/app/properties/edit/%5Bid%5D/page.tsx): `src/app/properties/edit/[id]/page.tsx`
- [Profile and bookings](https://github.com/joshdigitalconcept/staynest/blob/main/src/app/profile/page.tsx): `src/app/profile/page.tsx`
- [Account settings](https://github.com/joshdigitalconcept/staynest/tree/main/src/app/account): `src/app/account`
- [Messaging](https://github.com/joshdigitalconcept/staynest/blob/main/src/app/messages/page.tsx): `src/app/messages/page.tsx`

### Administration

- [Admin console](https://github.com/joshdigitalconcept/staynest/tree/main/src/app/admin): `src/app/admin`
- [Content management](https://github.com/joshdigitalconcept/staynest/blob/main/src/app/admin/content/page.tsx): `src/app/admin/content/page.tsx`
- [Platform settings](https://github.com/joshdigitalconcept/staynest/blob/main/src/app/admin/settings/page.tsx): `src/app/admin/settings/page.tsx`
- [Trust and safety](https://github.com/joshdigitalconcept/staynest/blob/main/src/app/admin/trust-safety/page.tsx): `src/app/admin/trust-safety/page.tsx`

### Firebase platform

- [Firebase services](https://github.com/joshdigitalconcept/staynest/blob/main/src/firebase/index.ts): `src/firebase/index.ts`
- **Firestore**
- [Marketplace data types](https://github.com/joshdigitalconcept/staynest/blob/main/src/lib/types.ts): `src/lib/types.ts`
- [Image upload](https://github.com/joshdigitalconcept/staynest/blob/main/src/lib/image-upload.ts): `src/lib/image-upload.ts`

### Other components

- **Guest**
- **Administrator**

## Connections

- Guest → Browse listings: browses
- Browse listings → Firestore: queries listings (evidence: `src/app/page.tsx`)
- Browse listings → Listing cards: renders (evidence: `src/app/page.tsx`)
- Listing cards → Property details: links to (evidence: `src/components/property-card.tsx`)
- Listing cards → Firestore: writes favorites (evidence: `src/components/property-card.tsx`)
- Listing cards → Firestore: deletes listing (evidence: `src/components/property-card.tsx`)
- Property details → Firebase services: uses services (evidence: `src/app/properties/[id]/page.tsx`)
- Booking flow → Firebase services: uses services (evidence: `src/app/book/[id]/page.tsx`)
- Search → Firestore: searches listings
- Host → Listing creation: creates listings
- Listing creation → Image upload: uploads photos
- Host → Listing management: manages listings
- Host → Profile and bookings: manages account
- Profile and bookings → Firestore: reads listings and bookings (evidence: `src/app/profile/page.tsx`)
- Profile and bookings → Firebase services: uses services (evidence: `src/app/profile/page.tsx`)
- Host → Account settings: updates settings
- Host → Messaging: sends messages
- Administrator → Admin console: operates
- Admin console → Content management: manages content
- Admin console → Platform settings: configures platform
- Admin console → Trust and safety: handles safety
- Content management → Firebase services: uses services (evidence: `src/app/admin/content/page.tsx`)
- Platform settings → Firebase services: uses services (evidence: `src/app/admin/settings/page.tsx`)
- Trust and safety → Firebase services: uses services (evidence: `src/app/admin/trust-safety/page.tsx`)
- Firebase services → Firestore: initializes (evidence: `src/firebase/index.ts`)
- Profile and bookings → Marketplace data types: uses domain types (evidence: `src/app/profile/page.tsx`)
- Booking flow → Marketplace data types: uses domain types (evidence: `src/app/book/[id]/page.tsx`)
- Content management → Image upload: uses uploads (evidence: `src/app/admin/content/page.tsx`)
