# jangbersahaja/fishon-market architecture

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

- Interactive diagram: https://gitdiagram.com/jangbersahaja/fishon-market
- Repository: https://github.com/jangbersahaja/fishon-market

## Overview

Fishon.my is a fishing-charter marketplace for anglers and captains. The principal journey is discovering and comparing charters, selecting a trip, submitting a booking through manual or payment-enabled flows, and receiving a booking outcome; accounts support follow-up bookings, messages, notifications, and reviews. The README also documents bilingual presentation, a blog CMS, analytics, promotions, and captain-side integrations. Booking and payment relationships are grounded in the sampled API handlers; other capability links reflect documented product scope, with uncertain internal wiring omitted.

Main entry points: [`src/app/api/bookings/create/route.ts`](https://github.com/jangbersahaja/fishon-market/blob/main/src/app/api/bookings/create/route.ts) (Booking creation), [`src/app/api/bookings/create-guest/route.ts`](https://github.com/jangbersahaja/fishon-market/blob/main/src/app/api/bookings/create-guest/route.ts) (Guest booking), [`src/app/api/bookings/create-manual/route.ts`](https://github.com/jangbersahaja/fishon-market/blob/main/src/app/api/bookings/create-manual/route.ts) (Manual booking), [`src/lib/services/trip-service.ts`](https://github.com/jangbersahaja/fishon-market/blob/main/src/lib/services/trip-service.ts) (Trip data)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_marketplace["Charter marketplace"]
  node_browse["Browse and search<br/>[page.tsx]"]
  node_results["Search results"]
  node_charter["Charter details<br/>[page.tsx]"]
end

subgraph group_booking["Bookings and payments"]
  node_createbooking["Booking creation<br/>[route.ts]"]
  node_guestbooking["Guest booking<br/>[route.ts]"]
  node_manualbooking["Manual booking<br/>[route.ts]"]
  node_bookings[("Booking records<br/>[prisma.ts]")]
  node_payment["Payment gateway<br/>[payment-gateway.ts]"]
  node_senangpay["SenangPay<br/>[senangpay.ts]"]
  node_callback["Payment callback<br/>[route.ts]"]
  node_effects["Payment effects"]
end

subgraph group_engagement["Accounts and engagement"]
  node_account["Angler account<br/>[page.tsx]"]
  node_messages["Messaging<br/>[message-service.ts]"]
  node_pusher["Pusher realtime<br/>[server.ts]"]
  node_reviews["Reviews<br/>[review-service.ts]"]
  node_notifications["Notifications"]
  node_blog["Blog and CMS<br/>[blog-service.ts]"]
end

subgraph group_platform["Platform services"]
  node_tripdata["Trip data<br/>[trip-service.ts]"]
  node_captaindb[("Captain data<br/>[prisma-captain.ts]")]
  node_analytics["Analytics"]
  node_i18n["Localization<br/>[config.ts]"]
end

node_angler(("Angler"))
node_captain{{"Captain services"}}

node_angler -->|"searches"| node_browse
node_browse -->|"shows results"| node_results
node_results -->|"opens charter"| node_charter
node_charter -->|"submits booking"| node_createbooking
node_angler -->|"books as guest"| node_guestbooking
node_angler -->|"requests booking"| node_manualbooking
node_createbooking -->|"fetches trip"| node_tripdata
node_guestbooking -->|"fetches trip"| node_tripdata
node_manualbooking -->|"fetches trip"| node_tripdata
node_tripdata -->|"reads charter data"| node_captaindb
node_createbooking -->|"creates records"| node_bookings
node_guestbooking -->|"creates records"| node_bookings
node_manualbooking -->|"creates record"| node_bookings
node_createbooking -->|"creates intent"| node_payment
node_guestbooking -->|"creates intent"| node_payment
node_payment -->|"initiates payment"| node_senangpay
node_senangpay -->|"returns payment"| node_callback
node_callback -->|"updates status"| node_bookings
node_callback -->|"triggers effects"| node_effects
node_createbooking -->|"creates conversation"| node_messages
node_manualbooking -->|"creates conversation"| node_messages
node_messages -.->|"dispatches realtime"| node_pusher
node_angler -->|"manages bookings"| node_account
node_account -->|"submits feedback"| node_reviews
node_angler -->|"reads articles"| node_blog
node_createbooking -->|"tracks booking"| node_analytics
node_guestbooking -->|"tracks booking"| node_analytics
node_manualbooking -->|"tracks booking"| node_analytics
node_charter -.->|"lists charter"| node_captain
node_angler -->|"chooses language"| node_i18n

click node_browse "https://github.com/jangbersahaja/fishon-market/blob/main/src/app/%5Blocale%5D/(marketplace)/search/page.tsx"
click node_results "https://github.com/jangbersahaja/fishon-market/blob/main/src/app/%5Blocale%5D/(marketplace)/search/SearchResultsClient.tsx"
click node_charter "https://github.com/jangbersahaja/fishon-market/blob/main/src/app/%5Blocale%5D/(marketplace)/charters/%5Bid%5D/page.tsx"
click node_tripdata "https://github.com/jangbersahaja/fishon-market/blob/main/src/lib/services/trip-service.ts"
click node_captaindb "https://github.com/jangbersahaja/fishon-market/blob/main/src/lib/database/prisma-captain.ts"
click node_createbooking "https://github.com/jangbersahaja/fishon-market/blob/main/src/app/api/bookings/create/route.ts"
click node_guestbooking "https://github.com/jangbersahaja/fishon-market/blob/main/src/app/api/bookings/create-guest/route.ts"
click node_manualbooking "https://github.com/jangbersahaja/fishon-market/blob/main/src/app/api/bookings/create-manual/route.ts"
click node_bookings "https://github.com/jangbersahaja/fishon-market/blob/main/src/lib/database/prisma.ts"
click node_payment "https://github.com/jangbersahaja/fishon-market/blob/main/src/lib/payment/payment-gateway.ts"
click node_senangpay "https://github.com/jangbersahaja/fishon-market/blob/main/src/lib/payment/senangpay.ts"
click node_callback "https://github.com/jangbersahaja/fishon-market/blob/main/src/app/api/payment/senangpay-callback/route.ts"
click node_effects "https://github.com/jangbersahaja/fishon-market/blob/main/src/lib/payment/payment-side-effects.ts"
click node_account "https://github.com/jangbersahaja/fishon-market/blob/main/src/app/%5Blocale%5D/(account)/account/page.tsx"
click node_messages "https://github.com/jangbersahaja/fishon-market/blob/main/src/lib/services/message-service.ts"
click node_pusher "https://github.com/jangbersahaja/fishon-market/blob/main/src/lib/pusher/server.ts"
click node_reviews "https://github.com/jangbersahaja/fishon-market/blob/main/src/lib/services/review-service.ts"
click node_notifications "https://github.com/jangbersahaja/fishon-market/blob/main/src/lib/services/notification-service.ts"
click node_blog "https://github.com/jangbersahaja/fishon-market/blob/main/src/lib/services/blog-service.ts"
click node_analytics "https://github.com/jangbersahaja/fishon-market/blob/main/src/lib/analytics-service.ts"
click node_i18n "https://github.com/jangbersahaja/fishon-market/blob/main/src/i18n/config.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_browse,node_results,node_charter toneBlue
class node_createbooking,node_guestbooking,node_manualbooking,node_bookings,node_payment,node_senangpay,node_callback,node_effects toneAmber
class node_account,node_messages,node_pusher,node_reviews,node_notifications,node_blog toneMint
class node_tripdata,node_captaindb,node_analytics,node_i18n toneRose
class node_angler,node_captain toneIndigo
```

## Components

### Charter marketplace

- [Browse and search](https://github.com/jangbersahaja/fishon-market/blob/main/src/app/%5Blocale%5D/(marketplace)/search/page.tsx): `src/app/[locale]/(marketplace)/search/page.tsx`
- [Search results](https://github.com/jangbersahaja/fishon-market/blob/main/src/app/%5Blocale%5D/(marketplace)/search/SearchResultsClient.tsx): `src/app/[locale]/(marketplace)/search/SearchResultsClient.tsx`
- [Charter details](https://github.com/jangbersahaja/fishon-market/blob/main/src/app/%5Blocale%5D/(marketplace)/charters/%5Bid%5D/page.tsx): `src/app/[locale]/(marketplace)/charters/[id]/page.tsx`

### Bookings and payments

- [Booking creation](https://github.com/jangbersahaja/fishon-market/blob/main/src/app/api/bookings/create/route.ts): `src/app/api/bookings/create/route.ts`
- [Guest booking](https://github.com/jangbersahaja/fishon-market/blob/main/src/app/api/bookings/create-guest/route.ts): `src/app/api/bookings/create-guest/route.ts`
- [Manual booking](https://github.com/jangbersahaja/fishon-market/blob/main/src/app/api/bookings/create-manual/route.ts): `src/app/api/bookings/create-manual/route.ts`
- [Booking records](https://github.com/jangbersahaja/fishon-market/blob/main/src/lib/database/prisma.ts): `src/lib/database/prisma.ts`
- [Payment gateway](https://github.com/jangbersahaja/fishon-market/blob/main/src/lib/payment/payment-gateway.ts): `src/lib/payment/payment-gateway.ts`
- [SenangPay](https://github.com/jangbersahaja/fishon-market/blob/main/src/lib/payment/senangpay.ts): `src/lib/payment/senangpay.ts`
- [Payment callback](https://github.com/jangbersahaja/fishon-market/blob/main/src/app/api/payment/senangpay-callback/route.ts): `src/app/api/payment/senangpay-callback/route.ts`
- [Payment effects](https://github.com/jangbersahaja/fishon-market/blob/main/src/lib/payment/payment-side-effects.ts): `src/lib/payment/payment-side-effects.ts`

### Accounts and engagement

- [Angler account](https://github.com/jangbersahaja/fishon-market/blob/main/src/app/%5Blocale%5D/(account)/account/page.tsx): `src/app/[locale]/(account)/account/page.tsx`
- [Messaging](https://github.com/jangbersahaja/fishon-market/blob/main/src/lib/services/message-service.ts): `src/lib/services/message-service.ts`
- [Pusher realtime](https://github.com/jangbersahaja/fishon-market/blob/main/src/lib/pusher/server.ts): `src/lib/pusher/server.ts`
- [Reviews](https://github.com/jangbersahaja/fishon-market/blob/main/src/lib/services/review-service.ts): `src/lib/services/review-service.ts`
- [Notifications](https://github.com/jangbersahaja/fishon-market/blob/main/src/lib/services/notification-service.ts): `src/lib/services/notification-service.ts`
- [Blog and CMS](https://github.com/jangbersahaja/fishon-market/blob/main/src/lib/services/blog-service.ts): `src/lib/services/blog-service.ts`

### Platform services

- [Trip data](https://github.com/jangbersahaja/fishon-market/blob/main/src/lib/services/trip-service.ts): `src/lib/services/trip-service.ts`
- [Captain data](https://github.com/jangbersahaja/fishon-market/blob/main/src/lib/database/prisma-captain.ts): `src/lib/database/prisma-captain.ts`
- [Analytics](https://github.com/jangbersahaja/fishon-market/blob/main/src/lib/analytics-service.ts): `src/lib/analytics-service.ts`
- [Localization](https://github.com/jangbersahaja/fishon-market/blob/main/src/i18n/config.ts): `src/i18n/config.ts`

### Other components

- **Angler**
- **Captain services**

## Connections

- Angler → Browse and search: searches
- Browse and search → Search results: shows results
- Search results → Charter details: opens charter
- Charter details → Booking creation: submits booking
- Angler → Guest booking: books as guest
- Angler → Manual booking: requests booking
- Booking creation → Trip data: fetches trip
- Guest booking → Trip data: fetches trip
- Manual booking → Trip data: fetches trip
- Trip data → Captain data: reads charter data
- Booking creation → Booking records: creates records
- Guest booking → Booking records: creates records
- Manual booking → Booking records: creates record
- Booking creation → Payment gateway: creates intent
- Guest booking → Payment gateway: creates intent
- Payment gateway → SenangPay: initiates payment
- SenangPay → Payment callback: returns payment
- Payment callback → Booking records: updates status
- Payment callback → Payment effects: triggers effects
- Booking creation → Messaging: creates conversation
- Manual booking → Messaging: creates conversation
- Messaging → Pusher realtime: dispatches realtime
- Angler → Angler account: manages bookings
- Angler account → Reviews: submits feedback
- Angler → Blog and CMS: reads articles
- Booking creation → Analytics: tracks booking
- Guest booking → Analytics: tracks booking
- Manual booking → Analytics: tracks booking
- Charter details → Captain services: lists charter
- Angler → Localization: chooses language
