# misterbamrungsuk-afk/misterbamrungsuk-web architecture

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

- Interactive diagram: https://gitdiagram.com/misterbamrungsuk-afk/misterbamrungsuk-web
- Repository: https://github.com/misterbamrungsuk-afk/misterbamrungsuk-web

## Overview

HaMoo is a mobile-first rent-a-friend marketplace. Its main customer journey is discovering providers, requesting a booking, then coordinating the booking and its in-app money lifecycle through chat, completion, and review. Separate product areas include provider applications and profiles, live tracking and private calls, membership, hotels, and commerce; admin tools oversee operational workflows. The README documents the main journey and capabilities. Source excerpts show booking creation, provider application/profile handling, and selected supporting calls; other subsystem links are omitted where their wiring was not shown.

Main entry points: [`src/app/api/bookings/route.ts`](https://github.com/misterbamrungsuk-afk/misterbamrungsuk-web/blob/main/src/app/api/bookings/route.ts) (Booking API), [`src/app/api/join/register/route.ts`](https://github.com/misterbamrungsuk-afk/misterbamrungsuk-web/blob/main/src/app/api/join/register/route.ts) (Application registration), [`src/lib/join/store.ts`](https://github.com/misterbamrungsuk-afk/misterbamrungsuk-web/blob/main/src/lib/join/store.ts) (Applicant records), [`src/app/api/membership/route.ts`](https://github.com/misterbamrungsuk-afk/misterbamrungsuk-web/blob/main/src/app/api/membership/route.ts) (Membership)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_discovery["Customer discovery"]
  node_home["Home and feed<br/>[page.tsx]"]
  node_search["Search and map<br/>[page.tsx]"]
  node_provider_profile["Provider profiles<br/>[view.tsx]"]
end

subgraph group_booking["Booking experience"]
  node_booking_ui["Booking flow<br/>[flow.tsx]"]
  node_booking_api["Booking API<br/>[route.ts]"]
  node_booking_core["Booking rules<br/>[index.ts]"]
  node_chat["Booking chat<br/>[page.tsx]"]
  node_tracking["Live tracking<br/>[page.tsx]"]
  node_calls["Private calls<br/>[index.ts]"]
end

subgraph group_provider["Provider operations"]
  node_join_ui["Provider application<br/>[page.tsx]"]
  node_join_register["Application registration<br/>[route.ts]"]
  node_join_profile["Provider profile editing<br/>[route.ts]"]
  node_join_store[("Applicant records<br/>[store.ts]")]
  node_live_people["Live provider listings<br/>[live.ts]"]
  node_admin["Admin operations<br/>[page.tsx]"]
end

subgraph group_commerce["Commerce services"]
  node_wallet["Wallet and payouts<br/>[index.ts]"]
  node_membership["Membership<br/>[route.ts]"]
  node_market["Marketplace<br/>[store.ts]"]
  node_hotels["Hotel stays<br/>[store.ts]"]
end

subgraph group_shared["Shared platform"]
  node_customer_auth["Customer authentication<br/>[auth.ts]"]
  node_customer_profile["Customer profile<br/>[profile.ts]"]
  node_supabase[("Supabase services")]
  node_slip_check["Slip verification<br/>[slip2go.ts]"]
end

node_customer(("Customer"))

node_customer -->|"browses"| node_home
node_home -->|"opens profile"| node_provider_profile
node_customer -->|"requests booking"| node_booking_ui
node_booking_ui -.->|"submits booking"| node_booking_api
node_booking_api -->|"authenticates"| node_customer_auth
node_booking_api -->|"creates booking"| node_booking_core
node_booking_api -->|"finds provider"| node_live_people
node_booking_core -->|"checks balance"| node_wallet
node_customer -->|"coordinates booking"| node_chat
node_customer -->|"tracks live"| node_tracking
node_customer -->|"calls privately"| node_calls
node_customer -.->|"applies as provider"| node_join_ui
node_join_ui -.->|"submits application"| node_join_register
node_join_register -->|"creates applicant"| node_join_store
node_join_register -->|"verifies slip"| node_slip_check
node_join_register -.->|"stores records"| node_supabase
node_join_profile -->|"saves profile"| node_join_store
node_live_people -->|"lists applicants"| node_join_store
node_admin -.->|"reviews applicants"| node_join_store
node_membership -->|"authenticates"| node_customer_auth
node_membership -->|"reads profile"| node_customer_profile
node_customer -.->|"manages membership"| node_membership
node_customer -.->|"shops marketplace"| node_market
node_customer -.->|"books stays"| node_hotels
node_customer_auth -->|"reads sessions"| node_supabase
node_customer_profile -->|"reads and writes"| node_supabase

click node_home "https://github.com/misterbamrungsuk-afk/misterbamrungsuk-web/blob/main/src/app/(app)/home/page.tsx"
click node_search "https://github.com/misterbamrungsuk-afk/misterbamrungsuk-web/blob/main/src/app/(app)/search/page.tsx"
click node_provider_profile "https://github.com/misterbamrungsuk-afk/misterbamrungsuk-web/blob/main/src/app/p/%5Bid%5D/view.tsx"
click node_booking_ui "https://github.com/misterbamrungsuk-afk/misterbamrungsuk-web/blob/main/src/app/(app)/book/%5Bid%5D/flow.tsx"
click node_booking_api "https://github.com/misterbamrungsuk-afk/misterbamrungsuk-web/blob/main/src/app/api/bookings/route.ts"
click node_booking_core "https://github.com/misterbamrungsuk-afk/misterbamrungsuk-web/blob/main/src/lib/bookings/index.ts"
click node_chat "https://github.com/misterbamrungsuk-afk/misterbamrungsuk-web/blob/main/src/app/(app)/chat/%5BroomId%5D/page.tsx"
click node_tracking "https://github.com/misterbamrungsuk-afk/misterbamrungsuk-web/blob/main/src/app/(app)/tracking/%5Bid%5D/page.tsx"
click node_calls "https://github.com/misterbamrungsuk-afk/misterbamrungsuk-web/blob/main/src/lib/calls/index.ts"
click node_wallet "https://github.com/misterbamrungsuk-afk/misterbamrungsuk-web/blob/main/src/lib/wallet/index.ts"
click node_membership "https://github.com/misterbamrungsuk-afk/misterbamrungsuk-web/blob/main/src/app/api/membership/route.ts"
click node_market "https://github.com/misterbamrungsuk-afk/misterbamrungsuk-web/blob/main/src/lib/market/store.ts"
click node_hotels "https://github.com/misterbamrungsuk-afk/misterbamrungsuk-web/blob/main/src/lib/hotels/store.ts"
click node_join_ui "https://github.com/misterbamrungsuk-afk/misterbamrungsuk-web/blob/main/src/app/join/apply/page.tsx"
click node_join_register "https://github.com/misterbamrungsuk-afk/misterbamrungsuk-web/blob/main/src/app/api/join/register/route.ts"
click node_join_profile "https://github.com/misterbamrungsuk-afk/misterbamrungsuk-web/blob/main/src/app/api/join/profile/route.ts"
click node_join_store "https://github.com/misterbamrungsuk-afk/misterbamrungsuk-web/blob/main/src/lib/join/store.ts"
click node_live_people "https://github.com/misterbamrungsuk-afk/misterbamrungsuk-web/blob/main/src/lib/home/live.ts"
click node_admin "https://github.com/misterbamrungsuk-afk/misterbamrungsuk-web/blob/main/src/app/admin/page.tsx"
click node_customer_auth "https://github.com/misterbamrungsuk-afk/misterbamrungsuk-web/blob/main/src/lib/customer/auth.ts"
click node_customer_profile "https://github.com/misterbamrungsuk-afk/misterbamrungsuk-web/blob/main/src/lib/customer/profile.ts"
click node_slip_check "https://github.com/misterbamrungsuk-afk/misterbamrungsuk-web/blob/main/src/lib/slip2go.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_home,node_search,node_provider_profile toneBlue
class node_booking_ui,node_booking_api,node_booking_core,node_chat,node_tracking,node_calls toneAmber
class node_join_ui,node_join_register,node_join_profile,node_join_store,node_live_people,node_admin toneMint
class node_wallet,node_membership,node_market,node_hotels toneRose
class node_customer_auth,node_customer_profile,node_supabase,node_slip_check,node_customer toneIndigo
```

## Components

### Customer discovery

- [Home and feed](https://github.com/misterbamrungsuk-afk/misterbamrungsuk-web/blob/main/src/app/(app)/home/page.tsx): `src/app/(app)/home/page.tsx`
- [Search and map](https://github.com/misterbamrungsuk-afk/misterbamrungsuk-web/blob/main/src/app/(app)/search/page.tsx): `src/app/(app)/search/page.tsx`
- [Provider profiles](https://github.com/misterbamrungsuk-afk/misterbamrungsuk-web/blob/main/src/app/p/%5Bid%5D/view.tsx): `src/app/p/[id]/view.tsx`

### Booking experience

- [Booking flow](https://github.com/misterbamrungsuk-afk/misterbamrungsuk-web/blob/main/src/app/(app)/book/%5Bid%5D/flow.tsx): `src/app/(app)/book/[id]/flow.tsx`
- [Booking API](https://github.com/misterbamrungsuk-afk/misterbamrungsuk-web/blob/main/src/app/api/bookings/route.ts): `src/app/api/bookings/route.ts`
- [Booking rules](https://github.com/misterbamrungsuk-afk/misterbamrungsuk-web/blob/main/src/lib/bookings/index.ts): `src/lib/bookings/index.ts`
- [Booking chat](https://github.com/misterbamrungsuk-afk/misterbamrungsuk-web/blob/main/src/app/(app)/chat/%5BroomId%5D/page.tsx): `src/app/(app)/chat/[roomId]/page.tsx`
- [Live tracking](https://github.com/misterbamrungsuk-afk/misterbamrungsuk-web/blob/main/src/app/(app)/tracking/%5Bid%5D/page.tsx): `src/app/(app)/tracking/[id]/page.tsx`
- [Private calls](https://github.com/misterbamrungsuk-afk/misterbamrungsuk-web/blob/main/src/lib/calls/index.ts): `src/lib/calls/index.ts`

### Provider operations

- [Provider application](https://github.com/misterbamrungsuk-afk/misterbamrungsuk-web/blob/main/src/app/join/apply/page.tsx): `src/app/join/apply/page.tsx`
- [Application registration](https://github.com/misterbamrungsuk-afk/misterbamrungsuk-web/blob/main/src/app/api/join/register/route.ts): `src/app/api/join/register/route.ts`
- [Provider profile editing](https://github.com/misterbamrungsuk-afk/misterbamrungsuk-web/blob/main/src/app/api/join/profile/route.ts): `src/app/api/join/profile/route.ts`
- [Applicant records](https://github.com/misterbamrungsuk-afk/misterbamrungsuk-web/blob/main/src/lib/join/store.ts): `src/lib/join/store.ts`
- [Live provider listings](https://github.com/misterbamrungsuk-afk/misterbamrungsuk-web/blob/main/src/lib/home/live.ts): `src/lib/home/live.ts`
- [Admin operations](https://github.com/misterbamrungsuk-afk/misterbamrungsuk-web/blob/main/src/app/admin/page.tsx): `src/app/admin/page.tsx`

### Commerce services

- [Wallet and payouts](https://github.com/misterbamrungsuk-afk/misterbamrungsuk-web/blob/main/src/lib/wallet/index.ts): `src/lib/wallet/index.ts`
- [Membership](https://github.com/misterbamrungsuk-afk/misterbamrungsuk-web/blob/main/src/app/api/membership/route.ts): `src/app/api/membership/route.ts`
- [Marketplace](https://github.com/misterbamrungsuk-afk/misterbamrungsuk-web/blob/main/src/lib/market/store.ts): `src/lib/market/store.ts`
- [Hotel stays](https://github.com/misterbamrungsuk-afk/misterbamrungsuk-web/blob/main/src/lib/hotels/store.ts): `src/lib/hotels/store.ts`

### Shared platform

- [Customer authentication](https://github.com/misterbamrungsuk-afk/misterbamrungsuk-web/blob/main/src/lib/customer/auth.ts): `src/lib/customer/auth.ts`
- [Customer profile](https://github.com/misterbamrungsuk-afk/misterbamrungsuk-web/blob/main/src/lib/customer/profile.ts): `src/lib/customer/profile.ts`
- **Supabase services**
- [Slip verification](https://github.com/misterbamrungsuk-afk/misterbamrungsuk-web/blob/main/src/lib/slip2go.ts): `src/lib/slip2go.ts`

### Other components

- **Customer**

## Connections

- Customer → Home and feed: browses
- Home and feed → Provider profiles: opens profile
- Customer → Booking flow: requests booking
- Booking flow → Booking API: submits booking
- Booking API → Customer authentication: authenticates (evidence: `src/app/api/bookings/route.ts`)
- Booking API → Booking rules: creates booking (evidence: `src/app/api/bookings/route.ts`)
- Booking API → Live provider listings: finds provider (evidence: `src/app/api/bookings/route.ts`)
- Booking rules → Wallet and payouts: checks balance (evidence: `src/lib/bookings/index.ts`)
- Customer → Booking chat: coordinates booking
- Customer → Live tracking: tracks live
- Customer → Private calls: calls privately
- Customer → Provider application: applies as provider
- Provider application → Application registration: submits application
- Application registration → Applicant records: creates applicant (evidence: `src/app/api/join/register/route.ts`)
- Application registration → Slip verification: verifies slip (evidence: `src/app/api/join/register/route.ts`)
- Application registration → Supabase services: stores records
- Provider profile editing → Applicant records: saves profile (evidence: `src/app/api/join/profile/route.ts`)
- Live provider listings → Applicant records: lists applicants (evidence: `src/lib/home/live.ts`)
- Admin operations → Applicant records: reviews applicants
- Membership → Customer authentication: authenticates (evidence: `src/app/api/membership/route.ts`)
- Membership → Customer profile: reads profile (evidence: `src/app/api/membership/route.ts`)
- Customer → Membership: manages membership
- Customer → Marketplace: shops marketplace
- Customer → Hotel stays: books stays
- Customer authentication → Supabase services: reads sessions (evidence: `src/lib/customer/auth.ts`)
- Customer profile → Supabase services: reads and writes (evidence: `src/lib/customer/profile.ts`)
