# oceankumar/parkease architecture

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

- Interactive diagram: https://gitdiagram.com/oceankumar/parkease
- Repository: https://github.com/oceankumar/parkease

## Overview

ParkEase is a mall-parking management application: drivers discover approved malls, check published bay availability for a time window, reserve, and manage bookings; mall owners submit accounts and mall profiles, then maintain parking inventory after approval. Admins approve owners and mall submissions. The React client calls an Express API backed by MongoDB. The graph combines sampled source relationships with README-documented capabilities; several feature routes and pages were not sampled, so those links rely on README evidence rather than inferred call chains.

Main entry points: [`client/src/App.jsx`](https://github.com/oceankumar/parkease/blob/main/client/src/App.jsx) (Page router), [`client/src/services/api.js`](https://github.com/oceankumar/parkease/blob/main/client/src/services/api.js) (Fetch client), [`server/src/models/Booking.js`](https://github.com/oceankumar/parkease/blob/main/server/src/models/Booking.js) (Booking records), [`server/src/models/Mall.js`](https://github.com/oceankumar/parkease/blob/main/server/src/models/Mall.js) (Mall records)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_client["Web application"]
  node_app["Page router<br/>[App.jsx]"]
  node_session["Session state<br/>[AuthContext.jsx]"]
  node_clientauth["Auth client<br/>[authService.js]"]
  node_discovery["Mall discovery"]
  node_availability["Bay availability"]
  node_driverbooking["Driver bookings<br/>[DashboardPage.jsx]"]
  node_ownerui["Owner workspace"]
  node_adminui["Admin review<br/>[ReviewQueue.jsx]"]
  node_api["Fetch client<br/>[api.js]"]
end

subgraph group_identity["Identity and approval"]
  node_authapi["Authentication API<br/>[authService.js]"]
  node_authroutes["Auth endpoints<br/>[authRoutes.js]"]
  node_access["Access control<br/>[authenticate.js]"]
  node_approval["Account approvals<br/>[adminRoutes.js]"]
end

subgraph group_parking["Parking and bookings"]
  node_mallapi["Mall profiles<br/>[mallRoutes.js]"]
  node_inventory["Bay inventory"]
  node_bookingapi["Reservations<br/>[bookingRoutes.js]"]
  node_bookinglife["Booking lifecycle"]
end

subgraph group_operations["Operations and reporting"]
  node_guards["Guard operations<br/>[guardRoutes.js]"]
  node_analytics["Analytics<br/>[analyticsRoutes.js]"]
end

subgraph group_persistence["API and persistence"]
  node_server["Express application<br/>[app.js]"]
  node_database[("MongoDB")]
  node_mallmodel["Mall records<br/>[Mall.js]"]
  node_bookingmodel["Booking records<br/>[Booking.js]"]
  node_usermodel["User records<br/>[User.js]"]
end

node_visitor(("Drivers and owners"))
node_admin(("Mall administrators"))

node_visitor -->|"uses"| node_app
node_admin -->|"uses"| node_app
node_app -->|"wraps"| node_session
node_session -->|"restores session"| node_clientauth
node_clientauth -->|"requests"| node_api
node_app -->|"routes to"| node_discovery
node_app -->|"routes to"| node_availability
node_app -->|"routes to"| node_driverbooking
node_app -->|"routes to"| node_ownerui
node_app -->|"routes to"| node_adminui
node_discovery -.->|"loads mall data"| node_api
node_availability -.->|"loads availability"| node_api
node_driverbooking -.->|"manages bookings"| node_api
node_ownerui -.->|"manages malls"| node_api
node_adminui -.->|"reviews accounts"| node_api
node_api -->|"calls REST API"| node_server
node_server -->|"mounts routes"| node_authroutes
node_authroutes -.->|"delegates"| node_authapi
node_authapi -->|"reads and writes"| node_usermodel
node_authapi -->|"persists sessions"| node_database
node_authroutes -.->|"authenticates requests"| node_access
node_approval -->|"reviews owners"| node_usermodel
node_approval -->|"reviews submissions"| node_mallmodel
node_mallapi -->|"reads and writes"| node_mallmodel
node_mallapi -->|"checks reservations"| node_bookingmodel
node_inventory -->|"updates layouts"| node_mallmodel
node_inventory -->|"checks bay conflicts"| node_bookingmodel
node_bookingapi -->|"creates and reads"| node_bookingmodel
node_bookingapi -->|"serializes bookings"| node_bookinglife
node_bookingapi -->|"checks mall bays"| node_mallmodel
node_bookingapi -->|"transacts reservations"| node_database
node_bookinglife -.->|"manages lifecycle"| node_bookingmodel
node_guards -.->|"supports gate work"| node_bookingmodel
node_analytics -.->|"reports parking activity"| node_database
node_mallmodel -->|"stores mall data"| node_database
node_bookingmodel -->|"stores reservations"| node_database
node_usermodel -->|"stores accounts"| node_database

click node_app "https://github.com/oceankumar/parkease/blob/main/client/src/App.jsx"
click node_session "https://github.com/oceankumar/parkease/blob/main/client/src/context/AuthContext.jsx"
click node_clientauth "https://github.com/oceankumar/parkease/blob/main/client/src/services/authService.js"
click node_discovery "https://github.com/oceankumar/parkease/blob/main/client/src/pages/MallDiscoveryPage.jsx"
click node_availability "https://github.com/oceankumar/parkease/blob/main/client/src/pages/ParkingAvailabilityPage.jsx"
click node_driverbooking "https://github.com/oceankumar/parkease/blob/main/client/src/pages/DashboardPage.jsx"
click node_ownerui "https://github.com/oceankumar/parkease/blob/main/client/src/pages/AccountDashboard.jsx"
click node_adminui "https://github.com/oceankumar/parkease/blob/main/client/src/components/ReviewQueue.jsx"
click node_api "https://github.com/oceankumar/parkease/blob/main/client/src/services/api.js"
click node_authapi "https://github.com/oceankumar/parkease/blob/main/server/src/services/authService.js"
click node_authroutes "https://github.com/oceankumar/parkease/blob/main/server/src/routes/authRoutes.js"
click node_access "https://github.com/oceankumar/parkease/blob/main/server/src/middleware/authenticate.js"
click node_approval "https://github.com/oceankumar/parkease/blob/main/server/src/routes/adminRoutes.js"
click node_mallapi "https://github.com/oceankumar/parkease/blob/main/server/src/routes/mallRoutes.js"
click node_inventory "https://github.com/oceankumar/parkease/tree/main/server/src/routes"
click node_bookingapi "https://github.com/oceankumar/parkease/blob/main/server/src/routes/bookingRoutes.js"
click node_bookinglife "https://github.com/oceankumar/parkease/blob/main/server/src/services/bookingLifecycle.js"
click node_guards "https://github.com/oceankumar/parkease/blob/main/server/src/routes/guardRoutes.js"
click node_analytics "https://github.com/oceankumar/parkease/blob/main/server/src/routes/analyticsRoutes.js"
click node_server "https://github.com/oceankumar/parkease/blob/main/server/src/app.js"
click node_mallmodel "https://github.com/oceankumar/parkease/blob/main/server/src/models/Mall.js"
click node_bookingmodel "https://github.com/oceankumar/parkease/blob/main/server/src/models/Booking.js"
click node_usermodel "https://github.com/oceankumar/parkease/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_session,node_clientauth,node_discovery,node_availability,node_driverbooking,node_ownerui,node_adminui,node_api toneBlue
class node_authapi,node_authroutes,node_access,node_approval toneAmber
class node_mallapi,node_inventory,node_bookingapi,node_bookinglife toneMint
class node_guards,node_analytics toneRose
class node_server,node_database,node_mallmodel,node_bookingmodel,node_usermodel,node_visitor,node_admin toneIndigo
```

## Components

### Web application

- [Page router](https://github.com/oceankumar/parkease/blob/main/client/src/App.jsx): `client/src/App.jsx`
- [Session state](https://github.com/oceankumar/parkease/blob/main/client/src/context/AuthContext.jsx): `client/src/context/AuthContext.jsx`
- [Auth client](https://github.com/oceankumar/parkease/blob/main/client/src/services/authService.js): `client/src/services/authService.js`
- [Mall discovery](https://github.com/oceankumar/parkease/blob/main/client/src/pages/MallDiscoveryPage.jsx): `client/src/pages/MallDiscoveryPage.jsx`
- [Bay availability](https://github.com/oceankumar/parkease/blob/main/client/src/pages/ParkingAvailabilityPage.jsx): `client/src/pages/ParkingAvailabilityPage.jsx`
- [Driver bookings](https://github.com/oceankumar/parkease/blob/main/client/src/pages/DashboardPage.jsx): `client/src/pages/DashboardPage.jsx`
- [Owner workspace](https://github.com/oceankumar/parkease/blob/main/client/src/pages/AccountDashboard.jsx): `client/src/pages/AccountDashboard.jsx`
- [Admin review](https://github.com/oceankumar/parkease/blob/main/client/src/components/ReviewQueue.jsx): `client/src/components/ReviewQueue.jsx`
- [Fetch client](https://github.com/oceankumar/parkease/blob/main/client/src/services/api.js): `client/src/services/api.js`

### Identity and approval

- [Authentication API](https://github.com/oceankumar/parkease/blob/main/server/src/services/authService.js): `server/src/services/authService.js`
- [Auth endpoints](https://github.com/oceankumar/parkease/blob/main/server/src/routes/authRoutes.js): `server/src/routes/authRoutes.js`
- [Access control](https://github.com/oceankumar/parkease/blob/main/server/src/middleware/authenticate.js): `server/src/middleware/authenticate.js`
- [Account approvals](https://github.com/oceankumar/parkease/blob/main/server/src/routes/adminRoutes.js): `server/src/routes/adminRoutes.js`

### Parking and bookings

- [Mall profiles](https://github.com/oceankumar/parkease/blob/main/server/src/routes/mallRoutes.js): `server/src/routes/mallRoutes.js`
- [Bay inventory](https://github.com/oceankumar/parkease/tree/main/server/src/routes): `server/src/routes`
- [Reservations](https://github.com/oceankumar/parkease/blob/main/server/src/routes/bookingRoutes.js): `server/src/routes/bookingRoutes.js`
- [Booking lifecycle](https://github.com/oceankumar/parkease/blob/main/server/src/services/bookingLifecycle.js): `server/src/services/bookingLifecycle.js`

### Operations and reporting

- [Guard operations](https://github.com/oceankumar/parkease/blob/main/server/src/routes/guardRoutes.js): `server/src/routes/guardRoutes.js`
- [Analytics](https://github.com/oceankumar/parkease/blob/main/server/src/routes/analyticsRoutes.js): `server/src/routes/analyticsRoutes.js`

### API and persistence

- [Express application](https://github.com/oceankumar/parkease/blob/main/server/src/app.js): `server/src/app.js`
- **MongoDB**
- [Mall records](https://github.com/oceankumar/parkease/blob/main/server/src/models/Mall.js): `server/src/models/Mall.js`
- [Booking records](https://github.com/oceankumar/parkease/blob/main/server/src/models/Booking.js): `server/src/models/Booking.js`
- [User records](https://github.com/oceankumar/parkease/blob/main/server/src/models/User.js): `server/src/models/User.js`

### Other components

- **Drivers and owners**
- **Mall administrators**

## Connections

- Drivers and owners → Page router: uses (evidence: `client/src/App.jsx`)
- Mall administrators → Page router: uses (evidence: `client/src/App.jsx`)
- Page router → Session state: wraps (evidence: `client/src/App.jsx`)
- Session state → Auth client: restores session (evidence: `client/src/context/AuthContext.jsx`)
- Auth client → Fetch client: requests (evidence: `client/src/services/authService.js`)
- Page router → Mall discovery: routes to (evidence: `client/src/App.jsx`)
- Page router → Bay availability: routes to (evidence: `client/src/App.jsx`)
- Page router → Driver bookings: routes to (evidence: `client/src/App.jsx`)
- Page router → Owner workspace: routes to (evidence: `client/src/App.jsx`)
- Page router → Admin review: routes to (evidence: `client/src/App.jsx`)
- Mall discovery → Fetch client: loads mall data
- Bay availability → Fetch client: loads availability
- Driver bookings → Fetch client: manages bookings
- Owner workspace → Fetch client: manages malls
- Admin review → Fetch client: reviews accounts
- Fetch client → Express application: calls REST API (evidence: `README.md`)
- Express application → Auth endpoints: mounts routes (evidence: `server/src/app.js`)
- Auth endpoints → Authentication API: delegates
- Authentication API → User records: reads and writes (evidence: `server/src/services/authService.js`)
- Authentication API → MongoDB: persists sessions (evidence: `server/src/services/authService.js`)
- Auth endpoints → Access control: authenticates requests
- Account approvals → User records: reviews owners (evidence: `server/src/routes/adminRoutes.js`)
- Account approvals → Mall records: reviews submissions (evidence: `server/src/routes/adminRoutes.js`)
- Mall profiles → Mall records: reads and writes (evidence: `server/src/routes/mallRoutes.js`)
- Mall profiles → Booking records: checks reservations (evidence: `server/src/routes/mallRoutes.js`)
- Bay inventory → Mall records: updates layouts (evidence: `server/src/routes/inventoryRoutes.js`)
- Bay inventory → Booking records: checks bay conflicts (evidence: `server/src/routes/inventoryRoutes.js`)
- Reservations → Booking records: creates and reads (evidence: `server/src/routes/bookingRoutes.js`)
- Reservations → Booking lifecycle: serializes bookings (evidence: `server/src/routes/bookingRoutes.js`)
- Reservations → Mall records: checks mall bays (evidence: `server/src/routes/bookingRoutes.js`)
- Reservations → MongoDB: transacts reservations (evidence: `server/src/routes/bookingRoutes.js`)
- Booking lifecycle → Booking records: manages lifecycle
- Guard operations → Booking records: supports gate work
- Analytics → MongoDB: reports parking activity
- Mall records → MongoDB: stores mall data (evidence: `README.md`)
- Booking records → MongoDB: stores reservations (evidence: `README.md`)
- User records → MongoDB: stores accounts (evidence: `README.md`)
