# jrphan/rental-app architecture

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

- Interactive diagram: https://gitdiagram.com/jrphan/rental-app
- Repository: https://github.com/jrphan/rental-app

## Overview

This is a vehicle-rental platform with a mobile marketplace, a NestJS backend, and a web administration portal. The principal workflow is searching for vehicles, then booking and managing rentals; adjacent capabilities include accounts and KYC, messaging, reviews, notifications, and owner commissions. Admins review users, vehicles, rentals, fees, and commissions. The excerpts substantiate selected search, review, and admin routing calls; many other links are omitted because their implementations were not sampled.

Main entry points: [`mobile/services`](https://github.com/jrphan/rental-app/tree/main/mobile/services) (Mobile API clients), [`backend/src/prisma/prisma.service.ts`](https://github.com/jrphan/rental-app/blob/main/backend/src/prisma/prisma.service.ts) (Application database), [`backend/src/modules/review/review.service.ts`](https://github.com/jrphan/rental-app/blob/main/backend/src/modules/review/review.service.ts) (Review operations), [`mobile/screens/home/SearchResultsScreen.tsx`](https://github.com/jrphan/rental-app/blob/main/mobile/screens/home/SearchResultsScreen.tsx) (Vehicle search)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_mobile["Mobile marketplace"]
  node_search_ui["Vehicle search"]
  node_search_bar["Search filters"]
  node_vehicle_flows["Vehicle and rental screens"]
  node_account_flows["Account and KYC screens"]
  node_chat_flows["Chat and notifications"]
  node_owner_finance["Owner commissions"]
  node_mobile_api["Mobile API clients"]
end

subgraph group_backend["Backend services"]
  node_vehicle_api["Vehicle endpoints"]
  node_vehicle_logic["Vehicle operations<br/>[vehicle.service.ts]"]
  node_rental_api["Rental endpoints"]
  node_rental_logic["Rental operations<br/>[rental.service.ts]"]
  node_user_api["User and KYC endpoints<br/>[user.controller.ts]"]
  node_user_logic["User operations<br/>[user.service.ts]"]
  node_review_api["Review endpoints"]
  node_review_logic["Review operations<br/>[review.service.ts]"]
  node_commission_api["Commission endpoints"]
  node_commission_logic["Commission operations"]
  node_other_backend["Other API modules"]
end

subgraph group_admin["Admin portal"]
  node_admin_router["Admin route tree<br/>[routeTree.gen.ts]"]
  node_admin_pages["Admin screens"]
  node_admin_api["Admin API clients"]
  node_router["Web router<br/>[router.tsx]"]
  node_query_provider["Query provider<br/>[root-provider.tsx]"]
end

subgraph group_shared["Platform services"]
  node_database[("Application database<br/>[prisma.service.ts]")]
  node_auth["Authentication<br/>[auth.service.ts]"]
  node_audit["Audit logging"]
  node_notifications["Notifications and push"]
end

node_renter(("Renter"))
node_owner(("Vehicle owner"))
node_admin_actor(("Administrator"))

node_renter -.->|"searches"| node_search_ui
node_owner -.->|"manages listings"| node_vehicle_flows
node_admin_actor -.->|"administers"| node_admin_pages
node_search_ui -->|"renders"| node_search_bar
node_search_ui -.->|"queries vehicles"| node_vehicle_api
node_mobile_api -.->|"requests"| node_vehicle_api
node_mobile_api -.->|"requests"| node_rental_api
node_mobile_api -.->|"requests"| node_user_api
node_mobile_api -.->|"requests"| node_review_api
node_mobile_api -.->|"requests"| node_commission_api
node_vehicle_api -->|"delegates to"| node_vehicle_logic
node_rental_api -->|"delegates to"| node_rental_logic
node_user_api -->|"delegates to"| node_user_logic
node_review_api -->|"delegates to"| node_review_logic
node_review_logic -->|"reads and writes reviews"| node_database
node_review_logic -->|"logs review actions"| node_audit
node_review_logic -->|"creates notifications"| node_notifications
node_commission_api -->|"delegates to"| node_commission_logic
node_router -->|"uses route tree"| node_admin_router
node_router -->|"configures provider"| node_query_provider
node_admin_router -->|"routes to screens"| node_admin_pages
node_admin_pages -.->|"loads admin data"| node_admin_api
node_admin_api -.->|"requests"| node_other_backend
node_vehicle_logic -.->|"uses persistence"| node_database
node_rental_logic -.->|"uses persistence"| node_database
node_user_logic -.->|"uses persistence"| node_database
node_commission_logic -.->|"uses persistence"| node_database

click node_search_ui "https://github.com/jrphan/rental-app/blob/main/mobile/screens/home/SearchResultsScreen.tsx"
click node_search_bar "https://github.com/jrphan/rental-app/blob/main/mobile/screens/home/components/VehicleSearchBar.tsx"
click node_vehicle_flows "https://github.com/jrphan/rental-app/tree/main/mobile/screens/vehicles"
click node_account_flows "https://github.com/jrphan/rental-app/tree/main/mobile/screens/profile"
click node_chat_flows "https://github.com/jrphan/rental-app/tree/main/mobile/screens/messages"
click node_owner_finance "https://github.com/jrphan/rental-app/tree/main/mobile/screens/profile/commissions"
click node_mobile_api "https://github.com/jrphan/rental-app/tree/main/mobile/services"
click node_vehicle_api "https://github.com/jrphan/rental-app/blob/main/backend/src/modules/vehicle/vehicle.controller.ts"
click node_vehicle_logic "https://github.com/jrphan/rental-app/blob/main/backend/src/modules/vehicle/vehicle.service.ts"
click node_rental_api "https://github.com/jrphan/rental-app/blob/main/backend/src/modules/rental/rental.controller.ts"
click node_rental_logic "https://github.com/jrphan/rental-app/blob/main/backend/src/modules/rental/rental.service.ts"
click node_user_api "https://github.com/jrphan/rental-app/blob/main/backend/src/modules/user/user.controller.ts"
click node_user_logic "https://github.com/jrphan/rental-app/blob/main/backend/src/modules/user/user.service.ts"
click node_review_api "https://github.com/jrphan/rental-app/blob/main/backend/src/modules/review/review.controller.ts"
click node_review_logic "https://github.com/jrphan/rental-app/blob/main/backend/src/modules/review/review.service.ts"
click node_commission_api "https://github.com/jrphan/rental-app/blob/main/backend/src/modules/commission/commission.controller.ts"
click node_commission_logic "https://github.com/jrphan/rental-app/blob/main/backend/src/modules/commission/commission.service.ts"
click node_other_backend "https://github.com/jrphan/rental-app/tree/main/backend/src/modules"
click node_admin_router "https://github.com/jrphan/rental-app/blob/main/web/src/routeTree.gen.ts"
click node_admin_pages "https://github.com/jrphan/rental-app/tree/main/web/src/pages"
click node_admin_api "https://github.com/jrphan/rental-app/tree/main/web/src/services"
click node_router "https://github.com/jrphan/rental-app/blob/main/web/src/router.tsx"
click node_query_provider "https://github.com/jrphan/rental-app/blob/main/web/src/integrations/tanstack-query/root-provider.tsx"
click node_database "https://github.com/jrphan/rental-app/blob/main/backend/src/prisma/prisma.service.ts"
click node_auth "https://github.com/jrphan/rental-app/blob/main/backend/src/modules/auth/auth.service.ts"
click node_audit "https://github.com/jrphan/rental-app/blob/main/backend/src/modules/audit/audit-log.service.ts"
click node_notifications "https://github.com/jrphan/rental-app/blob/main/backend/src/modules/notification/notification.service.ts"

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_search_ui,node_search_bar,node_vehicle_flows,node_account_flows,node_chat_flows,node_owner_finance,node_mobile_api toneBlue
class node_vehicle_api,node_vehicle_logic,node_rental_api,node_rental_logic,node_user_api,node_user_logic,node_review_api,node_review_logic,node_commission_api,node_commission_logic,node_other_backend toneAmber
class node_admin_router,node_admin_pages,node_admin_api,node_router,node_query_provider toneMint
class node_database,node_auth,node_audit,node_notifications toneRose
class node_renter,node_owner,node_admin_actor toneIndigo
```

## Components

### Mobile marketplace

- [Vehicle search](https://github.com/jrphan/rental-app/blob/main/mobile/screens/home/SearchResultsScreen.tsx): `mobile/screens/home/SearchResultsScreen.tsx`
- [Search filters](https://github.com/jrphan/rental-app/blob/main/mobile/screens/home/components/VehicleSearchBar.tsx): `mobile/screens/home/components/VehicleSearchBar.tsx`
- [Vehicle and rental screens](https://github.com/jrphan/rental-app/tree/main/mobile/screens/vehicles): `mobile/screens/vehicles`
- [Account and KYC screens](https://github.com/jrphan/rental-app/tree/main/mobile/screens/profile): `mobile/screens/profile`
- [Chat and notifications](https://github.com/jrphan/rental-app/tree/main/mobile/screens/messages): `mobile/screens/messages`
- [Owner commissions](https://github.com/jrphan/rental-app/tree/main/mobile/screens/profile/commissions): `mobile/screens/profile/commissions`
- [Mobile API clients](https://github.com/jrphan/rental-app/tree/main/mobile/services): `mobile/services`

### Backend services

- [Vehicle endpoints](https://github.com/jrphan/rental-app/blob/main/backend/src/modules/vehicle/vehicle.controller.ts): `backend/src/modules/vehicle/vehicle.controller.ts`
- [Vehicle operations](https://github.com/jrphan/rental-app/blob/main/backend/src/modules/vehicle/vehicle.service.ts): `backend/src/modules/vehicle/vehicle.service.ts`
- [Rental endpoints](https://github.com/jrphan/rental-app/blob/main/backend/src/modules/rental/rental.controller.ts): `backend/src/modules/rental/rental.controller.ts`
- [Rental operations](https://github.com/jrphan/rental-app/blob/main/backend/src/modules/rental/rental.service.ts): `backend/src/modules/rental/rental.service.ts`
- [User and KYC endpoints](https://github.com/jrphan/rental-app/blob/main/backend/src/modules/user/user.controller.ts): `backend/src/modules/user/user.controller.ts`
- [User operations](https://github.com/jrphan/rental-app/blob/main/backend/src/modules/user/user.service.ts): `backend/src/modules/user/user.service.ts`
- [Review endpoints](https://github.com/jrphan/rental-app/blob/main/backend/src/modules/review/review.controller.ts): `backend/src/modules/review/review.controller.ts`
- [Review operations](https://github.com/jrphan/rental-app/blob/main/backend/src/modules/review/review.service.ts): `backend/src/modules/review/review.service.ts`
- [Commission endpoints](https://github.com/jrphan/rental-app/blob/main/backend/src/modules/commission/commission.controller.ts): `backend/src/modules/commission/commission.controller.ts`
- [Commission operations](https://github.com/jrphan/rental-app/blob/main/backend/src/modules/commission/commission.service.ts): `backend/src/modules/commission/commission.service.ts`
- [Other API modules](https://github.com/jrphan/rental-app/tree/main/backend/src/modules): `backend/src/modules`

### Admin portal

- [Admin route tree](https://github.com/jrphan/rental-app/blob/main/web/src/routeTree.gen.ts): `web/src/routeTree.gen.ts`
- [Admin screens](https://github.com/jrphan/rental-app/tree/main/web/src/pages): `web/src/pages`
- [Admin API clients](https://github.com/jrphan/rental-app/tree/main/web/src/services): `web/src/services`
- [Web router](https://github.com/jrphan/rental-app/blob/main/web/src/router.tsx): `web/src/router.tsx`
- [Query provider](https://github.com/jrphan/rental-app/blob/main/web/src/integrations/tanstack-query/root-provider.tsx): `web/src/integrations/tanstack-query/root-provider.tsx`

### Platform services

- [Application database](https://github.com/jrphan/rental-app/blob/main/backend/src/prisma/prisma.service.ts): `backend/src/prisma/prisma.service.ts`
- [Authentication](https://github.com/jrphan/rental-app/blob/main/backend/src/modules/auth/auth.service.ts): `backend/src/modules/auth/auth.service.ts`
- [Audit logging](https://github.com/jrphan/rental-app/blob/main/backend/src/modules/audit/audit-log.service.ts): `backend/src/modules/audit/audit-log.service.ts`
- [Notifications and push](https://github.com/jrphan/rental-app/blob/main/backend/src/modules/notification/notification.service.ts): `backend/src/modules/notification/notification.service.ts`

### Other components

- **Renter**
- **Vehicle owner**
- **Administrator**

## Connections

- Renter → Vehicle search: searches
- Vehicle owner → Vehicle and rental screens: manages listings
- Administrator → Admin screens: administers
- Vehicle search → Search filters: renders (evidence: `mobile/screens/home/SearchResultsScreen.tsx`)
- Vehicle search → Vehicle endpoints: queries vehicles
- Mobile API clients → Vehicle endpoints: requests
- Mobile API clients → Rental endpoints: requests
- Mobile API clients → User and KYC endpoints: requests
- Mobile API clients → Review endpoints: requests
- Mobile API clients → Commission endpoints: requests
- Vehicle endpoints → Vehicle operations: delegates to (evidence: `backend/src/modules/vehicle/vehicle.controller.ts`)
- Rental endpoints → Rental operations: delegates to (evidence: `backend/src/modules/rental/rental.controller.ts`)
- User and KYC endpoints → User operations: delegates to (evidence: `backend/src/modules/user/user.controller.ts`)
- Review endpoints → Review operations: delegates to (evidence: `backend/src/modules/review/review.controller.ts`)
- Review operations → Application database: reads and writes reviews (evidence: `backend/src/modules/review/review.service.ts`)
- Review operations → Audit logging: logs review actions (evidence: `backend/src/modules/review/review.service.ts`)
- Review operations → Notifications and push: creates notifications (evidence: `backend/src/modules/review/review.service.ts`)
- Commission endpoints → Commission operations: delegates to (evidence: `backend/src/modules/commission/commission.controller.ts`)
- Web router → Admin route tree: uses route tree (evidence: `web/src/router.tsx`)
- Web router → Query provider: configures provider (evidence: `web/src/router.tsx`)
- Admin route tree → Admin screens: routes to screens (evidence: `web/src/routeTree.gen.ts`)
- Admin screens → Admin API clients: loads admin data
- Admin API clients → Other API modules: requests
- Vehicle operations → Application database: uses persistence
- Rental operations → Application database: uses persistence
- User operations → Application database: uses persistence
- Commission operations → Application database: uses persistence
