# parmesh-bhatt/furniture-rentals architecture

> Architecture diagram of the GitHub repository parmesh-bhatt/furniture-rentals, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-08-22). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/parmesh-bhatt/furniture-rentals
- Repository: https://github.com/parmesh-bhatt/furniture-rentals

## Overview

#### Purpose and Topology
This is a full-stack furniture-rental application. A React/Vite single-page client lets users browse products, manage accounts, book rentals, and complete payments; an Express API persists users, products, and bookings in MongoDB. Repository roots separate deployable client and server applications: `client/src/main.jsx`, `server/index.js`, and `vercel.json`.

#### Client Application Entry and Navigation
The browser application starts at `client/src/main.jsx` and composes its screens from `client/src/App.jsx`. Feature views cover public catalog and product detail flows, authentication/profile flows, and rental/payment confirmation: `client/src/components/Products.jsx`, `client/src/components/Product-Single.jsx`, and `client/src/components/PaymentVerify.jsx`. `client/src/backend.jsx` is the likely client-to-API boundary.

#### Catalog and Product Management
Products are the central rentable inventory domain. Customer-facing browsing and detail presentation reside in `client/src/components/Products.jsx` and `client/src/components/Product-Single.jsx`; server product CRUD is exposed through `server/src/routes/productRoute.js` and modeled in `server/src/model/product.js`. Administrative product creation is isolated in `client/src/components/Admin/CreateProduct.jsx`, separating catalog administration from consumer flows.

#### Identity and Access Boundary
User registration, sign-in, password recovery, and profile management are client concerns represented by `client/src/components/SignUp.jsx`, `client/src/components/SignIn.jsx`, and `client/src/components/Profile.jsx`. The API owns account persistence and authentication endpoints in `server/src/routes/userRoute.js` and `server/src/model/user.js`. JWT-based request protection is centralized in `server/src/middlewares/auth.js`, creating the authorization boundary for protected API operations.

#### Rental Booking Lifecycle
A rental is represented as a booking connecting a user and furniture/product for a requested period. Client dashboard surfaces likely provide rental/account state via `client/src/components/Dashboard.jsx` and `client/src/components/Setting.jsx`. Booking creation and retrieval are handled server-side by `server/src/routes/bookRoute.js`, with durable booking records defined in `server/src/model/booking.js`.

#### Payment Integration
Payment is a distinct stage after or alongside booking. The client receives/verifies the payment outcome in `client/src/components/PaymentVerify.jsx`; payment API endpoints are isolated in `server/src/routes/paymentRoute.js`. Razorpay is the declared external payment service, so payment-provider interaction belongs behind this server route boundary rather than in persisted frontend state.

#### Runtime and Infrastructure
The frontend runs as a Vite-built React application with Tailwind/PostCSS styling configuration in `client/vite.config.js` and `client/tailwind.config.js`. The backend is Node.js/Express, bootstrapped in `server/index.js`, with MongoDB connection setup isolated in `server/config/connect.js`. Mongoose models in `server/src/model/user.js`, `server/src/model/product.js`, and `server/src/model/booking.js` form the persistence boundary; CORS enables browser-to-API access.

Main entry points: [`client/src/backend.jsx`](https://github.com/parmesh-bhatt/furniture-rentals/blob/main/client/src/backend.jsx) (API client boundary), [`client/src/App.jsx`](https://github.com/parmesh-bhatt/furniture-rentals/blob/main/client/src/App.jsx) (App navigation), [`server/index.js`](https://github.com/parmesh-bhatt/furniture-rentals/blob/main/server/index.js) (API bootstrap), [`client/src/components/Products.jsx`](https://github.com/parmesh-bhatt/furniture-rentals/blob/main/client/src/components/Products.jsx) (Catalog and detail)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_client["React client"]
  node_client_entry["Client entry<br/>React bootstrap<br/>[main.jsx]"]
  node_client_app["App navigation<br/>React app<br/>[App.jsx]"]
  node_catalog_ui["Catalog and detail<br/>customer views<br/>[Products.jsx]"]
  node_product_detail["Product detail<br/>customer view<br/>[Product-Single.jsx]"]
  node_admin_products["Product creation<br/>admin view<br/>[CreateProduct.jsx]"]
  node_identity_ui["Account flows<br/>auth views<br/>[SignIn.jsx]"]
  node_rental_ui["Rental dashboard<br/>account view<br/>[Dashboard.jsx]"]
  node_payment_ui["Payment verification<br/>payment view<br/>[PaymentVerify.jsx]"]
  node_api_client["API client boundary<br/>client backend<br/>[backend.jsx]"]
end

subgraph group_api["Express API"]
  node_server_entry{{"API bootstrap<br/>Express runtime<br/>[index.js]"}}
  node_auth_guard["JWT authorization<br/>Express middleware<br/>[auth.js]"]
  node_user_api["User endpoints<br/>Express routes<br/>[userRoute.js]"]
  node_product_api["Product CRUD<br/>Express routes<br/>[productRoute.js]"]
  node_booking_api["Booking lifecycle<br/>Express routes<br/>[bookRoute.js]"]
  node_payment_api["Payment endpoints<br/>Express routes<br/>[paymentRoute.js]"]
end

subgraph group_data["Persistence"]
  node_user_model[("User model<br/>Mongoose model<br/>[user.js]")]
  node_product_model[("Product model<br/>Mongoose model<br/>[product.js]")]
  node_booking_model[("Booking model<br/>Mongoose model<br/>[booking.js]")]
  node_mongodb[("MongoDB<br/>database<br/>[connect.js]")]
end

node_razorpay{{"Razorpay<br/>payment provider"}}

node_client_entry -->|"mounts"| node_client_app
node_client_app -->|"renders"| node_catalog_ui
node_catalog_ui -->|"opens product"| node_product_detail
node_client_app -->|"routes to"| node_identity_ui
node_client_app -->|"routes to"| node_rental_ui
node_client_app -->|"routes to"| node_payment_ui
node_catalog_ui -->|"loads inventory"| node_api_client
node_admin_products -->|"manages inventory"| node_api_client
node_identity_ui -->|"account requests"| node_api_client
node_rental_ui -->|"booking requests"| node_api_client
node_payment_ui -->|"verifies payment"| node_api_client
node_api_client -->|"HTTP/CORS"| node_server_entry
node_server_entry -->|"mounts"| node_user_api
node_server_entry -->|"mounts"| node_product_api
node_server_entry -->|"mounts"| node_booking_api
node_server_entry -->|"mounts"| node_payment_api
node_auth_guard -.->|"guards protected access"| node_user_api
node_auth_guard -.->|"guards rental operations"| node_booking_api
node_product_api -->|"CRUD"| node_product_model
node_user_api -->|"accounts"| node_user_model
node_booking_api -->|"rental records"| node_booking_model
node_payment_api -->|"payment provider API"| node_razorpay
node_user_model -->|"persists"| node_mongodb
node_product_model -->|"persists"| node_mongodb
node_booking_model -->|"persists"| node_mongodb

click node_client_entry "https://github.com/parmesh-bhatt/furniture-rentals/blob/main/client/src/main.jsx"
click node_client_app "https://github.com/parmesh-bhatt/furniture-rentals/blob/main/client/src/App.jsx"
click node_catalog_ui "https://github.com/parmesh-bhatt/furniture-rentals/blob/main/client/src/components/Products.jsx"
click node_product_detail "https://github.com/parmesh-bhatt/furniture-rentals/blob/main/client/src/components/Product-Single.jsx"
click node_admin_products "https://github.com/parmesh-bhatt/furniture-rentals/blob/main/client/src/components/Admin/CreateProduct.jsx"
click node_identity_ui "https://github.com/parmesh-bhatt/furniture-rentals/blob/main/client/src/components/SignIn.jsx"
click node_rental_ui "https://github.com/parmesh-bhatt/furniture-rentals/blob/main/client/src/components/Dashboard.jsx"
click node_payment_ui "https://github.com/parmesh-bhatt/furniture-rentals/blob/main/client/src/components/PaymentVerify.jsx"
click node_api_client "https://github.com/parmesh-bhatt/furniture-rentals/blob/main/client/src/backend.jsx"
click node_server_entry "https://github.com/parmesh-bhatt/furniture-rentals/blob/main/server/index.js"
click node_auth_guard "https://github.com/parmesh-bhatt/furniture-rentals/blob/main/server/src/middlewares/auth.js"
click node_user_api "https://github.com/parmesh-bhatt/furniture-rentals/blob/main/server/src/routes/userRoute.js"
click node_product_api "https://github.com/parmesh-bhatt/furniture-rentals/blob/main/server/src/routes/productRoute.js"
click node_booking_api "https://github.com/parmesh-bhatt/furniture-rentals/blob/main/server/src/routes/bookRoute.js"
click node_payment_api "https://github.com/parmesh-bhatt/furniture-rentals/blob/main/server/src/routes/paymentRoute.js"
click node_user_model "https://github.com/parmesh-bhatt/furniture-rentals/blob/main/server/src/model/user.js"
click node_product_model "https://github.com/parmesh-bhatt/furniture-rentals/blob/main/server/src/model/product.js"
click node_booking_model "https://github.com/parmesh-bhatt/furniture-rentals/blob/main/server/src/model/booking.js"
click node_mongodb "https://github.com/parmesh-bhatt/furniture-rentals/blob/main/server/config/connect.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_client_entry,node_client_app,node_catalog_ui,node_product_detail,node_admin_products,node_identity_ui,node_rental_ui,node_payment_ui,node_api_client toneBlue
class node_server_entry,node_auth_guard,node_user_api,node_product_api,node_booking_api,node_payment_api toneAmber
class node_user_model,node_product_model,node_booking_model,node_mongodb toneMint
class node_razorpay toneNeutral
```

## Components

### React client

Vite single-page application.

- [Client entry](https://github.com/parmesh-bhatt/furniture-rentals/blob/main/client/src/main.jsx): React bootstrap · `client/src/main.jsx`
- [App navigation](https://github.com/parmesh-bhatt/furniture-rentals/blob/main/client/src/App.jsx): React app · `client/src/App.jsx`
- [Catalog and detail](https://github.com/parmesh-bhatt/furniture-rentals/blob/main/client/src/components/Products.jsx): customer views · `client/src/components/Products.jsx`
- [Product detail](https://github.com/parmesh-bhatt/furniture-rentals/blob/main/client/src/components/Product-Single.jsx): customer view · `client/src/components/Product-Single.jsx`
- [Product creation](https://github.com/parmesh-bhatt/furniture-rentals/blob/main/client/src/components/Admin/CreateProduct.jsx): admin view · `client/src/components/Admin/CreateProduct.jsx`
- [Account flows](https://github.com/parmesh-bhatt/furniture-rentals/blob/main/client/src/components/SignIn.jsx): auth views · Registration, sign-in, and profile management. · `client/src/components/SignIn.jsx`
- [Rental dashboard](https://github.com/parmesh-bhatt/furniture-rentals/blob/main/client/src/components/Dashboard.jsx): account view · `client/src/components/Dashboard.jsx`
- [Payment verification](https://github.com/parmesh-bhatt/furniture-rentals/blob/main/client/src/components/PaymentVerify.jsx): payment view · `client/src/components/PaymentVerify.jsx`
- [API client boundary](https://github.com/parmesh-bhatt/furniture-rentals/blob/main/client/src/backend.jsx): client backend · `client/src/backend.jsx`

### Express API

Node.js backend and domain endpoints.

- [API bootstrap](https://github.com/parmesh-bhatt/furniture-rentals/blob/main/server/index.js): Express runtime · Configures Express, CORS, routes, and database connection. · `server/index.js`
- [JWT authorization](https://github.com/parmesh-bhatt/furniture-rentals/blob/main/server/src/middlewares/auth.js): Express middleware · Protects authenticated API operations. · `server/src/middlewares/auth.js`
- [User endpoints](https://github.com/parmesh-bhatt/furniture-rentals/blob/main/server/src/routes/userRoute.js): Express routes · `server/src/routes/userRoute.js`
- [Product CRUD](https://github.com/parmesh-bhatt/furniture-rentals/blob/main/server/src/routes/productRoute.js): Express routes · `server/src/routes/productRoute.js`
- [Booking lifecycle](https://github.com/parmesh-bhatt/furniture-rentals/blob/main/server/src/routes/bookRoute.js): Express routes · Creates and retrieves rentals. · `server/src/routes/bookRoute.js`
- [Payment endpoints](https://github.com/parmesh-bhatt/furniture-rentals/blob/main/server/src/routes/paymentRoute.js): Express routes · Server-side boundary for Razorpay interaction. · `server/src/routes/paymentRoute.js`

### Persistence

MongoDB-backed Mongoose models.

- [User model](https://github.com/parmesh-bhatt/furniture-rentals/blob/main/server/src/model/user.js): Mongoose model · `server/src/model/user.js`
- [Product model](https://github.com/parmesh-bhatt/furniture-rentals/blob/main/server/src/model/product.js): Mongoose model · `server/src/model/product.js`
- [Booking model](https://github.com/parmesh-bhatt/furniture-rentals/blob/main/server/src/model/booking.js): Mongoose model · Links a user, product, and rental period. · `server/src/model/booking.js`
- [MongoDB](https://github.com/parmesh-bhatt/furniture-rentals/blob/main/server/config/connect.js): database · Connected by the server runtime. · `server/config/connect.js`

### Other components

- **Razorpay**: payment provider

## Connections

- Client entry → App navigation: mounts
- App navigation → Catalog and detail: renders
- Catalog and detail → Product detail: opens product
- App navigation → Account flows: routes to
- App navigation → Rental dashboard: routes to
- App navigation → Payment verification: routes to
- Catalog and detail → API client boundary: loads inventory
- Product creation → API client boundary: manages inventory
- Account flows → API client boundary: account requests
- Rental dashboard → API client boundary: booking requests
- Payment verification → API client boundary: verifies payment
- API client boundary → API bootstrap: HTTP/CORS
- API bootstrap → User endpoints: mounts
- API bootstrap → Product CRUD: mounts
- API bootstrap → Booking lifecycle: mounts
- API bootstrap → Payment endpoints: mounts
- JWT authorization → User endpoints: guards protected access
- JWT authorization → Booking lifecycle: guards rental operations
- Product CRUD → Product model: CRUD
- User endpoints → User model: accounts
- Booking lifecycle → Booking model: rental records
- Payment endpoints → Razorpay: payment provider API
- User model → MongoDB: persists
- Product model → MongoDB: persists
- Booking model → MongoDB: persists
