# abhishek-3191/airbnb architecture

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

- Interactive diagram: https://gitdiagram.com/abhishek-3191/airbnb
- Repository: https://github.com/abhishek-3191/airbnb

## Overview

This is an Express/Mongoose rental-listing app. Visitors browse listings; authenticated users can create, edit, and delete listings, upload images, register or log in, and add or remove reviews. The graph follows the documented capabilities and sampled route-to-controller calls. Booking, payment, and map search are future ideas in the README, not implemented product stages. Some supporting modules were not excerpted, so relationships not visible in source or README are omitted.

Main entry points: [`app.js`](https://github.com/abhishek-3191/airbnb/blob/master/app.js) (Express application), [`routes/listing.js`](https://github.com/abhishek-3191/airbnb/blob/master/routes/listing.js) (Listing routes), [`routes/review.js`](https://github.com/abhishek-3191/airbnb/blob/master/routes/review.js) (Review routes), [`models/listing.js`](https://github.com/abhishek-3191/airbnb/blob/master/models/listing.js) (Listing records)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_web["Web application"]
  node_app["Express application<br/>[app.js]"]
  node_access_middleware["Access and validation<br/>[middleware.js]"]
end

subgraph group_identity["Identity and access"]
  node_user_routes["Account routes<br/>[user.js]"]
  node_user_controller["Account workflows<br/>[users.js]"]
  node_session_auth["Session authentication<br/>[app.js]"]
  node_account_views["Account pages"]
end

subgraph group_rental["Rental listings"]
  node_listing_routes["Listing routes<br/>[listing.js]"]
  node_listing_controller["Listing workflows<br/>[listings.js]"]
  node_listing_validation["Listing validation<br/>[schema.js]"]
end

subgraph group_community["Reviews and presentation"]
  node_review_routes["Review routes<br/>[review.js]"]
  node_review_controller["Review workflows<br/>[reviews.js]"]
  node_listing_views["Listing pages"]
end

subgraph group_persistence["Persistence and media"]
  node_listing_model[("Listing records<br/>[listing.js]")]
  node_review_model[("Review records<br/>[review.js]")]
  node_user_model[("User records<br/>[user.js]")]
  node_cloudinary["Cloudinary media<br/>[cloudConfig.js]"]
end

node_visitor(("Visitor"))
node_mongo[("MongoDB")]

node_visitor -->|"requests pages"| node_app
node_app -->|"mounts at listings"| node_listing_routes
node_app -->|"mounts reviews"| node_review_routes
node_app -->|"mounts accounts"| node_user_routes
node_app -->|"configures sessions"| node_session_auth
node_listing_routes -->|"dispatches requests"| node_listing_controller
node_listing_routes -->|"checks access"| node_access_middleware
node_listing_routes -->|"configures uploads"| node_cloudinary
node_listing_controller -->|"reads and writes"| node_listing_model
node_listing_controller -->|"uses schema"| node_listing_validation
node_listing_controller -->|"renders pages"| node_listing_views
node_review_routes -->|"dispatches requests"| node_review_controller
node_review_routes -->|"checks access"| node_access_middleware
node_review_controller -->|"loads listing"| node_listing_model
node_review_controller -->|"creates and deletes"| node_review_model
node_user_routes -->|"dispatches requests"| node_user_controller
node_user_routes -->|"restores redirect"| node_access_middleware
node_user_controller -->|"registers accounts"| node_user_model
node_user_controller -.->|"renders pages"| node_account_views
node_session_auth -->|"authenticates users"| node_user_model
node_listing_model -.->|"persists listings"| node_mongo
node_review_model -.->|"persists reviews"| node_mongo
node_user_model -.->|"persists users"| node_mongo
node_listing_routes -->|"loads model"| node_listing_model
node_review_routes -->|"loads model"| node_review_model
node_review_routes -->|"loads model"| node_listing_model
node_user_routes -->|"loads model"| node_user_model

click node_app "https://github.com/abhishek-3191/airbnb/blob/master/app.js"
click node_listing_routes "https://github.com/abhishek-3191/airbnb/blob/master/routes/listing.js"
click node_listing_controller "https://github.com/abhishek-3191/airbnb/blob/master/controllers/listings.js"
click node_listing_model "https://github.com/abhishek-3191/airbnb/blob/master/models/listing.js"
click node_listing_validation "https://github.com/abhishek-3191/airbnb/blob/master/schema.js"
click node_review_routes "https://github.com/abhishek-3191/airbnb/blob/master/routes/review.js"
click node_review_controller "https://github.com/abhishek-3191/airbnb/blob/master/controllers/reviews.js"
click node_review_model "https://github.com/abhishek-3191/airbnb/blob/master/models/review.js"
click node_user_routes "https://github.com/abhishek-3191/airbnb/blob/master/routes/user.js"
click node_user_controller "https://github.com/abhishek-3191/airbnb/blob/master/controllers/users.js"
click node_user_model "https://github.com/abhishek-3191/airbnb/blob/master/models/user.js"
click node_access_middleware "https://github.com/abhishek-3191/airbnb/blob/master/middleware.js"
click node_session_auth "https://github.com/abhishek-3191/airbnb/blob/master/app.js"
click node_listing_views "https://github.com/abhishek-3191/airbnb/tree/master/views/listings"
click node_account_views "https://github.com/abhishek-3191/airbnb/tree/master/views/users"
click node_cloudinary "https://github.com/abhishek-3191/airbnb/blob/master/cloudConfig.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_app,node_access_middleware toneBlue
class node_user_routes,node_user_controller,node_session_auth,node_account_views,node_mongo toneAmber
class node_listing_routes,node_listing_controller,node_listing_validation toneMint
class node_review_routes,node_review_controller,node_listing_views toneRose
class node_listing_model,node_review_model,node_user_model,node_cloudinary,node_visitor toneIndigo
```

## Components

### Web application

- [Express application](https://github.com/abhishek-3191/airbnb/blob/master/app.js): `app.js`
- [Access and validation](https://github.com/abhishek-3191/airbnb/blob/master/middleware.js): `middleware.js`

### Identity and access

- [Account routes](https://github.com/abhishek-3191/airbnb/blob/master/routes/user.js): `routes/user.js`
- [Account workflows](https://github.com/abhishek-3191/airbnb/blob/master/controllers/users.js): `controllers/users.js`
- [Session authentication](https://github.com/abhishek-3191/airbnb/blob/master/app.js): `app.js`
- [Account pages](https://github.com/abhishek-3191/airbnb/tree/master/views/users): `views/users`

### Rental listings

- [Listing routes](https://github.com/abhishek-3191/airbnb/blob/master/routes/listing.js): `routes/listing.js`
- [Listing workflows](https://github.com/abhishek-3191/airbnb/blob/master/controllers/listings.js): `controllers/listings.js`
- [Listing validation](https://github.com/abhishek-3191/airbnb/blob/master/schema.js): `schema.js`

### Reviews and presentation

- [Review routes](https://github.com/abhishek-3191/airbnb/blob/master/routes/review.js): `routes/review.js`
- [Review workflows](https://github.com/abhishek-3191/airbnb/blob/master/controllers/reviews.js): `controllers/reviews.js`
- [Listing pages](https://github.com/abhishek-3191/airbnb/tree/master/views/listings): `views/listings`

### Persistence and media

- [Listing records](https://github.com/abhishek-3191/airbnb/blob/master/models/listing.js): `models/listing.js`
- [Review records](https://github.com/abhishek-3191/airbnb/blob/master/models/review.js): `models/review.js`
- [User records](https://github.com/abhishek-3191/airbnb/blob/master/models/user.js): `models/user.js`
- [Cloudinary media](https://github.com/abhishek-3191/airbnb/blob/master/cloudConfig.js): `cloudConfig.js`

### Other components

- **Visitor**
- **MongoDB**

## Connections

- Visitor → Express application: requests pages (evidence: `app.js`)
- Express application → Listing routes: mounts at listings (evidence: `app.js`)
- Express application → Review routes: mounts reviews (evidence: `app.js`)
- Express application → Account routes: mounts accounts (evidence: `app.js`)
- Express application → Session authentication: configures sessions (evidence: `app.js`)
- Listing routes → Listing workflows: dispatches requests (evidence: `routes/listing.js`)
- Listing routes → Access and validation: checks access (evidence: `routes/listing.js`)
- Listing routes → Cloudinary media: configures uploads (evidence: `routes/listing.js`)
- Listing workflows → Listing records: reads and writes (evidence: `controllers/listings.js`)
- Listing workflows → Listing validation: uses schema (evidence: `controllers/listings.js`)
- Listing workflows → Listing pages: renders pages (evidence: `controllers/listings.js`)
- Review routes → Review workflows: dispatches requests (evidence: `routes/review.js`)
- Review routes → Access and validation: checks access (evidence: `routes/review.js`)
- Review workflows → Listing records: loads listing (evidence: `controllers/reviews.js`)
- Review workflows → Review records: creates and deletes (evidence: `controllers/reviews.js`)
- Account routes → Account workflows: dispatches requests (evidence: `routes/user.js`)
- Account routes → Access and validation: restores redirect (evidence: `routes/user.js`)
- Account workflows → User records: registers accounts (evidence: `controllers/users.js`)
- Account workflows → Account pages: renders pages
- Session authentication → User records: authenticates users (evidence: `app.js`)
- Listing records → MongoDB: persists listings
- Review records → MongoDB: persists reviews
- User records → MongoDB: persists users
- Listing routes → Listing records: loads model (evidence: `routes/listing.js`)
- Review routes → Review records: loads model (evidence: `routes/review.js`)
- Review routes → Listing records: loads model (evidence: `routes/review.js`)
- Account routes → User records: loads model (evidence: `routes/user.js`)
