# spandanam04/carrentalmanagementsystem architecture

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

- Interactive diagram: https://gitdiagram.com/spandanam04/carrentalmanagementsystem
- Repository: https://github.com/spandanam04/carrentalmanagementsystem

## Overview

RentalHub is a browser-based car and bike rental management system. Guests browse vehicles or submit inquiries; customers register or sign in, request rentals, and manage their account; administrators manage rentals and the wider catalog and site data. The browser app calls the Express API, which applies session/authentication checks and operates on JSON-backed data. The excerpts establish the main API and rental flow; admin capabilities beyond the sampled routes are included as documented, without assuming unsampled endpoint wiring.

Main entry points: [`server.js`](https://github.com/spandanam04/carrentalmanagementsystem/blob/main/server.js) (HTTP API server), [`data/db.json`](https://github.com/spandanam04/carrentalmanagementsystem/blob/main/data/db.json) (JSON data store), [`public/app.js`](https://github.com/spandanam04/carrentalmanagementsystem/blob/main/public/app.js) (RentalHub interface), [`public/index.html`](https://github.com/spandanam04/carrentalmanagementsystem/blob/main/public/index.html) (Web page shell)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_browser["Browser experience"]
  node_frontend["RentalHub interface<br/>[app.js]"]
  node_static_pages["Web page shell<br/>[index.html]"]
end

subgraph group_api["Express application"]
  node_api_server["HTTP API server<br/>[server.js]"]
  node_auth["Authentication and sessions<br/>[server.js]"]
end

subgraph group_domain["Rental operations"]
  node_catalog["Vehicle and brand catalog<br/>[server.js]"]
  node_rental_requests["Rental requests and history<br/>[server.js]"]
  node_customer_accounts["Customer accounts<br/>[server.js]"]
  node_testimonials["Testimonials<br/>[server.js]"]
  node_inquiries["Contact inquiries<br/>[server.js]"]
  node_newsletter["Newsletter subscriptions<br/>[server.js]"]
  node_admin_management["Admin management<br/>[server.js]"]
end

subgraph group_persistence["Persistence"]
  node_json_data[("JSON data store<br/>[db.json]")]
end

node_visitor(("Guest or customer"))
node_admin_actor(("Administrator"))

node_visitor -->|"uses"| node_frontend
node_admin_actor -->|"manages"| node_frontend
node_frontend -.->|"renders in"| node_static_pages
node_frontend -->|"requests API"| node_api_server
node_api_server -->|"checks sessions"| node_auth
node_api_server -->|"serves catalog"| node_catalog
node_api_server -->|"handles rentals"| node_rental_requests
node_api_server -->|"handles accounts"| node_customer_accounts
node_api_server -->|"handles feedback"| node_testimonials
node_api_server -->|"records inquiries"| node_inquiries
node_api_server -->|"records subscribers"| node_newsletter
node_admin_actor -->|"manages"| node_admin_management
node_api_server -->|"serves admin APIs"| node_admin_management
node_catalog -.->|"reads and writes"| node_json_data
node_rental_requests -->|"reads and writes"| node_json_data
node_customer_accounts -->|"reads and writes"| node_json_data
node_testimonials -->|"reads and writes"| node_json_data
node_inquiries -->|"reads and writes"| node_json_data
node_newsletter -->|"reads and writes"| node_json_data
node_admin_management -.->|"manages data"| node_json_data

click node_frontend "https://github.com/spandanam04/carrentalmanagementsystem/blob/main/public/app.js"
click node_static_pages "https://github.com/spandanam04/carrentalmanagementsystem/blob/main/public/index.html"
click node_api_server "https://github.com/spandanam04/carrentalmanagementsystem/blob/main/server.js"
click node_auth "https://github.com/spandanam04/carrentalmanagementsystem/blob/main/server.js"
click node_catalog "https://github.com/spandanam04/carrentalmanagementsystem/blob/main/server.js"
click node_rental_requests "https://github.com/spandanam04/carrentalmanagementsystem/blob/main/server.js"
click node_customer_accounts "https://github.com/spandanam04/carrentalmanagementsystem/blob/main/server.js"
click node_testimonials "https://github.com/spandanam04/carrentalmanagementsystem/blob/main/server.js"
click node_inquiries "https://github.com/spandanam04/carrentalmanagementsystem/blob/main/server.js"
click node_newsletter "https://github.com/spandanam04/carrentalmanagementsystem/blob/main/server.js"
click node_admin_management "https://github.com/spandanam04/carrentalmanagementsystem/blob/main/server.js"
click node_json_data "https://github.com/spandanam04/carrentalmanagementsystem/blob/main/data/db.json"

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_frontend,node_static_pages toneBlue
class node_api_server,node_auth toneAmber
class node_catalog,node_rental_requests,node_customer_accounts,node_testimonials,node_inquiries,node_newsletter,node_admin_management toneMint
class node_json_data toneRose
class node_visitor,node_admin_actor toneIndigo
```

## Components

### Browser experience

- [RentalHub interface](https://github.com/spandanam04/carrentalmanagementsystem/blob/main/public/app.js): `public/app.js`
- [Web page shell](https://github.com/spandanam04/carrentalmanagementsystem/blob/main/public/index.html): `public/index.html`

### Express application

- [HTTP API server](https://github.com/spandanam04/carrentalmanagementsystem/blob/main/server.js): `server.js`
- [Authentication and sessions](https://github.com/spandanam04/carrentalmanagementsystem/blob/main/server.js): `server.js`

### Rental operations

- [Vehicle and brand catalog](https://github.com/spandanam04/carrentalmanagementsystem/blob/main/server.js): `server.js`
- [Rental requests and history](https://github.com/spandanam04/carrentalmanagementsystem/blob/main/server.js): `server.js`
- [Customer accounts](https://github.com/spandanam04/carrentalmanagementsystem/blob/main/server.js): `server.js`
- [Testimonials](https://github.com/spandanam04/carrentalmanagementsystem/blob/main/server.js): `server.js`
- [Contact inquiries](https://github.com/spandanam04/carrentalmanagementsystem/blob/main/server.js): `server.js`
- [Newsletter subscriptions](https://github.com/spandanam04/carrentalmanagementsystem/blob/main/server.js): `server.js`
- [Admin management](https://github.com/spandanam04/carrentalmanagementsystem/blob/main/server.js): `server.js`

### Persistence

- [JSON data store](https://github.com/spandanam04/carrentalmanagementsystem/blob/main/data/db.json): `data/db.json`

### Other components

- **Guest or customer**
- **Administrator**

## Connections

- Guest or customer → RentalHub interface: uses (evidence: `README.md`)
- Administrator → RentalHub interface: manages (evidence: `README.md`)
- RentalHub interface → Web page shell: renders in
- RentalHub interface → HTTP API server: requests API (evidence: `public/app.js`)
- HTTP API server → Authentication and sessions: checks sessions (evidence: `server.js`)
- HTTP API server → Vehicle and brand catalog: serves catalog (evidence: `server.js`)
- HTTP API server → Rental requests and history: handles rentals (evidence: `server.js`)
- HTTP API server → Customer accounts: handles accounts (evidence: `server.js`)
- HTTP API server → Testimonials: handles feedback (evidence: `server.js`)
- HTTP API server → Contact inquiries: records inquiries (evidence: `server.js`)
- HTTP API server → Newsletter subscriptions: records subscribers (evidence: `server.js`)
- Administrator → Admin management: manages (evidence: `README.md`)
- HTTP API server → Admin management: serves admin APIs (evidence: `server.js`)
- Vehicle and brand catalog → JSON data store: reads and writes
- Rental requests and history → JSON data store: reads and writes (evidence: `server.js`)
- Customer accounts → JSON data store: reads and writes (evidence: `server.js`)
- Testimonials → JSON data store: reads and writes (evidence: `server.js`)
- Contact inquiries → JSON data store: reads and writes (evidence: `server.js`)
- Newsletter subscriptions → JSON data store: reads and writes (evidence: `server.js`)
- Admin management → JSON data store: manages data
