# erzamadana-ui/antarkita architecture

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

- Interactive diagram: https://gitdiagram.com/erzamadana-ui/antarkita
- Repository: https://github.com/erzamadana-ui/antarkita

## Overview

AntarKita is a Supabase-backed, three-app super-app for customer bookings, partner fulfillment, and administrative operations. The main flow is service discovery and booking, payment, partner acceptance and status updates, then customer tracking and operational oversight. The README documents the broader service and role capabilities; sampled source and the SOURCE INDEX support selected client and payment-handler relationships. Some screen-to-backend wiring is not shown, so those links are omitted rather than inferred.

Main entry points: [`apps/pelanggan/app`](https://github.com/erzamadana-ui/antarkita/tree/main/apps/pelanggan/app) (Customer app), [`src/screens/shop/index.tsx`](https://github.com/erzamadana-ui/antarkita/blob/main/src/screens/shop/index.tsx) (Shop and market), [`apps/mitra/app`](https://github.com/erzamadana-ui/antarkita/tree/main/apps/mitra/app) (Mitra app), [`supabase/functions/_shared/ingest.ts`](https://github.com/erzamadana-ui/antarkita/blob/main/supabase/functions/_shared/ingest.ts) (Event ingestion)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_customer["Customer services"]
  node_customer_app["Customer app"]
  node_ride["Ride booking<br/>[index.tsx]"]
  node_food["Food ordering<br/>[index.tsx]"]
  node_send["Send booking<br/>[index.tsx]"]
  node_shop_market["Shop and market<br/>[index.tsx]"]
  node_travel["Travel booking<br/>[index.tsx]"]
  node_booking_sheet["Booking sheet<br/>[BookingSheet.tsx]"]
  node_order_tracking["Order tracking<br/>[detail.tsx]"]
end

subgraph group_partners["Partner fulfillment"]
  node_mitra_app["Mitra app"]
  node_driver_ops["Driver operations<br/>[order.tsx]"]
  node_merchant_ops["Merchant operations<br/>[index.tsx]"]
  node_travel_ops["Travel partner<br/>[travel.tsx]"]
end

subgraph group_operations["Operations"]
  node_admin_app["Admin app"]
  node_admin_ops["Operations panel<br/>[index.tsx]"]
  node_exec_portal["Executive portal<br/>[index.tsx]"]
end

subgraph group_shared["Shared client"]
  node_auth["Identity and profile<br/>[auth.ts]"]
  node_settings["Service settings<br/>[useAppSettings.ts]"]
  node_city_status["City availability<br/>[useCityStatus.ts]"]
  node_geo["Places and routing<br/>[geo.ts]"]
  node_supabase_client["Supabase client<br/>[supabase.ts]"]
  node_payments_client["Payment client<br/>[payments.ts]"]
end

subgraph group_payments["Payment backend"]
  node_payment_handlers["Payment handlers<br/>[handler.ts]"]
  node_payment_webhook["Payment webhook<br/>[handler.ts]"]
  node_payment_disburse["Disbursement handler<br/>[handler.ts]"]
  node_payment_reconcile["Reconciliation handler<br/>[handler.ts]"]
  node_payment_refund["Refund handler<br/>[handler.ts]"]
  node_providers["Payment providers<br/>[index.ts]"]
  node_ingest["Event ingestion<br/>[ingest.ts]"]
  node_logging["Redaction and logs<br/>[log.ts]"]
end

node_customer_actor(("Customer"))
node_partner_actor(("Driver and merchant"))
node_admin_actor(("Admin"))
node_supabase[("Supabase services")]

node_customer_actor -->|"uses"| node_customer_app
node_customer_app -->|"books rides"| node_ride
node_customer_app -->|"orders food"| node_food
node_customer_app -->|"books delivery"| node_send
node_customer_app -->|"shops"| node_shop_market
node_customer_app -->|"books travel"| node_travel
node_ride -.->|"uses"| node_booking_sheet
node_food -.->|"uses"| node_booking_sheet
node_shop_market -->|"uses"| node_booking_sheet
node_travel -->|"uses"| node_booking_sheet
node_partner_actor -->|"uses"| node_mitra_app
node_mitra_app -->|"fulfills rides"| node_driver_ops
node_mitra_app -->|"fulfills orders"| node_merchant_ops
node_mitra_app -->|"handles travel"| node_travel_ops
node_customer_app -->|"tracks orders"| node_order_tracking
node_admin_actor -->|"uses"| node_admin_app
node_admin_app -->|"operates"| node_admin_ops
node_admin_app -->|"opens portal"| node_exec_portal
node_customer_app -->|"shares account"| node_auth
node_mitra_app -->|"shares account"| node_auth
node_admin_app -->|"admin sign-in"| node_auth
node_ride -.->|"reads settings"| node_settings
node_shop_market -->|"reads settings"| node_settings
node_shop_market -->|"checks availability"| node_city_status
node_travel -->|"checks availability"| node_city_status
node_shop_market -->|"uses places"| node_geo
node_travel -->|"uses routing"| node_geo
node_auth -->|"queries"| node_supabase_client
node_settings -->|"calls RPC"| node_supabase_client
node_city_status -->|"calls RPC"| node_supabase_client
node_supabase_client -->|"connects"| node_supabase
node_booking_sheet -->|"uses"| node_payments_client
node_payments_client -.->|"invokes"| node_payment_handlers
node_payment_handlers -->|"selects provider"| node_providers
node_payment_handlers -->|"records events"| node_ingest
node_payment_webhook -->|"uses provider"| node_providers
node_payment_webhook -->|"ingests events"| node_ingest
node_payment_disburse -->|"selects provider"| node_providers
node_payment_disburse -->|"records events"| node_ingest
node_payment_reconcile -->|"uses provider"| node_providers
node_payment_reconcile -->|"imports handler"| node_payment_refund
node_payment_refund -->|"selects provider"| node_providers
node_payment_handlers -.->|"logs events"| node_logging
node_ingest -->|"redacts data"| node_logging
node_ingest -->|"writes RPC"| node_supabase

click node_customer_app "https://github.com/erzamadana-ui/antarkita/tree/main/apps/pelanggan/app"
click node_ride "https://github.com/erzamadana-ui/antarkita/blob/main/src/screens/ride/index.tsx"
click node_food "https://github.com/erzamadana-ui/antarkita/blob/main/src/screens/food/index.tsx"
click node_send "https://github.com/erzamadana-ui/antarkita/blob/main/src/screens/send/index.tsx"
click node_shop_market "https://github.com/erzamadana-ui/antarkita/blob/main/src/screens/shop/index.tsx"
click node_travel "https://github.com/erzamadana-ui/antarkita/blob/main/src/screens/travel/index.tsx"
click node_booking_sheet "https://github.com/erzamadana-ui/antarkita/blob/main/src/components/BookingSheet.tsx"
click node_order_tracking "https://github.com/erzamadana-ui/antarkita/blob/main/src/screens/order/detail.tsx"
click node_mitra_app "https://github.com/erzamadana-ui/antarkita/tree/main/apps/mitra/app"
click node_driver_ops "https://github.com/erzamadana-ui/antarkita/blob/main/src/screens/driver/order.tsx"
click node_merchant_ops "https://github.com/erzamadana-ui/antarkita/blob/main/src/screens/merchant/tabs/index.tsx"
click node_travel_ops "https://github.com/erzamadana-ui/antarkita/blob/main/src/screens/driver/travel.tsx"
click node_admin_app "https://github.com/erzamadana-ui/antarkita/tree/main/apps/admin/app"
click node_admin_ops "https://github.com/erzamadana-ui/antarkita/blob/main/src/screens/admin/index.tsx"
click node_exec_portal "https://github.com/erzamadana-ui/antarkita/blob/main/src/screens/exec/index.tsx"
click node_auth "https://github.com/erzamadana-ui/antarkita/blob/main/src/store/auth.ts"
click node_settings "https://github.com/erzamadana-ui/antarkita/blob/main/src/hooks/useAppSettings.ts"
click node_city_status "https://github.com/erzamadana-ui/antarkita/blob/main/src/hooks/useCityStatus.ts"
click node_geo "https://github.com/erzamadana-ui/antarkita/blob/main/src/lib/geo.ts"
click node_supabase_client "https://github.com/erzamadana-ui/antarkita/blob/main/src/lib/supabase.ts"
click node_payments_client "https://github.com/erzamadana-ui/antarkita/blob/main/src/lib/payments.ts"
click node_payment_handlers "https://github.com/erzamadana-ui/antarkita/blob/main/supabase/functions/pay-create/handler.ts"
click node_payment_webhook "https://github.com/erzamadana-ui/antarkita/blob/main/supabase/functions/pay-webhook/handler.ts"
click node_payment_disburse "https://github.com/erzamadana-ui/antarkita/blob/main/supabase/functions/pay-disburse/handler.ts"
click node_payment_reconcile "https://github.com/erzamadana-ui/antarkita/blob/main/supabase/functions/pay-reconcile/handler.ts"
click node_payment_refund "https://github.com/erzamadana-ui/antarkita/blob/main/supabase/functions/pay-refund/handler.ts"
click node_providers "https://github.com/erzamadana-ui/antarkita/blob/main/supabase/functions/_shared/providers/index.ts"
click node_ingest "https://github.com/erzamadana-ui/antarkita/blob/main/supabase/functions/_shared/ingest.ts"
click node_logging "https://github.com/erzamadana-ui/antarkita/blob/main/supabase/functions/_shared/log.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_customer_app,node_ride,node_food,node_send,node_shop_market,node_travel,node_booking_sheet,node_order_tracking toneBlue
class node_mitra_app,node_driver_ops,node_merchant_ops,node_travel_ops,node_supabase toneAmber
class node_admin_app,node_admin_ops,node_exec_portal toneMint
class node_auth,node_settings,node_city_status,node_geo,node_supabase_client,node_payments_client toneRose
class node_payment_handlers,node_payment_webhook,node_payment_disburse,node_payment_reconcile,node_payment_refund,node_providers,node_ingest,node_logging,node_customer_actor,node_partner_actor,node_admin_actor toneIndigo
```

## Components

### Customer services

- [Customer app](https://github.com/erzamadana-ui/antarkita/tree/main/apps/pelanggan/app): `apps/pelanggan/app`
- [Ride booking](https://github.com/erzamadana-ui/antarkita/blob/main/src/screens/ride/index.tsx): `src/screens/ride/index.tsx`
- [Food ordering](https://github.com/erzamadana-ui/antarkita/blob/main/src/screens/food/index.tsx): `src/screens/food/index.tsx`
- [Send booking](https://github.com/erzamadana-ui/antarkita/blob/main/src/screens/send/index.tsx): `src/screens/send/index.tsx`
- [Shop and market](https://github.com/erzamadana-ui/antarkita/blob/main/src/screens/shop/index.tsx): `src/screens/shop/index.tsx`
- [Travel booking](https://github.com/erzamadana-ui/antarkita/blob/main/src/screens/travel/index.tsx): `src/screens/travel/index.tsx`
- [Booking sheet](https://github.com/erzamadana-ui/antarkita/blob/main/src/components/BookingSheet.tsx): `src/components/BookingSheet.tsx`
- [Order tracking](https://github.com/erzamadana-ui/antarkita/blob/main/src/screens/order/detail.tsx): `src/screens/order/detail.tsx`

### Partner fulfillment

- [Mitra app](https://github.com/erzamadana-ui/antarkita/tree/main/apps/mitra/app): `apps/mitra/app`
- [Driver operations](https://github.com/erzamadana-ui/antarkita/blob/main/src/screens/driver/order.tsx): `src/screens/driver/order.tsx`
- [Merchant operations](https://github.com/erzamadana-ui/antarkita/blob/main/src/screens/merchant/tabs/index.tsx): `src/screens/merchant/tabs/index.tsx`
- [Travel partner](https://github.com/erzamadana-ui/antarkita/blob/main/src/screens/driver/travel.tsx): `src/screens/driver/travel.tsx`

### Operations

- [Admin app](https://github.com/erzamadana-ui/antarkita/tree/main/apps/admin/app): `apps/admin/app`
- [Operations panel](https://github.com/erzamadana-ui/antarkita/blob/main/src/screens/admin/index.tsx): `src/screens/admin/index.tsx`
- [Executive portal](https://github.com/erzamadana-ui/antarkita/blob/main/src/screens/exec/index.tsx): `src/screens/exec/index.tsx`

### Shared client

- [Identity and profile](https://github.com/erzamadana-ui/antarkita/blob/main/src/store/auth.ts): `src/store/auth.ts`
- [Service settings](https://github.com/erzamadana-ui/antarkita/blob/main/src/hooks/useAppSettings.ts): `src/hooks/useAppSettings.ts`
- [City availability](https://github.com/erzamadana-ui/antarkita/blob/main/src/hooks/useCityStatus.ts): `src/hooks/useCityStatus.ts`
- [Places and routing](https://github.com/erzamadana-ui/antarkita/blob/main/src/lib/geo.ts): `src/lib/geo.ts`
- [Supabase client](https://github.com/erzamadana-ui/antarkita/blob/main/src/lib/supabase.ts): `src/lib/supabase.ts`
- [Payment client](https://github.com/erzamadana-ui/antarkita/blob/main/src/lib/payments.ts): `src/lib/payments.ts`

### Payment backend

- [Payment handlers](https://github.com/erzamadana-ui/antarkita/blob/main/supabase/functions/pay-create/handler.ts): `supabase/functions/pay-create/handler.ts`
- [Payment webhook](https://github.com/erzamadana-ui/antarkita/blob/main/supabase/functions/pay-webhook/handler.ts): `supabase/functions/pay-webhook/handler.ts`
- [Disbursement handler](https://github.com/erzamadana-ui/antarkita/blob/main/supabase/functions/pay-disburse/handler.ts): `supabase/functions/pay-disburse/handler.ts`
- [Reconciliation handler](https://github.com/erzamadana-ui/antarkita/blob/main/supabase/functions/pay-reconcile/handler.ts): `supabase/functions/pay-reconcile/handler.ts`
- [Refund handler](https://github.com/erzamadana-ui/antarkita/blob/main/supabase/functions/pay-refund/handler.ts): `supabase/functions/pay-refund/handler.ts`
- [Payment providers](https://github.com/erzamadana-ui/antarkita/blob/main/supabase/functions/_shared/providers/index.ts): `supabase/functions/_shared/providers/index.ts`
- [Event ingestion](https://github.com/erzamadana-ui/antarkita/blob/main/supabase/functions/_shared/ingest.ts): `supabase/functions/_shared/ingest.ts`
- [Redaction and logs](https://github.com/erzamadana-ui/antarkita/blob/main/supabase/functions/_shared/log.ts): `supabase/functions/_shared/log.ts`

### Other components

- **Customer**
- **Driver and merchant**
- **Admin**
- **Supabase services**

## Connections

- Customer → Customer app: uses (evidence: `README.md`)
- Customer app → Ride booking: books rides (evidence: `README.md`)
- Customer app → Food ordering: orders food (evidence: `README.md`)
- Customer app → Send booking: books delivery (evidence: `README.md`)
- Customer app → Shop and market: shops (evidence: `README.md`)
- Customer app → Travel booking: books travel (evidence: `README.md`)
- Ride booking → Booking sheet: uses
- Food ordering → Booking sheet: uses
- Shop and market → Booking sheet: uses (evidence: `src/screens/shop/index.tsx`)
- Travel booking → Booking sheet: uses (evidence: `src/screens/travel/index.tsx`)
- Driver and merchant → Mitra app: uses (evidence: `README.md`)
- Mitra app → Driver operations: fulfills rides (evidence: `README.md`)
- Mitra app → Merchant operations: fulfills orders (evidence: `README.md`)
- Mitra app → Travel partner: handles travel (evidence: `README.md`)
- Customer app → Order tracking: tracks orders (evidence: `README.md`)
- Admin → Admin app: uses (evidence: `README.md`)
- Admin app → Operations panel: operates (evidence: `README.md`)
- Admin app → Executive portal: opens portal (evidence: `README.md`)
- Customer app → Identity and profile: shares account (evidence: `README.md`)
- Mitra app → Identity and profile: shares account (evidence: `README.md`)
- Admin app → Identity and profile: admin sign-in (evidence: `README.md`)
- Ride booking → Service settings: reads settings
- Shop and market → Service settings: reads settings (evidence: `src/screens/shop/index.tsx`)
- Shop and market → City availability: checks availability (evidence: `src/screens/shop/index.tsx`)
- Travel booking → City availability: checks availability (evidence: `src/screens/travel/index.tsx`)
- Shop and market → Places and routing: uses places (evidence: `src/screens/shop/index.tsx`)
- Travel booking → Places and routing: uses routing (evidence: `src/screens/travel/index.tsx`)
- Identity and profile → Supabase client: queries (evidence: `src/store/auth.ts`)
- Service settings → Supabase client: calls RPC (evidence: `src/hooks/useAppSettings.ts`)
- City availability → Supabase client: calls RPC (evidence: `src/hooks/useCityStatus.ts`)
- Supabase client → Supabase services: connects (evidence: `README.md`)
- Booking sheet → Payment client: uses (evidence: `src/components/BookingSheet.tsx`)
- Payment client → Payment handlers: invokes
- Payment handlers → Payment providers: selects provider (evidence: `supabase/functions/pay-create/handler.ts`)
- Payment handlers → Event ingestion: records events (evidence: `supabase/functions/pay-create/handler.ts`)
- Payment webhook → Payment providers: uses provider (evidence: `supabase/functions/pay-webhook/handler.ts`)
- Payment webhook → Event ingestion: ingests events (evidence: `supabase/functions/pay-webhook/handler.ts`)
- Disbursement handler → Payment providers: selects provider (evidence: `supabase/functions/pay-disburse/handler.ts`)
- Disbursement handler → Event ingestion: records events (evidence: `supabase/functions/pay-disburse/handler.ts`)
- Reconciliation handler → Payment providers: uses provider (evidence: `supabase/functions/pay-reconcile/handler.ts`)
- Reconciliation handler → Refund handler: imports handler (evidence: `supabase/functions/pay-reconcile/handler.ts`)
- Refund handler → Payment providers: selects provider (evidence: `supabase/functions/pay-refund/handler.ts`)
- Payment handlers → Redaction and logs: logs events (evidence: `supabase/functions/pay-create/handler.ts`)
- Event ingestion → Redaction and logs: redacts data (evidence: `supabase/functions/_shared/ingest.ts`)
- Event ingestion → Supabase services: writes RPC (evidence: `supabase/functions/_shared/ingest.ts`)
