kemah-ios

Handoff: Kemah — Camping Trip Planner (iOS)

Version: 1.3.0 — see CHANGELOG.md for history. Older snapshots live under versions/. The visual reference prototype is in reference/.

Overview

Kemah is a trip-planning app for group camping trips: packing checklist, budget tracking with split-bill settlement, participant management, invites, and social sharing. This package documents an interactive HTML prototype (reference/Kemah Travel App.dc.html, included for reference) so it can be rebuilt as a real iOS app.

About the Design Files

The bundled HTML file is a design reference prototype, not production code. It was built as a single-file interactive mock to validate flows and logic (especially the split-bill math). The task is to recreate this experience in the target codebase’s real environment (SwiftUI recommended for iOS-only; React Native/Flutter if Android is also planned) using that platform’s native components and patterns — not to embed or wrap the HTML.

Note: the v1.1.0 personal-expense and personal-item-privacy features (see the changelog) are not shown in the reference prototype — they were added after it. Build them from this document, not the HTML.

Fidelity

High-fidelity for structure and logic, medium-fidelity for visual polish. Colors, type, spacing, and copy are final enough to build from directly, but treat them as a strong starting point rather than pixel law — prefer the target platform’s native controls (nav bars, sheets, share sheets, date pickers) over recreating custom HTML chrome.

Design Tokens

Color (defined as CSS oklch(), convert to the nearest sRGB hex in-platform):

Typography

Spacing / shape

Screens / Views

1. Login

2. Home

3. Trip Detail

Checklist tab

Budget tab

Peserta tab

4. Split Bill (full screen, pushed from Budget tab)

Split Bill Logic (port this exactly — it’s the core value of the app)

Each expense item has: name, price, paidBy (who fronted the money — always set), pic (optional — who/what group the cost belongs to, only meaningful in “Per PIC” mode), splitMode ('orang' 'pic'), and [v1.1.0] isPersonal (bool) + owner (set when personal).

Step 0 — exclude personal (v1.1.0). Before any split math, drop every item with isPersonal: true. Personal expenses are private to their owner and never split, pooled, or netted. Only group expenses (isPersonal: false) enter the algorithm below.

Per Orang items (e.g. shared food): pooled together (sharedSpent). Each participant’s fair share = sharedSpent × (their headcount / sum of all participants' headcount). Bigger families/groups (higher headcount) pay proportionally more. Credited to whoever’s paidBy.

Per PIC items split into three cases based on pic and paidBy:

Settlement calculation

  1. Drop self-paid Per-PIC items (pic == paidBy) — they are already settled and must not enter any pool or debt.
  2. For each participant, balance = (Per-Orang contribution − Per-Orang fair share) + (pooled Per-PIC contribution − flat Per-PIC share).
  3. Run a greedy debt-simplification: sort debtors (negative balance) and creditors (positive balance) by magnitude descending, repeatedly match the largest debtor with the largest creditor, transfer min(|debt|, credit), reduce both, continue until all balances are ~0. This minimizes the number of transactions (standard “splitwise” settlement algorithm).
  4. Append the direct-debt transfers (from case above) as-is, not netted through the pool.
  5. Merge transfers by (from, to) pair — if a person owes the same recipient from multiple sources (pool settlement + a direct debt), show ONE combined row with the total, and let the UI expand it to reveal the itemized parts (each part labeled either “Bagi rata” for pool-derived amounts, or the specific expense name for direct debts).

Thresholds: balances within ±1000 are considered “Lunas” (settled); the greedy matcher ignores amounts ≤ 500.

Interactions & Behavior

State Management (data model)

Trip {
  id, name, location, dateLabel, mapLink, phone, coverId (photo ref),
  status: 'upcoming' | 'selesai',
  budgetTarget: number,
  budgetMode: 'manual' | 'auto',
  ownerId: string,                                                            // userId pembuat trip (v1.7.0)
  participants: [{ id, userId?, name, picForLabel (role), headcount }],       // userId added (v1.7.0)
  items: [{ name, qty, pic, note, checked, isPersonal, owner? }],           // owner set for personal items (v1.1.0)
  budgetItems: [{ name, price, pic, paidBy, splitMode, isPersonal, owner? }] // isPersonal + owner added (v1.1.0)
}

[v1.7.0] Aturan manajemen peserta:

Assets

Files


Seed Data (Dev / QA)

Data di bawah adalah seed yang digunakan MockRepository di iOS app. Backend developer dapat menggunakan ini untuk seed database awal agar iOS app langsung bisa konek dan menghasilkan settlement yang deterministic dan bisa diverifikasi.

Logged-in user (default mock session)

{ "id": "u_irma", "name": "Irma", "email": "irma@example.com", "avatarUrl": null }

Trip 1 — Camping Gunung Papandayan

{
  "id": "t1",
  "name": "Camping Gunung Papandayan",
  "location": "Garut, Jawa Barat",
  "date": "2026-08-01",
  "coverUrl": null,
  "mapLink": "https://maps.google.com/?q=Gunung+Papandayan",
  "phone": "081234567890",
  "status": "upcoming",
  "budgetTarget": 1200000,
  "budgetMode": "manual"
}

Participants | id | name | picForLabel | headcount | |—|—|—|—| | p_irma | Irma | Koordinator | 3 | | p_yuki | Yuki | PIC Tenda | 4 | | p_pepi | Pepi | PIC Memasak | 4 | | p_ria | Ria | PIC Tiket & Logistik | 3 |

Checklist Items (group — visible to all) | id | name | qty | pic | note | checked | |—|—|—|—|—|—| | i1 | Tenda dome 4 orang | 1 | Yuki | cek patok & pasak lengkap | ✓ | | i2 | Matras alas tenda | 4 | Pepi | | | | i3 | Flysheet / terpal | 1 | Yuki | pinjam punya Doni | | | i4 | Palu & pasak cadangan | 1 | Yuki | | | | i5 | Kompor portable + gas | 1 | Pepi | | ✓ | | i6 | Nesting alat masak | 1 | Pepi | udah punya | ✓ | | i7 | Bahan makanan 3 hari | 1 | Ria | | | | i8 | Air minum galon | 2 | Pepi | | | | i9 | Tiket masuk kawasan | 4 | Ria | beli online H-3 | ✓ | | i10 | Tiket parkir kendaraan | 1 | Yuki | | | | i11 | Retribusi camp ground | 1 | Ria | | |

Checklist Items (personal — private, visible only to owner) | id | name | qty | owner | note | |—|—|—|—|—| | i12 | Baju ganti & jaket hangat | 3 | Irma | sesuaikan cuaca | | i13 | Alat mandi pribadi | 1 | Irma | | | i14 | Obat pribadi | 1 | Irma | jangan lupa obat alergi | | i15 | Kamera & tripod | 1 | Yuki | punya Yuki |

Budget Items (group) | id | name | price (Rp) | paidBy | pic | splitMode | keterangan | |—|—|—|—|—|—|—| | b1 | Tenda dome 4 orang | 150.000 | Irma | Yuki | pic | Direct debt — Yuki owes Irma | | b2 | Sewa mobil | 200.000 | Irma | null | pic | Pooled flat (per KK) | | b3 | Kompor portable + gas | 85.000 | Pepi | null | orang | Pooled per headcount | | b4 | Bahan makanan 3 hari | 250.000 | Ria | null | orang | | | b5 | Air minum galon | 30.000 | Pepi | null | orang | | | b6 | Tiket masuk kawasan | 320.000 | Ria | null | orang | | | b7 | Tiket parkir kendaraan | 20.000 | Yuki | null | orang | | | b8 | Retribusi camp ground | 50.000 | Ria | null | orang | | | b9 | Bensin & tol | 100.000 | Yuki | null | orang | |

Budget Items (personal — private, not split) | id | name | price (Rp) | paidBy | owner | |—|—|—|—|—| | bp1 | Jajan & kopi | 45.000 | Irma | Irma | | bp2 | Oleh-oleh keluarga | 120.000 | Irma | Irma | | bp3 | Sewa kamera | 90.000 | Yuki | Yuki |


Trip 2 — Trip Zenk: Malang

Data riil dari CSV pengeluaran grup Zenk, Malang 19–21 Jun 2026.

{
  "id": "t2",
  "name": "Trip Zenk: Malang",
  "location": "Malang, Jawa Timur",
  "date": "2026-06-19",
  "coverUrl": null,
  "mapLink": "https://maps.google.com/?q=Malang+Jawa+Timur",
  "phone": null,
  "status": "selesai",
  "budgetTarget": 9653877,
  "budgetMode": "auto"
}

Participants | id | name | picForLabel | headcount | |—|—|—|—| | p_irma | Irma | Koordinator | 3 | | p_yuki | Yuki | PIC Dokumentasi | 4 | | p_devi | Devi | PIC Konsumsi | 4 | | p_ria | Ria | PIC Tiket & Logistik | 3 |

Checklist Items | id | name | qty | pic | note | checked | |—|—|—|—|—|—| | j1 | Tiket Jatim Park 3 | 14 | Ria | beli online H-3 | ✓ | | j2 | Tiket Museum Angkut | 14 | Ria | | ✓ | | j3 | Tiket Taman Safari Prigen | 14 | Ria | | ✓ | | j4 | Tiket Wisata Kebun Apel | 14 | Ria | | ✓ | | j5 | Villa | 1 | Devi | 3 malam | ✓ | | j6 | Bekal & bahan masak | 1 | Ria | | ✓ | | j7 | Snack & minuman | 1 | Yuki | | ✓ |

Budget Items — Pengeluaran Bersama (flat per KK → splitMode: "pic", pic: null) | id | name | price (Rp) | paidBy | |—|—|—|—| | m1 | Villa | 1.000.000 | Devi | | m2 | Bekal | 288.500 | Ria | | m3 | Snack | 137.500 | Yuki | | m4 | Perkap bento & masak | 97.500 | Yuki | | m5 | Snack klethikan | 91.000 | Yuki | | m6 | Makan sopir | 136.000 | Ria | | m7 | Parkir | 95.000 | Ria | | m8 | Aqua & rokok | 82.000 | Ria | | m9 | Beras | 36.000 | Irma | | m10 | Telur | 50.000 | Devi | | m11 | Snack (Devi) | 30.000 | Devi | | m12 | Parkir soto | 10.000 | Devi | | m13 | Parkir apel | 15.000 | Devi | | m14 | Parkir bebek | 5.000 | Devi | | m15 | Wisata Kebun Apel | 325.000 | Ria |

Budget Items — Tiket HTM (splitMode: "pic", direct debt — semua dibayar Irma)

pic == paidBy = pooled per-PIC (Irma menanggung bagiannya sendiri). pic != paidBy = direct debt (pic owes Irma penuh).

id name price (Rp) paidBy pic
m16a Jatim Park 3 – Devi 673.143 Irma Devi
m16b Jatim Park 3 – Ria 504.857 Irma Ria
m16c Jatim Park 3 – Irma 504.857 Irma Irma
m16d Jatim Park 3 – Yuki 673.143 Irma Yuki
m17a Museum Angkut – Devi 440.000 Irma Devi
m17b Museum Angkut – Ria 330.000 Irma Ria
m17c Museum Angkut – Irma 330.000 Irma Irma
m17d Museum Angkut – Yuki 440.000 Irma Yuki
m18a Safari Prigen – Devi 822.842 Irma Devi
m18b Safari Prigen – Ria 617.132 Irma Ria
m18c Safari Prigen – Irma 617.132 Irma Irma
m18d Safari Prigen – Yuki 766.272 Irma Yuki

Budget Items — Makan (splitMode: "orang", per headcount) | id | name | price (Rp) | paidBy | |—|—|—|—| | m20 | Ayam Rocket | 264.000 | Irma | | m21 | Soto | 272.000 | Ria |

Total group budget Trip 2: Rp 9.653.877 (budgetMode: auto → target = sum aktual)