# farhanullah5332/gohavenly-full-stack-pro architecture

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

- Interactive diagram: https://gitdiagram.com/farhanullah5332/gohavenly-full-stack-pro
- Repository: https://github.com/farhanullah5332/gohavenly-full-stack-pro

## Overview

GoHavenly is a lodging-listing web app: visitors browse and filter stays, while signed-in users can manage listings and post reviews. The listing and review request paths are visible in the sampled source; authentication and user route internals are represented only as subsystems because their source was not sampled. MongoDB and Cloudinary are configured integrations.

Main entry points: [`app.js`](https://github.com/farhanullah5332/gohavenly-full-stack-pro/blob/main/app.js) (Express app), [`routes/listing.js`](https://github.com/farhanullah5332/gohavenly-full-stack-pro/blob/main/routes/listing.js) (Listing routes), [`Controllers/listings.js`](https://github.com/farhanullah5332/gohavenly-full-stack-pro/blob/main/Controllers/listings.js) (Listing operations), [`routes/review.js`](https://github.com/farhanullah5332/gohavenly-full-stack-pro/blob/main/routes/review.js) (Review routes)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_web["Web application"]
  node_app["Express app<br/>[app.js]"]
  node_middleware["Access checks<br/>[middleware.js]"]
  node_schema["Request validation<br/>[Schema.js]"]
  node_shared_views["Shared page layout<br/>[boilarplate.ejs]"]
end

subgraph group_listing["Listings"]
  node_listing_routes["Listing routes<br/>[listing.js]"]
  node_listing_controller["Listing operations<br/>[listings.js]"]
  node_listing_model["Listing model<br/>[listings.js]"]
  node_listing_views["Listing pages"]
  node_cloud_config["Image storage config<br/>[cloudConfig.js]"]
end

subgraph group_review["Reviews"]
  node_review_routes["Review routes<br/>[review.js]"]
  node_review_controller["Review operations<br/>[review.js]"]
  node_review_model["Review model<br/>[review.js]"]
  node_review_views["Review display<br/>[show.ejs]"]
end

subgraph group_identity["Accounts and sessions"]
  node_user_routes["User routes<br/>[user.js]"]
  node_user_controller["User operations<br/>[user.js]"]
  node_user_model["User model<br/>[user.js]"]
  node_session_store[("Session store<br/>[app.js]")]
end

node_guest(("Visitor"))
node_host(("Signed-in user"))
node_mongo[("MongoDB")]
node_cloudinary[("Cloudinary")]

node_guest -->|"requests pages"| node_app
node_host -->|"submits actions"| node_app
node_app -->|"mounts /listings"| node_listing_routes
node_app -->|"mounts reviews"| node_review_routes
node_app -->|"mounts account routes"| node_user_routes
node_listing_routes -->|"checks access"| node_middleware
node_listing_routes -->|"validates input"| node_schema
node_listing_routes -->|"configures uploads"| node_cloud_config
node_listing_routes -->|"dispatches requests"| node_listing_controller
node_listing_controller -->|"reads and writes"| node_listing_model
node_listing_model -->|"persists listings"| node_mongo
node_listing_controller -->|"renders pages"| node_listing_views
node_review_routes -->|"checks access"| node_middleware
node_review_routes -->|"validates input"| node_schema
node_review_routes -->|"dispatches requests"| node_review_controller
node_review_controller -->|"updates listing reviews"| node_listing_model
node_review_controller -->|"creates and deletes"| node_review_model
node_review_model -->|"persists reviews"| node_mongo
node_listing_controller -->|"renders listing detail"| node_review_views
node_review_views -->|"displays populated reviews"| node_review_model
node_user_routes -->|"dispatches account requests"| node_user_controller
node_user_controller -->|"uses account records"| node_user_model
node_user_model -->|"persists accounts"| node_mongo
node_app -->|"stores sessions"| node_session_store
node_session_store -->|"uses MongoDB"| node_mongo
node_cloud_config -.->|"stores listing images"| node_cloudinary
node_listing_views -->|"uses layout"| node_shared_views
node_review_views -->|"uses layout"| node_shared_views

click node_app "https://github.com/farhanullah5332/gohavenly-full-stack-pro/blob/main/app.js"
click node_listing_routes "https://github.com/farhanullah5332/gohavenly-full-stack-pro/blob/main/routes/listing.js"
click node_listing_controller "https://github.com/farhanullah5332/gohavenly-full-stack-pro/blob/main/Controllers/listings.js"
click node_listing_model "https://github.com/farhanullah5332/gohavenly-full-stack-pro/blob/main/Models/listings.js"
click node_listing_views "https://github.com/farhanullah5332/gohavenly-full-stack-pro/tree/main/views/listings"
click node_review_routes "https://github.com/farhanullah5332/gohavenly-full-stack-pro/blob/main/routes/review.js"
click node_review_controller "https://github.com/farhanullah5332/gohavenly-full-stack-pro/blob/main/Controllers/review.js"
click node_review_model "https://github.com/farhanullah5332/gohavenly-full-stack-pro/blob/main/Models/review.js"
click node_review_views "https://github.com/farhanullah5332/gohavenly-full-stack-pro/blob/main/views/listings/show.ejs"
click node_user_routes "https://github.com/farhanullah5332/gohavenly-full-stack-pro/blob/main/routes/user.js"
click node_user_controller "https://github.com/farhanullah5332/gohavenly-full-stack-pro/blob/main/Controllers/user.js"
click node_user_model "https://github.com/farhanullah5332/gohavenly-full-stack-pro/blob/main/Models/user.js"
click node_middleware "https://github.com/farhanullah5332/gohavenly-full-stack-pro/blob/main/middleware.js"
click node_schema "https://github.com/farhanullah5332/gohavenly-full-stack-pro/blob/main/Schema.js"
click node_session_store "https://github.com/farhanullah5332/gohavenly-full-stack-pro/blob/main/app.js"
click node_cloud_config "https://github.com/farhanullah5332/gohavenly-full-stack-pro/blob/main/cloudConfig.js"
click node_shared_views "https://github.com/farhanullah5332/gohavenly-full-stack-pro/blob/main/views/layouts/boilarplate.ejs"

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_middleware,node_schema,node_shared_views,node_host toneBlue
class node_listing_routes,node_listing_controller,node_listing_model,node_listing_views,node_cloud_config,node_mongo,node_cloudinary toneAmber
class node_review_routes,node_review_controller,node_review_model,node_review_views toneMint
class node_user_routes,node_user_controller,node_user_model,node_session_store toneRose
class node_guest toneIndigo
```

## Components

### Web application

- [Express app](https://github.com/farhanullah5332/gohavenly-full-stack-pro/blob/main/app.js): `app.js`
- [Access checks](https://github.com/farhanullah5332/gohavenly-full-stack-pro/blob/main/middleware.js): `middleware.js`
- [Request validation](https://github.com/farhanullah5332/gohavenly-full-stack-pro/blob/main/Schema.js): `Schema.js`
- [Shared page layout](https://github.com/farhanullah5332/gohavenly-full-stack-pro/blob/main/views/layouts/boilarplate.ejs): `views/layouts/boilarplate.ejs`

### Listings

- [Listing routes](https://github.com/farhanullah5332/gohavenly-full-stack-pro/blob/main/routes/listing.js): `routes/listing.js`
- [Listing operations](https://github.com/farhanullah5332/gohavenly-full-stack-pro/blob/main/Controllers/listings.js): `Controllers/listings.js`
- [Listing model](https://github.com/farhanullah5332/gohavenly-full-stack-pro/blob/main/Models/listings.js): `Models/listings.js`
- [Listing pages](https://github.com/farhanullah5332/gohavenly-full-stack-pro/tree/main/views/listings): `views/listings`
- [Image storage config](https://github.com/farhanullah5332/gohavenly-full-stack-pro/blob/main/cloudConfig.js): `cloudConfig.js`

### Reviews

- [Review routes](https://github.com/farhanullah5332/gohavenly-full-stack-pro/blob/main/routes/review.js): `routes/review.js`
- [Review operations](https://github.com/farhanullah5332/gohavenly-full-stack-pro/blob/main/Controllers/review.js): `Controllers/review.js`
- [Review model](https://github.com/farhanullah5332/gohavenly-full-stack-pro/blob/main/Models/review.js): `Models/review.js`
- [Review display](https://github.com/farhanullah5332/gohavenly-full-stack-pro/blob/main/views/listings/show.ejs): `views/listings/show.ejs`

### Accounts and sessions

- [User routes](https://github.com/farhanullah5332/gohavenly-full-stack-pro/blob/main/routes/user.js): `routes/user.js`
- [User operations](https://github.com/farhanullah5332/gohavenly-full-stack-pro/blob/main/Controllers/user.js): `Controllers/user.js`
- [User model](https://github.com/farhanullah5332/gohavenly-full-stack-pro/blob/main/Models/user.js): `Models/user.js`
- [Session store](https://github.com/farhanullah5332/gohavenly-full-stack-pro/blob/main/app.js): `app.js`

### Other components

- **Visitor**
- **Signed-in user**
- **MongoDB**
- **Cloudinary**

## Connections

- Visitor → Express app: requests pages
- Signed-in user → Express app: submits actions
- Express app → Listing routes: mounts /listings
- Express app → Review routes: mounts reviews
- Express app → User routes: mounts account routes
- Listing routes → Access checks: checks access
- Listing routes → Request validation: validates input
- Listing routes → Image storage config: configures uploads
- Listing routes → Listing operations: dispatches requests
- Listing operations → Listing model: reads and writes
- Listing model → MongoDB: persists listings
- Listing operations → Listing pages: renders pages
- Review routes → Access checks: checks access
- Review routes → Request validation: validates input
- Review routes → Review operations: dispatches requests
- Review operations → Listing model: updates listing reviews
- Review operations → Review model: creates and deletes
- Review model → MongoDB: persists reviews
- Listing operations → Review display: renders listing detail
- Review display → Review model: displays populated reviews
- User routes → User operations: dispatches account requests
- User operations → User model: uses account records
- User model → MongoDB: persists accounts
- Express app → Session store: stores sessions
- Session store → MongoDB: uses MongoDB
- Image storage config → Cloudinary: stores listing images
- Listing pages → Shared page layout: uses layout
- Review display → Shared page layout: uses layout
