# khusshhhhh/redrive architecture

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

- Interactive diagram: https://gitdiagram.com/khusshhhhh/redrive
- Repository: https://github.com/khusshhhhh/redrive

## Overview

Redrive is an Australian peer-to-peer vehicle marketplace with web and mobile clients. The main journey runs from account creation and licence readiness, through vehicle discovery and listing, to reservation approval, payment, trip operations and reviews. Messaging, notifications and administration support that journey. The README documents broader integrations and capabilities; sampled routes confirm selected reservation, listing, registration, licence-verification and review behavior, so unsampled connections are shown only where the README explicitly describes them.

Main entry points: [`app/page.tsx`](https://github.com/khusshhhhh/redrive/blob/main/app/page.tsx) (Web experience), [`app/libs/prismadb.ts`](https://github.com/khusshhhhh/redrive/blob/main/app/libs/prismadb.ts) (MongoDB via Prisma), [`apps/mobile/src/app/_layout.tsx`](https://github.com/khusshhhhh/redrive/blob/main/apps/mobile/src/app/_layout.tsx) (Mobile experience), [`app/libs/notifications/dispatch.ts`](https://github.com/khusshhhhh/redrive/blob/main/app/libs/notifications/dispatch.ts) (Notifications)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_clients["Marketplace clients"]
  node_web["Web experience<br/>[page.tsx]"]
  node_mobile["Mobile experience<br/>[_layout.tsx]"]
  node_contracts["Shared API contracts<br/>[index.ts]"]
end

subgraph group_trust["Accounts and trust"]
  node_register["Signup and verification<br/>[route.ts]"]
  node_licence["Licence verification<br/>[route.ts]"]
  node_profile["Profile management<br/>[route.ts]"]
end

subgraph group_market["Discovery and listings"]
  node_listings["Listing and search API<br/>[route.ts]"]
  node_recommend["Recommendations<br/>[route.ts]"]
  node_saved["Saved searches<br/>[route.ts]"]
  node_listingui["Listing experience<br/>[page.tsx]"]
end

subgraph group_trips["Bookings and trips"]
  node_reservations["Reservation API<br/>[route.ts]"]
  node_reservationdetail["Reservation operations<br/>[route.ts]"]
  node_payments["Payments and payouts<br/>[payments.ts]"]
  node_reviews["Trip reviews<br/>[route.ts]"]
end

subgraph group_platform["Communication and operations"]
  node_chats["Participant messaging<br/>[route.ts]"]
  node_notifications["Notifications<br/>[dispatch.ts]"]
  node_admin["Marketplace administration<br/>[page.tsx]"]
  node_database[("MongoDB via Prisma<br/>[prismadb.ts]")]
end

node_guest(("Guest or owner"))
node_cloudinary["Cloudinary"]
node_maps["Google Maps and Places"]
node_stripe["Stripe"]
node_email["SMTP email"]
node_realtime["Pusher or SSE"]
node_cron(("Scheduled jobs"))

node_guest -->|"uses"| node_web
node_guest -->|"uses"| node_mobile
node_mobile -->|"shares types"| node_contracts
node_web -->|"submits signup"| node_register
node_mobile -->|"submits signup"| node_register
node_register -->|"stores account"| node_database
node_register -->|"sends verification"| node_email
node_web -->|"updates profile"| node_profile
node_profile -->|"reads and writes"| node_database
node_web -->|"submits licence"| node_licence
node_licence -->|"stores verification"| node_database
node_licence -.->|"uploads documents"| node_cloudinary
node_web -->|"searches and lists"| node_listings
node_mobile -->|"searches listings"| node_listings
node_listings -->|"reads and writes"| node_database
node_web -.->|"assisted location search"| node_maps
node_web -->|"requests recommendations"| node_recommend
node_recommend -->|"scores listings"| node_database
node_web -->|"manages saved searches"| node_saved
node_saved -->|"persists searches"| node_database
node_web -->|"views vehicle"| node_listingui
node_listingui -->|"requests booking"| node_reservations
node_mobile -->|"requests booking"| node_reservations
node_reservations -->|"checks and creates"| node_database
node_reservations -->|"initiates payment flow"| node_payments
node_payments -->|"collects payment"| node_stripe
node_reservationdetail -->|"updates trip state"| node_database
node_reservationdetail -->|"refunds or expires checkout"| node_stripe
node_reservationdetail -->|"notifies participants"| node_notifications
node_web -->|"manages trip"| node_reservationdetail
node_mobile -->|"manages trip"| node_reservationdetail
node_web -->|"submits review"| node_reviews
node_reviews -->|"checks booking and stores review"| node_database
node_reviews -->|"notifies host"| node_notifications
node_web -->|"starts conversations"| node_chats
node_mobile -->|"sends messages"| node_chats
node_chats -->|"stores messages"| node_database
node_chats -.->|"publishes updates"| node_realtime
node_notifications -->|"records notifications"| node_database
node_notifications -.->|"sends email"| node_email
node_notifications -.->|"pushes live updates"| node_realtime
node_cron -->|"dispatches reminders"| node_notifications
node_cron -->|"releases payouts"| node_payments
node_guest -->|"administers marketplace"| node_admin
node_admin -->|"reads marketplace data"| node_database

click node_web "https://github.com/khusshhhhh/redrive/blob/main/app/page.tsx"
click node_mobile "https://github.com/khusshhhhh/redrive/blob/main/apps/mobile/src/app/_layout.tsx"
click node_contracts "https://github.com/khusshhhhh/redrive/blob/main/packages/contracts/src/index.ts"
click node_register "https://github.com/khusshhhhh/redrive/blob/main/app/api/register/route.ts"
click node_licence "https://github.com/khusshhhhh/redrive/blob/main/app/api/license-verification/route.ts"
click node_profile "https://github.com/khusshhhhh/redrive/blob/main/app/api/profile/route.ts"
click node_listings "https://github.com/khusshhhhh/redrive/blob/main/app/api/listings/route.ts"
click node_recommend "https://github.com/khusshhhhh/redrive/blob/main/app/api/recommendations/route.ts"
click node_saved "https://github.com/khusshhhhh/redrive/blob/main/app/api/saved-searches/route.ts"
click node_listingui "https://github.com/khusshhhhh/redrive/blob/main/app/listings/%5BlistingId%5D/page.tsx"
click node_reservations "https://github.com/khusshhhhh/redrive/blob/main/app/api/reservations/route.ts"
click node_reservationdetail "https://github.com/khusshhhhh/redrive/blob/main/app/api/reservations/%5BreservationId%5D/route.ts"
click node_payments "https://github.com/khusshhhhh/redrive/blob/main/app/libs/payments.ts"
click node_reviews "https://github.com/khusshhhhh/redrive/blob/main/app/api/reviews/route.ts"
click node_chats "https://github.com/khusshhhhh/redrive/blob/main/app/api/chats/route.ts"
click node_notifications "https://github.com/khusshhhhh/redrive/blob/main/app/libs/notifications/dispatch.ts"
click node_admin "https://github.com/khusshhhhh/redrive/blob/main/app/admin/(dashboard)/page.tsx"
click node_database "https://github.com/khusshhhhh/redrive/blob/main/app/libs/prismadb.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_web,node_mobile,node_contracts toneBlue
class node_register,node_licence,node_profile toneAmber
class node_listings,node_recommend,node_saved,node_listingui toneMint
class node_reservations,node_reservationdetail,node_payments,node_reviews toneRose
class node_chats,node_notifications,node_admin,node_database,node_guest,node_cloudinary,node_maps,node_stripe,node_email,node_realtime,node_cron toneIndigo
```

## Components

### Marketplace clients

- [Web experience](https://github.com/khusshhhhh/redrive/blob/main/app/page.tsx): `app/page.tsx`
- [Mobile experience](https://github.com/khusshhhhh/redrive/blob/main/apps/mobile/src/app/_layout.tsx): `apps/mobile/src/app/_layout.tsx`
- [Shared API contracts](https://github.com/khusshhhhh/redrive/blob/main/packages/contracts/src/index.ts): `packages/contracts/src/index.ts`

### Accounts and trust

- [Signup and verification](https://github.com/khusshhhhh/redrive/blob/main/app/api/register/route.ts): `app/api/register/route.ts`
- [Licence verification](https://github.com/khusshhhhh/redrive/blob/main/app/api/license-verification/route.ts): `app/api/license-verification/route.ts`
- [Profile management](https://github.com/khusshhhhh/redrive/blob/main/app/api/profile/route.ts): `app/api/profile/route.ts`

### Discovery and listings

- [Listing and search API](https://github.com/khusshhhhh/redrive/blob/main/app/api/listings/route.ts): `app/api/listings/route.ts`
- [Recommendations](https://github.com/khusshhhhh/redrive/blob/main/app/api/recommendations/route.ts): `app/api/recommendations/route.ts`
- [Saved searches](https://github.com/khusshhhhh/redrive/blob/main/app/api/saved-searches/route.ts): `app/api/saved-searches/route.ts`
- [Listing experience](https://github.com/khusshhhhh/redrive/blob/main/app/listings/%5BlistingId%5D/page.tsx): `app/listings/[listingId]/page.tsx`

### Bookings and trips

- [Reservation API](https://github.com/khusshhhhh/redrive/blob/main/app/api/reservations/route.ts): `app/api/reservations/route.ts`
- [Reservation operations](https://github.com/khusshhhhh/redrive/blob/main/app/api/reservations/%5BreservationId%5D/route.ts): `app/api/reservations/[reservationId]/route.ts`
- [Payments and payouts](https://github.com/khusshhhhh/redrive/blob/main/app/libs/payments.ts): `app/libs/payments.ts`
- [Trip reviews](https://github.com/khusshhhhh/redrive/blob/main/app/api/reviews/route.ts): `app/api/reviews/route.ts`

### Communication and operations

- [Participant messaging](https://github.com/khusshhhhh/redrive/blob/main/app/api/chats/route.ts): `app/api/chats/route.ts`
- [Notifications](https://github.com/khusshhhhh/redrive/blob/main/app/libs/notifications/dispatch.ts): `app/libs/notifications/dispatch.ts`
- [Marketplace administration](https://github.com/khusshhhhh/redrive/blob/main/app/admin/(dashboard)/page.tsx): `app/admin/(dashboard)/page.tsx`
- [MongoDB via Prisma](https://github.com/khusshhhhh/redrive/blob/main/app/libs/prismadb.ts): `app/libs/prismadb.ts`

### Other components

- **Guest or owner**
- **Cloudinary**
- **Google Maps and Places**
- **Stripe**
- **SMTP email**
- **Pusher or SSE**
- **Scheduled jobs**

## Connections

- Guest or owner → Web experience: uses
- Guest or owner → Mobile experience: uses
- Mobile experience → Shared API contracts: shares types
- Web experience → Signup and verification: submits signup
- Mobile experience → Signup and verification: submits signup
- Signup and verification → MongoDB via Prisma: stores account
- Signup and verification → SMTP email: sends verification
- Web experience → Profile management: updates profile
- Profile management → MongoDB via Prisma: reads and writes
- Web experience → Licence verification: submits licence
- Licence verification → MongoDB via Prisma: stores verification
- Licence verification → Cloudinary: uploads documents
- Web experience → Listing and search API: searches and lists
- Mobile experience → Listing and search API: searches listings
- Listing and search API → MongoDB via Prisma: reads and writes
- Web experience → Google Maps and Places: assisted location search
- Web experience → Recommendations: requests recommendations
- Recommendations → MongoDB via Prisma: scores listings
- Web experience → Saved searches: manages saved searches
- Saved searches → MongoDB via Prisma: persists searches
- Web experience → Listing experience: views vehicle
- Listing experience → Reservation API: requests booking
- Mobile experience → Reservation API: requests booking
- Reservation API → MongoDB via Prisma: checks and creates
- Reservation API → Payments and payouts: initiates payment flow
- Payments and payouts → Stripe: collects payment
- Reservation operations → MongoDB via Prisma: updates trip state
- Reservation operations → Stripe: refunds or expires checkout
- Reservation operations → Notifications: notifies participants
- Web experience → Reservation operations: manages trip
- Mobile experience → Reservation operations: manages trip
- Web experience → Trip reviews: submits review
- Trip reviews → MongoDB via Prisma: checks booking and stores review
- Trip reviews → Notifications: notifies host
- Web experience → Participant messaging: starts conversations
- Mobile experience → Participant messaging: sends messages
- Participant messaging → MongoDB via Prisma: stores messages
- Participant messaging → Pusher or SSE: publishes updates
- Notifications → MongoDB via Prisma: records notifications
- Notifications → SMTP email: sends email
- Notifications → Pusher or SSE: pushes live updates
- Scheduled jobs → Notifications: dispatches reminders
- Scheduled jobs → Payments and payouts: releases payouts
- Guest or owner → Marketplace administration: administers marketplace
- Marketplace administration → MongoDB via Prisma: reads marketplace data
