# mithesh6369894902/parkspot architecture

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

- Interactive diagram: https://gitdiagram.com/mithesh6369894902/parkspot
- Repository: https://github.com/mithesh6369894902/parkspot

## Overview

ParkSpot is a parking-land rental portal: customers discover available sites, check capacity and pricing, book and pay, then manage bookings and reviews; owners register land and admins verify it. The supplied tree contains a React web client and Express API, while the README also describes a Flutter app not present in this tree. Edges are limited to relationships visible in excerpts, the source index, or README; some unsampled feature wiring is therefore omitted.

Main entry points: [`client/src/App.jsx`](https://github.com/mithesh6369894902/parkspot/blob/main/client/src/App.jsx) (Web routes), [`server/src/controllers/bookingController.js`](https://github.com/mithesh6369894902/parkspot/blob/main/server/src/controllers/bookingController.js) (Booking and availability), [`server/src/server.js`](https://github.com/mithesh6369894902/parkspot/blob/main/server/src/server.js) (Express API), [`client/src/services/api.js`](https://github.com/mithesh6369894902/parkspot/blob/main/client/src/services/api.js) (API client)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_client["Web experience"]
  node_app["Web routes<br/>[App.jsx]"]
  node_auth_state["Auth state<br/>[AuthContext.jsx]"]
  node_booking_ui["Booking flow<br/>[BookingPage.jsx]"]
  node_land_detail["Land details<br/>[LandDetail.jsx]"]
  node_discovery["Map discovery<br/>[MapExplore.jsx]"]
  node_land_registration["Land registration<br/>[RegisterLand.jsx]"]
  node_home["Home discovery<br/>[Home.jsx]"]
  node_admin_ui["Admin dashboard<br/>[Dashboard.jsx]"]
  node_verification_ui["Land verification"]
  node_api_client["API client<br/>[api.js]"]
end

subgraph group_booking["Booking and payments"]
  node_booking_routes["Booking routes<br/>[booking.js]"]
  node_booking_controller["Booking and availability"]
  node_booking_model[("Booking records<br/>[Booking.js]")]
  node_payment_controller["Payment processing"]
  node_payment_model[("Payment records<br/>[Payment.js]")]
  node_pricing["Dynamic pricing<br/>[pricing.js]"]
end

subgraph group_land["Land and discovery"]
  node_land_routes["Land routes<br/>[land.js]"]
  node_land_controller["Land management<br/>[landController.js]"]
  node_land_model[("Land records<br/>[Land.js]")]
  node_reviews["Reviews"]
  node_review_model[("Review records<br/>[Review.js]")]
end

subgraph group_identity["Identity and operations"]
  node_auth_routes["Auth routes<br/>[auth.js]"]
  node_auth_controller["Auth logic<br/>[authController.js]"]
  node_auth_middleware["JWT authorization<br/>[auth.js]"]
  node_admin_routes["Admin routes<br/>[admin.js]"]
  node_admin_controller["Admin operations<br/>[adminController.js]"]
  node_support_routes["Support routes<br/>[support.js]"]
  node_support_controller["Dispute handling"]
  node_dispute_model[("Dispute records<br/>[Dispute.js]")]
  node_user_model[("User records<br/>[User.js]")]
end

subgraph group_backend["API and persistence"]
  node_api_server["Express API<br/>[server.js]"]
end

node_visitor(("Customer or owner"))
node_admin_user(("Administrator"))
node_razorpay["Razorpay"]

node_visitor -->|"uses"| node_app
node_admin_user -->|"uses"| node_app
node_app -->|"checks access"| node_auth_state
node_app -->|"routes to"| node_home
node_app -->|"routes to"| node_discovery
node_app -->|"routes to"| node_land_detail
node_app -->|"routes to"| node_booking_ui
node_app -->|"routes to"| node_land_registration
node_app -->|"routes to"| node_admin_ui
node_app -->|"routes to"| node_verification_ui
node_auth_state -->|"requests auth"| node_api_client
node_home -->|"loads lands"| node_api_client
node_discovery -->|"loads lands"| node_api_client
node_land_registration -->|"submits land"| node_api_client
node_api_client -.->|"HTTP requests"| node_api_server
node_api_server -->|"mounts"| node_auth_routes
node_api_server -->|"mounts"| node_land_routes
node_api_server -->|"mounts"| node_booking_routes
node_api_server -->|"mounts"| node_admin_routes
node_api_server -->|"mounts"| node_support_routes
node_auth_routes -->|"dispatches"| node_auth_controller
node_auth_routes -->|"protects routes"| node_auth_middleware
node_auth_controller -.->|"uses users"| node_user_model
node_auth_middleware -->|"loads user"| node_user_model
node_land_routes -.->|"dispatches"| node_land_controller
node_land_controller -->|"reads and writes"| node_land_model
node_booking_routes -.->|"dispatches"| node_booking_controller
node_booking_controller -->|"reads and writes"| node_booking_model
node_booking_controller -->|"checks land"| node_land_model
node_booking_controller -->|"calculates price"| node_pricing
node_booking_controller -->|"checks payment"| node_payment_model
node_booking_controller -->|"requests refund"| node_razorpay
node_payment_controller -->|"records payment"| node_payment_model
node_payment_controller -->|"updates booking"| node_booking_model
node_payment_controller -->|"uses gateway"| node_razorpay
node_admin_routes -.->|"dispatches"| node_admin_controller
node_admin_controller -->|"reads disputes"| node_dispute_model
node_support_routes -.->|"dispatches"| node_support_controller
node_support_controller -->|"creates disputes"| node_dispute_model
node_reviews -->|"reads and writes"| node_review_model
node_reviews -->|"updates ratings"| node_land_model

click node_app "https://github.com/mithesh6369894902/parkspot/blob/main/client/src/App.jsx"
click node_auth_state "https://github.com/mithesh6369894902/parkspot/blob/main/client/src/context/AuthContext.jsx"
click node_booking_ui "https://github.com/mithesh6369894902/parkspot/blob/main/client/src/pages/BookingPage.jsx"
click node_land_detail "https://github.com/mithesh6369894902/parkspot/blob/main/client/src/pages/LandDetail.jsx"
click node_discovery "https://github.com/mithesh6369894902/parkspot/blob/main/client/src/pages/MapExplore.jsx"
click node_land_registration "https://github.com/mithesh6369894902/parkspot/blob/main/client/src/pages/RegisterLand.jsx"
click node_home "https://github.com/mithesh6369894902/parkspot/blob/main/client/src/pages/Home.jsx"
click node_admin_ui "https://github.com/mithesh6369894902/parkspot/blob/main/client/src/pages/admin/Dashboard.jsx"
click node_verification_ui "https://github.com/mithesh6369894902/parkspot/blob/main/client/src/pages/admin/LandVerification.jsx"
click node_api_client "https://github.com/mithesh6369894902/parkspot/blob/main/client/src/services/api.js"
click node_api_server "https://github.com/mithesh6369894902/parkspot/blob/main/server/src/server.js"
click node_auth_routes "https://github.com/mithesh6369894902/parkspot/blob/main/server/src/routes/auth.js"
click node_auth_controller "https://github.com/mithesh6369894902/parkspot/blob/main/server/src/controllers/authController.js"
click node_auth_middleware "https://github.com/mithesh6369894902/parkspot/blob/main/server/src/middleware/auth.js"
click node_land_routes "https://github.com/mithesh6369894902/parkspot/blob/main/server/src/routes/land.js"
click node_land_controller "https://github.com/mithesh6369894902/parkspot/blob/main/server/src/controllers/landController.js"
click node_land_model "https://github.com/mithesh6369894902/parkspot/blob/main/server/src/models/Land.js"
click node_booking_routes "https://github.com/mithesh6369894902/parkspot/blob/main/server/src/routes/booking.js"
click node_booking_controller "https://github.com/mithesh6369894902/parkspot/blob/main/server/src/controllers/bookingController.js"
click node_booking_model "https://github.com/mithesh6369894902/parkspot/blob/main/server/src/models/Booking.js"
click node_payment_controller "https://github.com/mithesh6369894902/parkspot/blob/main/server/src/controllers/paymentController.js"
click node_payment_model "https://github.com/mithesh6369894902/parkspot/blob/main/server/src/models/Payment.js"
click node_pricing "https://github.com/mithesh6369894902/parkspot/blob/main/server/src/utils/pricing.js"
click node_reviews "https://github.com/mithesh6369894902/parkspot/blob/main/server/src/controllers/reviewController.js"
click node_review_model "https://github.com/mithesh6369894902/parkspot/blob/main/server/src/models/Review.js"
click node_admin_routes "https://github.com/mithesh6369894902/parkspot/blob/main/server/src/routes/admin.js"
click node_admin_controller "https://github.com/mithesh6369894902/parkspot/blob/main/server/src/controllers/adminController.js"
click node_support_routes "https://github.com/mithesh6369894902/parkspot/blob/main/server/src/routes/support.js"
click node_support_controller "https://github.com/mithesh6369894902/parkspot/blob/main/server/src/controllers/supportController.js"
click node_dispute_model "https://github.com/mithesh6369894902/parkspot/blob/main/server/src/models/Dispute.js"
click node_user_model "https://github.com/mithesh6369894902/parkspot/blob/main/server/src/models/User.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_auth_state,node_booking_ui,node_land_detail,node_discovery,node_land_registration,node_home,node_admin_ui,node_verification_ui,node_api_client toneBlue
class node_booking_routes,node_booking_controller,node_booking_model,node_payment_controller,node_payment_model,node_pricing toneAmber
class node_land_routes,node_land_controller,node_land_model,node_reviews,node_review_model toneMint
class node_auth_routes,node_auth_controller,node_auth_middleware,node_admin_routes,node_admin_controller,node_support_routes,node_support_controller,node_dispute_model,node_user_model toneRose
class node_api_server,node_visitor,node_admin_user,node_razorpay toneIndigo
```

## Components

### Web experience

- [Web routes](https://github.com/mithesh6369894902/parkspot/blob/main/client/src/App.jsx): `client/src/App.jsx`
- [Auth state](https://github.com/mithesh6369894902/parkspot/blob/main/client/src/context/AuthContext.jsx): `client/src/context/AuthContext.jsx`
- [Booking flow](https://github.com/mithesh6369894902/parkspot/blob/main/client/src/pages/BookingPage.jsx): `client/src/pages/BookingPage.jsx`
- [Land details](https://github.com/mithesh6369894902/parkspot/blob/main/client/src/pages/LandDetail.jsx): `client/src/pages/LandDetail.jsx`
- [Map discovery](https://github.com/mithesh6369894902/parkspot/blob/main/client/src/pages/MapExplore.jsx): `client/src/pages/MapExplore.jsx`
- [Land registration](https://github.com/mithesh6369894902/parkspot/blob/main/client/src/pages/RegisterLand.jsx): `client/src/pages/RegisterLand.jsx`
- [Home discovery](https://github.com/mithesh6369894902/parkspot/blob/main/client/src/pages/Home.jsx): `client/src/pages/Home.jsx`
- [Admin dashboard](https://github.com/mithesh6369894902/parkspot/blob/main/client/src/pages/admin/Dashboard.jsx): `client/src/pages/admin/Dashboard.jsx`
- [Land verification](https://github.com/mithesh6369894902/parkspot/blob/main/client/src/pages/admin/LandVerification.jsx): `client/src/pages/admin/LandVerification.jsx`
- [API client](https://github.com/mithesh6369894902/parkspot/blob/main/client/src/services/api.js): `client/src/services/api.js`

### Booking and payments

- [Booking routes](https://github.com/mithesh6369894902/parkspot/blob/main/server/src/routes/booking.js): `server/src/routes/booking.js`
- [Booking and availability](https://github.com/mithesh6369894902/parkspot/blob/main/server/src/controllers/bookingController.js): `server/src/controllers/bookingController.js`
- [Booking records](https://github.com/mithesh6369894902/parkspot/blob/main/server/src/models/Booking.js): `server/src/models/Booking.js`
- [Payment processing](https://github.com/mithesh6369894902/parkspot/blob/main/server/src/controllers/paymentController.js): `server/src/controllers/paymentController.js`
- [Payment records](https://github.com/mithesh6369894902/parkspot/blob/main/server/src/models/Payment.js): `server/src/models/Payment.js`
- [Dynamic pricing](https://github.com/mithesh6369894902/parkspot/blob/main/server/src/utils/pricing.js): `server/src/utils/pricing.js`

### Land and discovery

- [Land routes](https://github.com/mithesh6369894902/parkspot/blob/main/server/src/routes/land.js): `server/src/routes/land.js`
- [Land management](https://github.com/mithesh6369894902/parkspot/blob/main/server/src/controllers/landController.js): `server/src/controllers/landController.js`
- [Land records](https://github.com/mithesh6369894902/parkspot/blob/main/server/src/models/Land.js): `server/src/models/Land.js`
- [Reviews](https://github.com/mithesh6369894902/parkspot/blob/main/server/src/controllers/reviewController.js): `server/src/controllers/reviewController.js`
- [Review records](https://github.com/mithesh6369894902/parkspot/blob/main/server/src/models/Review.js): `server/src/models/Review.js`

### Identity and operations

- [Auth routes](https://github.com/mithesh6369894902/parkspot/blob/main/server/src/routes/auth.js): `server/src/routes/auth.js`
- [Auth logic](https://github.com/mithesh6369894902/parkspot/blob/main/server/src/controllers/authController.js): `server/src/controllers/authController.js`
- [JWT authorization](https://github.com/mithesh6369894902/parkspot/blob/main/server/src/middleware/auth.js): `server/src/middleware/auth.js`
- [Admin routes](https://github.com/mithesh6369894902/parkspot/blob/main/server/src/routes/admin.js): `server/src/routes/admin.js`
- [Admin operations](https://github.com/mithesh6369894902/parkspot/blob/main/server/src/controllers/adminController.js): `server/src/controllers/adminController.js`
- [Support routes](https://github.com/mithesh6369894902/parkspot/blob/main/server/src/routes/support.js): `server/src/routes/support.js`
- [Dispute handling](https://github.com/mithesh6369894902/parkspot/blob/main/server/src/controllers/supportController.js): `server/src/controllers/supportController.js`
- [Dispute records](https://github.com/mithesh6369894902/parkspot/blob/main/server/src/models/Dispute.js): `server/src/models/Dispute.js`
- [User records](https://github.com/mithesh6369894902/parkspot/blob/main/server/src/models/User.js): `server/src/models/User.js`

### API and persistence

- [Express API](https://github.com/mithesh6369894902/parkspot/blob/main/server/src/server.js): `server/src/server.js`

### Other components

- **Customer or owner**
- **Administrator**
- **Razorpay**

## Connections

- Customer or owner → Web routes: uses (evidence: `client/src/App.jsx`)
- Administrator → Web routes: uses (evidence: `client/src/App.jsx`)
- Web routes → Auth state: checks access (evidence: `client/src/App.jsx`)
- Web routes → Home discovery: routes to (evidence: `client/src/App.jsx`)
- Web routes → Map discovery: routes to (evidence: `client/src/App.jsx`)
- Web routes → Land details: routes to (evidence: `client/src/App.jsx`)
- Web routes → Booking flow: routes to (evidence: `client/src/App.jsx`)
- Web routes → Land registration: routes to (evidence: `client/src/App.jsx`)
- Web routes → Admin dashboard: routes to (evidence: `client/src/App.jsx`)
- Web routes → Land verification: routes to (evidence: `client/src/App.jsx`)
- Auth state → API client: requests auth (evidence: `client/src/context/AuthContext.jsx`)
- Home discovery → API client: loads lands (evidence: `client/src/pages/Home.jsx`)
- Map discovery → API client: loads lands (evidence: `client/src/pages/MapExplore.jsx`)
- Land registration → API client: submits land (evidence: `client/src/pages/RegisterLand.jsx`)
- API client → Express API: HTTP requests
- Express API → Auth routes: mounts (evidence: `server/src/server.js`)
- Express API → Land routes: mounts (evidence: `server/src/server.js`)
- Express API → Booking routes: mounts (evidence: `server/src/server.js`)
- Express API → Admin routes: mounts (evidence: `server/src/server.js`)
- Express API → Support routes: mounts (evidence: `server/src/server.js`)
- Auth routes → Auth logic: dispatches (evidence: `server/src/routes/auth.js`)
- Auth routes → JWT authorization: protects routes (evidence: `server/src/routes/auth.js`)
- Auth logic → User records: uses users (evidence: `server/src/controllers/authController.js`)
- JWT authorization → User records: loads user (evidence: `server/src/middleware/auth.js`)
- Land routes → Land management: dispatches
- Land management → Land records: reads and writes (evidence: `server/src/controllers/landController.js`)
- Booking routes → Booking and availability: dispatches
- Booking and availability → Booking records: reads and writes (evidence: `server/src/controllers/bookingController.js`)
- Booking and availability → Land records: checks land (evidence: `server/src/controllers/bookingController.js`)
- Booking and availability → Dynamic pricing: calculates price (evidence: `server/src/controllers/bookingController.js`)
- Booking and availability → Payment records: checks payment (evidence: `server/src/controllers/bookingController.js`)
- Booking and availability → Razorpay: requests refund (evidence: `server/src/controllers/bookingController.js`)
- Payment processing → Payment records: records payment (evidence: `server/src/controllers/paymentController.js`)
- Payment processing → Booking records: updates booking (evidence: `server/src/controllers/paymentController.js`)
- Payment processing → Razorpay: uses gateway (evidence: `server/src/controllers/paymentController.js`)
- Admin routes → Admin operations: dispatches
- Admin operations → Dispute records: reads disputes (evidence: `server/src/controllers/adminController.js`)
- Support routes → Dispute handling: dispatches
- Dispute handling → Dispute records: creates disputes (evidence: `server/src/controllers/supportController.js`)
- Reviews → Review records: reads and writes (evidence: `server/src/controllers/reviewController.js`)
- Reviews → Land records: updates ratings (evidence: `server/src/controllers/reviewController.js`)
