# bhuvan0611/airbnb-clone-full-stack- architecture

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

- Interactive diagram: https://gitdiagram.com/bhuvan0611/airbnb-clone-full-stack-
- Repository: https://github.com/bhuvan0611/airbnb-clone-full-stack-

## Overview

This server-rendered rental marketplace lets visitors browse and search listings, inspect listing details and maps, and—after authentication—create or manage listings and reviews. Express routes own request dispatch and middleware authorization; controllers perform domain actions against Mongoose models and render EJS pages. Sessions persist in MongoDB, while listing creation uses image storage and geocoding integrations. The README also documents tax calculation, but the sampled source does not establish its implementation path. Edges reflect excerpts or README statements; unsampled template and integration wiring is left unconnected where evidence is unavailable.

Main entry points: [`app.js`](https://github.com/bhuvan0611/airbnb-clone-full-stack-/blob/main/app.js) (Express entry and rendering), [`controllers/listings.js`](https://github.com/bhuvan0611/airbnb-clone-full-stack-/blob/main/controllers/listings.js) (Listing workflows), [`controllers/reviews.js`](https://github.com/bhuvan0611/airbnb-clone-full-stack-/blob/main/controllers/reviews.js) (Review workflows), [`middlewear.js`](https://github.com/bhuvan0611/airbnb-clone-full-stack-/blob/main/middlewear.js) (Validation and access)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_app["Web application"]
  node_server["Express entry and rendering<br/>[app.js]"]
  node_access_middleware["Validation and access<br/>[middlewear.js]"]
  node_validation_schema["Request schemas<br/>[schema.js]"]
  node_async_wrapper["Async error wrapper<br/>[wrapAsync.js]"]
end

subgraph group_market["Listings and reviews"]
  node_listing_routes["Listing routes<br/>[listing.js]"]
  node_listing_controller["Listing workflows<br/>[listings.js]"]
  node_listing_model[("Listing records<br/>[listing.js]")]
  node_review_routes["Review routes<br/>[review.js]"]
  node_review_controller["Review workflows<br/>[reviews.js]"]
  node_review_model[("Review records<br/>[review.js]")]
  node_seed_data["Sample listing data<br/>[data.js]"]
end

subgraph group_identity["Identity and sessions"]
  node_auth_routes["Account routes<br/>[user.js]"]
  node_user_controller["Account workflows<br/>[users.js]"]
  node_user_model[("User records<br/>[user.js]")]
  node_session_store[("Session store")]
end

subgraph group_views["Presentation and maps"]
  node_listing_views["Listing pages"]
  node_account_views["Account pages"]
  node_error_view["Error page<br/>[error.ejs]"]
  node_map_client["Listing map<br/>[map.js]"]
  node_tax_client["Price tax toggle<br/>[script.js]"]
end

subgraph group_integrations["External services"]
  node_image_storage["Image storage<br/>[cloudConfig.js]"]
  node_geocoder["Mapbox geocoder"]
  node_mongo[("MongoDB")]
end

node_guest(("Visitor or user"))

node_guest -->|"sends requests"| node_server
node_server -->|"mounts routes"| node_listing_routes
node_server -->|"mounts routes"| node_review_routes
node_server -->|"mounts routes"| node_auth_routes
node_server -->|"persists sessions"| node_session_store
node_server -->|"configures Passport"| node_user_model
node_listing_routes -->|"dispatches actions"| node_listing_controller
node_listing_routes -->|"checks access"| node_access_middleware
node_listing_controller -->|"reads and writes"| node_listing_model
node_listing_controller -->|"uploads images"| node_image_storage
node_listing_controller -->|"geocodes location"| node_geocoder
node_listing_controller -->|"renders pages"| node_listing_views
node_review_routes -->|"dispatches actions"| node_review_controller
node_review_routes -->|"checks access"| node_access_middleware
node_review_controller -->|"creates and deletes"| node_review_model
node_review_controller -->|"updates references"| node_listing_model
node_server -->|"connects database"| node_mongo
node_listing_controller -.->|"queries through models"| node_mongo
node_review_controller -.->|"queries through models"| node_mongo
node_auth_routes -->|"dispatches actions"| node_user_controller
node_user_controller -->|"manages accounts"| node_user_model
node_user_controller -.->|"renders pages"| node_account_views
node_access_middleware -->|"checks ownership"| node_listing_model
node_access_middleware -->|"checks authorship"| node_review_model
node_access_middleware -->|"validates input"| node_validation_schema
node_listing_controller -->|"wraps async actions"| node_async_wrapper
node_review_controller -->|"wraps async actions"| node_async_wrapper
node_server -->|"renders failures"| node_error_view
node_listing_views -.->|"shows location"| node_map_client
node_listing_views -.->|"offers tax toggle"| node_tax_client
node_seed_data -.->|"seeds examples"| node_listing_model

click node_server "https://github.com/bhuvan0611/airbnb-clone-full-stack-/blob/main/app.js"
click node_listing_routes "https://github.com/bhuvan0611/airbnb-clone-full-stack-/blob/main/routes/listing.js"
click node_listing_controller "https://github.com/bhuvan0611/airbnb-clone-full-stack-/blob/main/controllers/listings.js"
click node_listing_model "https://github.com/bhuvan0611/airbnb-clone-full-stack-/blob/main/models/listing.js"
click node_review_routes "https://github.com/bhuvan0611/airbnb-clone-full-stack-/blob/main/routes/review.js"
click node_review_controller "https://github.com/bhuvan0611/airbnb-clone-full-stack-/blob/main/controllers/reviews.js"
click node_review_model "https://github.com/bhuvan0611/airbnb-clone-full-stack-/blob/main/models/review.js"
click node_auth_routes "https://github.com/bhuvan0611/airbnb-clone-full-stack-/blob/main/routes/user.js"
click node_user_controller "https://github.com/bhuvan0611/airbnb-clone-full-stack-/blob/main/controllers/users.js"
click node_user_model "https://github.com/bhuvan0611/airbnb-clone-full-stack-/blob/main/models/user.js"
click node_access_middleware "https://github.com/bhuvan0611/airbnb-clone-full-stack-/blob/main/middlewear.js"
click node_listing_views "https://github.com/bhuvan0611/airbnb-clone-full-stack-/tree/main/views/listings"
click node_account_views "https://github.com/bhuvan0611/airbnb-clone-full-stack-/tree/main/views/users"
click node_error_view "https://github.com/bhuvan0611/airbnb-clone-full-stack-/blob/main/views/error.ejs"
click node_map_client "https://github.com/bhuvan0611/airbnb-clone-full-stack-/blob/main/public/js/map.js"
click node_tax_client "https://github.com/bhuvan0611/airbnb-clone-full-stack-/blob/main/public/js/script.js"
click node_image_storage "https://github.com/bhuvan0611/airbnb-clone-full-stack-/blob/main/cloudConfig.js"
click node_seed_data "https://github.com/bhuvan0611/airbnb-clone-full-stack-/blob/main/init/data.js"
click node_validation_schema "https://github.com/bhuvan0611/airbnb-clone-full-stack-/blob/main/schema.js"
click node_async_wrapper "https://github.com/bhuvan0611/airbnb-clone-full-stack-/blob/main/utils/wrapAsync.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_server,node_access_middleware,node_validation_schema,node_async_wrapper,node_guest toneBlue
class node_listing_routes,node_listing_controller,node_listing_model,node_review_routes,node_review_controller,node_review_model,node_seed_data toneAmber
class node_auth_routes,node_user_controller,node_user_model,node_session_store toneMint
class node_listing_views,node_account_views,node_error_view,node_map_client,node_tax_client toneRose
class node_image_storage,node_geocoder,node_mongo toneIndigo
```

## Components

### Web application

- [Express entry and rendering](https://github.com/bhuvan0611/airbnb-clone-full-stack-/blob/main/app.js): `app.js`
- [Validation and access](https://github.com/bhuvan0611/airbnb-clone-full-stack-/blob/main/middlewear.js): `middlewear.js`
- [Request schemas](https://github.com/bhuvan0611/airbnb-clone-full-stack-/blob/main/schema.js): `schema.js`
- [Async error wrapper](https://github.com/bhuvan0611/airbnb-clone-full-stack-/blob/main/utils/wrapAsync.js): `utils/wrapAsync.js`

### Listings and reviews

- [Listing routes](https://github.com/bhuvan0611/airbnb-clone-full-stack-/blob/main/routes/listing.js): `routes/listing.js`
- [Listing workflows](https://github.com/bhuvan0611/airbnb-clone-full-stack-/blob/main/controllers/listings.js): `controllers/listings.js`
- [Listing records](https://github.com/bhuvan0611/airbnb-clone-full-stack-/blob/main/models/listing.js): `models/listing.js`
- [Review routes](https://github.com/bhuvan0611/airbnb-clone-full-stack-/blob/main/routes/review.js): `routes/review.js`
- [Review workflows](https://github.com/bhuvan0611/airbnb-clone-full-stack-/blob/main/controllers/reviews.js): `controllers/reviews.js`
- [Review records](https://github.com/bhuvan0611/airbnb-clone-full-stack-/blob/main/models/review.js): `models/review.js`
- [Sample listing data](https://github.com/bhuvan0611/airbnb-clone-full-stack-/blob/main/init/data.js): `init/data.js`

### Identity and sessions

- [Account routes](https://github.com/bhuvan0611/airbnb-clone-full-stack-/blob/main/routes/user.js): `routes/user.js`
- [Account workflows](https://github.com/bhuvan0611/airbnb-clone-full-stack-/blob/main/controllers/users.js): `controllers/users.js`
- [User records](https://github.com/bhuvan0611/airbnb-clone-full-stack-/blob/main/models/user.js): `models/user.js`
- **Session store**

### Presentation and maps

- [Listing pages](https://github.com/bhuvan0611/airbnb-clone-full-stack-/tree/main/views/listings): `views/listings`
- [Account pages](https://github.com/bhuvan0611/airbnb-clone-full-stack-/tree/main/views/users): `views/users`
- [Error page](https://github.com/bhuvan0611/airbnb-clone-full-stack-/blob/main/views/error.ejs): `views/error.ejs`
- [Listing map](https://github.com/bhuvan0611/airbnb-clone-full-stack-/blob/main/public/js/map.js): `public/js/map.js`
- [Price tax toggle](https://github.com/bhuvan0611/airbnb-clone-full-stack-/blob/main/public/js/script.js): `public/js/script.js`

### External services

- [Image storage](https://github.com/bhuvan0611/airbnb-clone-full-stack-/blob/main/cloudConfig.js): `cloudConfig.js`
- **Mapbox geocoder**
- **MongoDB**

### Other components

- **Visitor or user**

## Connections

- Visitor or user → Express entry and rendering: sends requests (evidence: `app.js`)
- Express entry and rendering → Listing routes: mounts routes (evidence: `app.js`)
- Express entry and rendering → Review routes: mounts routes (evidence: `app.js`)
- Express entry and rendering → Account routes: mounts routes (evidence: `app.js`)
- Express entry and rendering → Session store: persists sessions (evidence: `app.js`)
- Express entry and rendering → User records: configures Passport (evidence: `app.js`)
- Listing routes → Listing workflows: dispatches actions (evidence: `routes/listing.js`)
- Listing routes → Validation and access: checks access (evidence: `routes/listing.js`)
- Listing workflows → Listing records: reads and writes (evidence: `controllers/listings.js`)
- Listing workflows → Image storage: uploads images (evidence: `routes/listing.js`)
- Listing workflows → Mapbox geocoder: geocodes location (evidence: `controllers/listings.js`)
- Listing workflows → Listing pages: renders pages (evidence: `controllers/listings.js`)
- Review routes → Review workflows: dispatches actions (evidence: `routes/review.js`)
- Review routes → Validation and access: checks access (evidence: `routes/review.js`)
- Review workflows → Review records: creates and deletes (evidence: `controllers/reviews.js`)
- Review workflows → Listing records: updates references (evidence: `controllers/reviews.js`)
- Express entry and rendering → MongoDB: connects database (evidence: `app.js`)
- Listing workflows → MongoDB: queries through models
- Review workflows → MongoDB: queries through models
- Account routes → Account workflows: dispatches actions (evidence: `routes/user.js`)
- Account workflows → User records: manages accounts (evidence: `controllers/users.js`)
- Account workflows → Account pages: renders pages
- Validation and access → Listing records: checks ownership (evidence: `middlewear.js`)
- Validation and access → Review records: checks authorship (evidence: `middlewear.js`)
- Validation and access → Request schemas: validates input (evidence: `middlewear.js`)
- Listing workflows → Async error wrapper: wraps async actions (evidence: `controllers/listings.js`)
- Review workflows → Async error wrapper: wraps async actions (evidence: `controllers/reviews.js`)
- Express entry and rendering → Error page: renders failures (evidence: `app.js`)
- Listing pages → Listing map: shows location (evidence: `README.md`)
- Listing pages → Price tax toggle: offers tax toggle (evidence: `README.md`)
- Sample listing data → Listing records: seeds examples (evidence: `README.md`)
