# lubangjohnpatrick-coder/renthub-app architecture

> Architecture diagram of the GitHub repository lubangjohnpatrick-coder/renthub-app, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-09-29). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/lubangjohnpatrick-coder/renthub-app
- Repository: https://github.com/lubangjohnpatrick-coder/renthub-app

## Overview

GoRentHive is a peer-to-peer rental marketplace: one account can rent and list items. The principal flow runs from nearby listing discovery through booking approval, payment, agreement and condition evidence, handover, return or dispute, deposit resolution, payout eligibility, and review. The graph preserves documented verification, private media, messaging, and monetization capabilities. Some subsystems are represented by their exact directory because their implementation was not sampled; those links are omitted where the excerpts and README do not establish a call path.

Main entry points: [`server/booking-v2.js`](https://github.com/lubangjohnpatrick-coder/renthub-app/blob/main/server/booking-v2.js) (Booking requests), [`server/supabase.js`](https://github.com/lubangjohnpatrick-coder/renthub-app/blob/main/server/supabase.js) (Supabase data and auth), [`server/ledger.js`](https://github.com/lubangjohnpatrick-coder/renthub-app/blob/main/server/ledger.js) (Wallet ledger), [`server/payment-v2.js`](https://github.com/lubangjohnpatrick-coder/renthub-app/blob/main/server/payment-v2.js) (Payment API)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_client["Marketplace client"]
  node_webapp["SPA and workflows<br/>[app.js]"]
  node_api["API client<br/>[api.js]"]
  node_ui["UI shell<br/>[ui-shell.js]"]
  node_location_ui["Verified GPS UI"]
  node_booking_ui["Launch workflows UI<br/>[launch-ready.js]"]
  node_payment_ui["Payment experience"]
  node_profile_ui["Profile experience"]
  node_verification_ui["Verification experience"]
  node_private_media_ui["Private evidence UI<br/>[private-media.js]"]
  node_service_worker["PWA caching<br/>[service-worker.js]"]
end

subgraph group_discovery["Discovery and trust"]
  node_listing_routes["Listing discovery<br/>[listings-v2.js]"]
  node_location_routes["Verified-radius search<br/>[location.js]"]
  node_profile_location["Profile location"]
  node_verification["Identity verification<br/>[verification-v2.js]"]
  node_verification_providers["Verification providers"]
  node_media["Media handling<br/>[media.js]"]
  node_upload["Secure uploads<br/>[upload.js]"]
end

subgraph group_booking["Booking lifecycle"]
  node_booking_routes["Booking requests<br/>[booking-v2.js]"]
  node_rental_policy["Agreement and rental rules<br/>[rental-policy.js]"]
  node_private_routes["Booking, evidence and disputes<br/>[private.js]"]
  node_legacy_booking["Compatibility booking routes<br/>[financial.js]"]
end

subgraph group_finance["Payments and finance"]
  node_payment_routes["Payment API<br/>[payment-v2.js]"]
  node_payment_service["Gateway and payment records<br/>[payment.js]"]
  node_paymongo["PayMongo provider<br/>[paymongo.js]"]
  node_gcash["GCash provider<br/>[gcash.js]"]
  node_webhook["Payment webhook"]
  node_ledger["Wallet ledger<br/>[ledger.js]"]
  node_revenue["Revenue accounting<br/>[revenue.js]"]
  node_monetize["Marketplace monetization<br/>[monetize.js]"]
end

subgraph group_platform["Server platform"]
  node_settings["Platform settings<br/>[settings.js]"]
  node_auth["Authentication middleware<br/>[auth-service.js]"]
  node_supabase[("Supabase data and auth<br/>[supabase.js]")]
  node_public_shape["Public data shaping<br/>[publicShape.js]"]
end

node_renter(("Renter / owner"))

node_renter -->|"uses"| node_webapp
node_webapp -->|"requests API"| node_api
node_api -.->|"submits bookings"| node_booking_routes
node_api -.->|"requests listings"| node_listing_routes
node_location_ui -->|"sends GPS"| node_location_routes
node_booking_ui -.->|"starts booking"| node_booking_routes
node_payment_ui -.->|"starts payment"| node_payment_routes
node_verification_ui -.->|"requests verification"| node_verification
node_private_media_ui -.->|"accesses evidence"| node_media
node_listing_routes -->|"shapes results"| node_public_shape
node_verification -->|"uses providers"| node_verification_providers
node_renter -->|"requests rental"| node_booking_routes
node_booking_routes -->|"reads terms"| node_settings
node_booking_routes -->|"reserves funds"| node_ledger
node_booking_routes -->|"creates payment"| node_payment_service
node_booking_routes -->|"authenticates"| node_auth
node_booking_routes -->|"reads and writes"| node_supabase
node_booking_routes -->|"applies rules"| node_rental_policy
node_booking_routes -.->|"continues lifecycle"| node_private_routes
node_renter -->|"signs and reports"| node_private_routes
node_private_routes -->|"reads balance"| node_ledger
node_private_routes -->|"reads and writes"| node_supabase
node_private_routes -.->|"authenticates"| node_auth
node_renter -->|"pays booking"| node_payment_routes
node_payment_routes -->|"creates payment"| node_payment_service
node_payment_routes -->|"records funds"| node_ledger
node_payment_routes -->|"creates intent"| node_paymongo
node_payment_routes -->|"confirms payment"| node_webhook
node_payment_service -->|"dispatches gateway"| node_paymongo
node_payment_service -->|"dispatches gateway"| node_gcash
node_webhook -->|"verifies event"| node_paymongo
node_webhook -->|"settles payment"| node_supabase
node_webhook -.->|"credits wallet"| node_ledger
node_legacy_booking -->|"confirms payment"| node_webhook
node_legacy_booking -.->|"reads balance"| node_ledger
node_legacy_booking -->|"reads and writes"| node_supabase
node_ledger -->|"records entries"| node_supabase
node_ledger -->|"computes split"| node_settings
node_monetize -->|"uses ledger"| node_ledger
node_monetize -->|"uses accounting"| node_revenue
node_revenue -->|"reads revenue"| node_supabase
node_settings -->|"reads and writes"| node_supabase
node_auth -->|"verifies and loads"| node_supabase
node_renter -->|"discovers nearby"| node_location_routes
node_location_routes -->|"reads locations"| node_supabase
node_renter -->|"verifies identity"| node_verification
node_renter -->|"submits evidence"| node_media
node_renter -.->|"updates location"| node_profile_location

click node_webapp "https://github.com/lubangjohnpatrick-coder/renthub-app/blob/main/public/js/app.js"
click node_api "https://github.com/lubangjohnpatrick-coder/renthub-app/blob/main/public/js/api.js"
click node_ui "https://github.com/lubangjohnpatrick-coder/renthub-app/blob/main/public/js/ui-shell.js"
click node_location_ui "https://github.com/lubangjohnpatrick-coder/renthub-app/blob/main/public/js/location-hardening.js"
click node_booking_ui "https://github.com/lubangjohnpatrick-coder/renthub-app/blob/main/public/js/launch-ready.js"
click node_payment_ui "https://github.com/lubangjohnpatrick-coder/renthub-app/blob/main/public/js/payment-experience.js"
click node_profile_ui "https://github.com/lubangjohnpatrick-coder/renthub-app/blob/main/public/js/profile-experience.js"
click node_verification_ui "https://github.com/lubangjohnpatrick-coder/renthub-app/blob/main/public/js/verification-experience.js"
click node_private_media_ui "https://github.com/lubangjohnpatrick-coder/renthub-app/blob/main/public/js/private-media.js"
click node_service_worker "https://github.com/lubangjohnpatrick-coder/renthub-app/blob/main/public/service-worker.js"
click node_listing_routes "https://github.com/lubangjohnpatrick-coder/renthub-app/blob/main/server/listings-v2.js"
click node_location_routes "https://github.com/lubangjohnpatrick-coder/renthub-app/blob/main/server/location.js"
click node_profile_location "https://github.com/lubangjohnpatrick-coder/renthub-app/blob/main/server/profile-location.js"
click node_verification "https://github.com/lubangjohnpatrick-coder/renthub-app/blob/main/server/verification-v2.js"
click node_verification_providers "https://github.com/lubangjohnpatrick-coder/renthub-app/blob/main/server/verification-providers.js"
click node_media "https://github.com/lubangjohnpatrick-coder/renthub-app/blob/main/server/media.js"
click node_upload "https://github.com/lubangjohnpatrick-coder/renthub-app/blob/main/server/upload.js"
click node_booking_routes "https://github.com/lubangjohnpatrick-coder/renthub-app/blob/main/server/booking-v2.js"
click node_rental_policy "https://github.com/lubangjohnpatrick-coder/renthub-app/blob/main/server/rental-policy.js"
click node_private_routes "https://github.com/lubangjohnpatrick-coder/renthub-app/blob/main/server/private.js"
click node_legacy_booking "https://github.com/lubangjohnpatrick-coder/renthub-app/blob/main/server/financial.js"
click node_payment_routes "https://github.com/lubangjohnpatrick-coder/renthub-app/blob/main/server/payment-v2.js"
click node_payment_service "https://github.com/lubangjohnpatrick-coder/renthub-app/blob/main/server/payment.js"
click node_paymongo "https://github.com/lubangjohnpatrick-coder/renthub-app/blob/main/server/providers/paymongo.js"
click node_gcash "https://github.com/lubangjohnpatrick-coder/renthub-app/blob/main/server/providers/gcash.js"
click node_webhook "https://github.com/lubangjohnpatrick-coder/renthub-app/blob/main/server/paymongo-webhook.js"
click node_ledger "https://github.com/lubangjohnpatrick-coder/renthub-app/blob/main/server/ledger.js"
click node_revenue "https://github.com/lubangjohnpatrick-coder/renthub-app/blob/main/server/revenue.js"
click node_monetize "https://github.com/lubangjohnpatrick-coder/renthub-app/blob/main/server/monetize.js"
click node_settings "https://github.com/lubangjohnpatrick-coder/renthub-app/blob/main/server/settings.js"
click node_auth "https://github.com/lubangjohnpatrick-coder/renthub-app/blob/main/server/auth-service.js"
click node_supabase "https://github.com/lubangjohnpatrick-coder/renthub-app/blob/main/server/supabase.js"
click node_public_shape "https://github.com/lubangjohnpatrick-coder/renthub-app/blob/main/server/publicShape.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_webapp,node_api,node_ui,node_location_ui,node_booking_ui,node_payment_ui,node_profile_ui,node_verification_ui,node_private_media_ui,node_service_worker toneBlue
class node_listing_routes,node_location_routes,node_profile_location,node_verification,node_verification_providers,node_media,node_upload toneAmber
class node_booking_routes,node_rental_policy,node_private_routes,node_legacy_booking toneMint
class node_payment_routes,node_payment_service,node_paymongo,node_gcash,node_webhook,node_ledger,node_revenue,node_monetize toneRose
class node_settings,node_auth,node_supabase,node_public_shape,node_renter toneIndigo
```

## Components

### Marketplace client

- [SPA and workflows](https://github.com/lubangjohnpatrick-coder/renthub-app/blob/main/public/js/app.js): `public/js/app.js`
- [API client](https://github.com/lubangjohnpatrick-coder/renthub-app/blob/main/public/js/api.js): `public/js/api.js`
- [UI shell](https://github.com/lubangjohnpatrick-coder/renthub-app/blob/main/public/js/ui-shell.js): `public/js/ui-shell.js`
- [Verified GPS UI](https://github.com/lubangjohnpatrick-coder/renthub-app/blob/main/public/js/location-hardening.js): `public/js/location-hardening.js`
- [Launch workflows UI](https://github.com/lubangjohnpatrick-coder/renthub-app/blob/main/public/js/launch-ready.js): `public/js/launch-ready.js`
- [Payment experience](https://github.com/lubangjohnpatrick-coder/renthub-app/blob/main/public/js/payment-experience.js): `public/js/payment-experience.js`
- [Profile experience](https://github.com/lubangjohnpatrick-coder/renthub-app/blob/main/public/js/profile-experience.js): `public/js/profile-experience.js`
- [Verification experience](https://github.com/lubangjohnpatrick-coder/renthub-app/blob/main/public/js/verification-experience.js): `public/js/verification-experience.js`
- [Private evidence UI](https://github.com/lubangjohnpatrick-coder/renthub-app/blob/main/public/js/private-media.js): `public/js/private-media.js`
- [PWA caching](https://github.com/lubangjohnpatrick-coder/renthub-app/blob/main/public/service-worker.js): `public/service-worker.js`

### Discovery and trust

- [Listing discovery](https://github.com/lubangjohnpatrick-coder/renthub-app/blob/main/server/listings-v2.js): `server/listings-v2.js`
- [Verified-radius search](https://github.com/lubangjohnpatrick-coder/renthub-app/blob/main/server/location.js): `server/location.js`
- [Profile location](https://github.com/lubangjohnpatrick-coder/renthub-app/blob/main/server/profile-location.js): `server/profile-location.js`
- [Identity verification](https://github.com/lubangjohnpatrick-coder/renthub-app/blob/main/server/verification-v2.js): `server/verification-v2.js`
- [Verification providers](https://github.com/lubangjohnpatrick-coder/renthub-app/blob/main/server/verification-providers.js): `server/verification-providers.js`
- [Media handling](https://github.com/lubangjohnpatrick-coder/renthub-app/blob/main/server/media.js): `server/media.js`
- [Secure uploads](https://github.com/lubangjohnpatrick-coder/renthub-app/blob/main/server/upload.js): `server/upload.js`

### Booking lifecycle

- [Booking requests](https://github.com/lubangjohnpatrick-coder/renthub-app/blob/main/server/booking-v2.js): `server/booking-v2.js`
- [Agreement and rental rules](https://github.com/lubangjohnpatrick-coder/renthub-app/blob/main/server/rental-policy.js): `server/rental-policy.js`
- [Booking, evidence and disputes](https://github.com/lubangjohnpatrick-coder/renthub-app/blob/main/server/private.js): `server/private.js`
- [Compatibility booking routes](https://github.com/lubangjohnpatrick-coder/renthub-app/blob/main/server/financial.js): `server/financial.js`

### Payments and finance

- [Payment API](https://github.com/lubangjohnpatrick-coder/renthub-app/blob/main/server/payment-v2.js): `server/payment-v2.js`
- [Gateway and payment records](https://github.com/lubangjohnpatrick-coder/renthub-app/blob/main/server/payment.js): `server/payment.js`
- [PayMongo provider](https://github.com/lubangjohnpatrick-coder/renthub-app/blob/main/server/providers/paymongo.js): `server/providers/paymongo.js`
- [GCash provider](https://github.com/lubangjohnpatrick-coder/renthub-app/blob/main/server/providers/gcash.js): `server/providers/gcash.js`
- [Payment webhook](https://github.com/lubangjohnpatrick-coder/renthub-app/blob/main/server/paymongo-webhook.js): `server/paymongo-webhook.js`
- [Wallet ledger](https://github.com/lubangjohnpatrick-coder/renthub-app/blob/main/server/ledger.js): `server/ledger.js`
- [Revenue accounting](https://github.com/lubangjohnpatrick-coder/renthub-app/blob/main/server/revenue.js): `server/revenue.js`
- [Marketplace monetization](https://github.com/lubangjohnpatrick-coder/renthub-app/blob/main/server/monetize.js): `server/monetize.js`

### Server platform

- [Platform settings](https://github.com/lubangjohnpatrick-coder/renthub-app/blob/main/server/settings.js): `server/settings.js`
- [Authentication middleware](https://github.com/lubangjohnpatrick-coder/renthub-app/blob/main/server/auth-service.js): `server/auth-service.js`
- [Supabase data and auth](https://github.com/lubangjohnpatrick-coder/renthub-app/blob/main/server/supabase.js): `server/supabase.js`
- [Public data shaping](https://github.com/lubangjohnpatrick-coder/renthub-app/blob/main/server/publicShape.js): `server/publicShape.js`

### Other components

- **Renter / owner**

## Connections

- Renter / owner → SPA and workflows: uses
- SPA and workflows → API client: requests API
- API client → Booking requests: submits bookings
- API client → Listing discovery: requests listings
- Verified GPS UI → Verified-radius search: sends GPS
- Launch workflows UI → Booking requests: starts booking
- Payment experience → Payment API: starts payment
- Verification experience → Identity verification: requests verification
- Private evidence UI → Media handling: accesses evidence
- Listing discovery → Public data shaping: shapes results (evidence: `server/listings-v2.js`)
- Identity verification → Verification providers: uses providers (evidence: `server/verification-v2.js`)
- Renter / owner → Booking requests: requests rental
- Booking requests → Platform settings: reads terms (evidence: `server/booking-v2.js`)
- Booking requests → Wallet ledger: reserves funds (evidence: `server/booking-v2.js`)
- Booking requests → Gateway and payment records: creates payment (evidence: `server/booking-v2.js`)
- Booking requests → Authentication middleware: authenticates (evidence: `server/booking-v2.js`)
- Booking requests → Supabase data and auth: reads and writes (evidence: `server/booking-v2.js`)
- Booking requests → Agreement and rental rules: applies rules (evidence: `server/booking-v2.js`)
- Booking requests → Booking, evidence and disputes: continues lifecycle
- Renter / owner → Booking, evidence and disputes: signs and reports
- Booking, evidence and disputes → Wallet ledger: reads balance (evidence: `server/private.js`)
- Booking, evidence and disputes → Supabase data and auth: reads and writes (evidence: `server/private.js`)
- Booking, evidence and disputes → Authentication middleware: authenticates (evidence: `server/private.js`)
- Renter / owner → Payment API: pays booking
- Payment API → Gateway and payment records: creates payment (evidence: `server/payment-v2.js`)
- Payment API → Wallet ledger: records funds (evidence: `server/payment-v2.js`)
- Payment API → PayMongo provider: creates intent (evidence: `server/payment-v2.js`)
- Payment API → Payment webhook: confirms payment (evidence: `server/payment-v2.js`)
- Gateway and payment records → PayMongo provider: dispatches gateway (evidence: `server/payment.js`)
- Gateway and payment records → GCash provider: dispatches gateway (evidence: `server/payment.js`)
- Payment webhook → PayMongo provider: verifies event (evidence: `server/paymongo-webhook.js`)
- Payment webhook → Supabase data and auth: settles payment (evidence: `server/paymongo-webhook.js`)
- Payment webhook → Wallet ledger: credits wallet
- Compatibility booking routes → Payment webhook: confirms payment (evidence: `server/financial.js`)
- Compatibility booking routes → Wallet ledger: reads balance (evidence: `server/financial.js`)
- Compatibility booking routes → Supabase data and auth: reads and writes (evidence: `server/financial.js`)
- Wallet ledger → Supabase data and auth: records entries (evidence: `server/ledger.js`)
- Wallet ledger → Platform settings: computes split (evidence: `server/ledger.js`)
- Marketplace monetization → Wallet ledger: uses ledger (evidence: `server/monetize.js`)
- Marketplace monetization → Revenue accounting: uses accounting (evidence: `server/monetize.js`)
- Revenue accounting → Supabase data and auth: reads revenue (evidence: `server/revenue.js`)
- Platform settings → Supabase data and auth: reads and writes (evidence: `server/settings.js`)
- Authentication middleware → Supabase data and auth: verifies and loads (evidence: `server/auth-service.js`)
- Renter / owner → Verified-radius search: discovers nearby
- Verified-radius search → Supabase data and auth: reads locations (evidence: `server/location.js`)
- Renter / owner → Identity verification: verifies identity
- Renter / owner → Media handling: submits evidence
- Renter / owner → Profile location: updates location
