Brio // AmartaBack to portfolio

Case study / 03

Kunang

I built Kunang as a side project during Challenge 5 at the Apple Developer Academy. It brings community mental-health intake, prioritization, scheduling and live communication into one iPhone and iPad workflow, while keeping sensitive processing and credentials in the right place.

Brio presenting Kunang on an iPad with a community partner
Community support / iOS
KN_LOCAL / 2026
Context
Side project
Devices
iPhone + iPad
AI
On device
Backend
Serverless
Channel
WhatsApp
My role
Full stack

01 / Learning & outcome

A message became a real product.

My favorite milestone was sending a real message to the WhatsApp number, watching it appear inside Kunang and continuing the conversation from the app. That closed the loop between a native interface, a serverless backend and a communication channel people already use.

Kunang pushed me beyond native iOS development into on-device AI, webhooks, databases, API security and serverless integration, all without losing sight of the community workflow the technology was meant to support.

02 / The problem

One place for a fragmented support flow.

Kunang was designed for a community mental-health team in Bali. The operational challenge was not one isolated screen: it was the handoff from first contact to intake, triage, scheduling, handler assignment and continued conversation.

01 / Intake

Start with the data the team already has

The app can import client records from a spreadsheet instead of forcing the team to rebuild its working data manually. Structured local storage then becomes the foundation for prioritization and scheduling.

02 / Triage

Private intelligence on the device

Using Apple’s Foundation Models framework, Kunang performs structured triage locally, assigns priorities and supports decision-making without sending the entire workflow to a remote AI service.

03 / Scheduling

Turn priority into action

Kunang creates schedules and distributes sessions between available handlers. The goal is to transform intake signals into a practical plan while keeping the team’s workload and client urgency visible.

03 / WhatsApp relay

A secure bridge to real conversations.

The part I most enjoyed was connecting Kunang to the community’s existing WhatsApp channel. I created a serverless relay with Cloudflare Workers and D1 so the mobile app could participate in conversations without carrying the WhatsApp Cloud API token.

01 / Receive

Webhook

Meta forwards incoming messages to the Cloudflare Worker. The relay validates the webhook before accepting and storing the event.

02 / Guide

Bilingual intake

For new contacts, the relay asks about language, location, immediate danger and the type of support they need.

03 / Prioritize

Crisis response

If crisis-related language is detected, the flow immediately provides emergency information and raises the contact’s priority.

04 / Synchronize

Live handoff

Kunang synchronizes with the relay, displays active conversations within seconds and lets a handler reply from the app.

04 / Architecture

Separate the secret from the client.

The mobile app and relay have different responsibilities. This boundary protects credentials and concentrates the integration rules in one server-side layer.

01 / Mobile

SwiftUI, SwiftData & Foundation Models

The native client manages the working interface, local persistence, on-device triage, schedules and the synchronized conversation view across iPhone and iPad.

02 / Relay

Workers, D1 & Cloud API

The serverless layer stores the access token, validates webhooks, prevents duplicate messages, keeps conversation history and manages priority queues.

03 / Platform rule

The 24-hour messaging window

The relay centralizes WhatsApp’s messaging-window rules so the client does not need to reproduce server-side policy logic.

04 / Honest infrastructure

Cloudflare in production

The architecture could be expressed with Lambda, API Gateway and DynamoDB, but the implemented version uses Cloudflare Workers and D1 on the free plan.

Private intelligence. Connected care.

View repository