↓ Skip to main content
  1. Posts/

Tribe

Table of Contents

A family chat app with its own server at home, connected over iroh, and the project I'm learning Rust with.

Tribe icon
In development iOS 27+ app • hub on macOS 27+ • not released

Tribe is built for one family and will be shared over TestFlight, not the App Store. The Rust hub and a command-line client work today: members join with an invite link, the hub tracks who's connected, and the owner manages it all through a local admin API. The iPhone app comes next.

Tribe is a chat app for my family. Everyone who joins can message everyone else, in direct messages and in one shared Everyone room. A small server, the hub, runs on a Mac at home: it routes and queues messages and wakes phones with push notifications. It also hosts personas, AI contacts such as “Claude”, “Coder” or “Cook”, each with its own chat. Messages between people are end-to-end encrypted, so the hub delivers them without being able to read them.

Highlights at a Glance
#

DMs and an Everyone Room

Every member can message every other member directly, and the whole family shares one room. Joining puts you in it; there’s nothing to create or manage.

Join with One Tap

The owner sends an invite link over iMessage. Tapping it opens Tribe on an invitation screen, and one tap on Join does the rest. No accounts, phone numbers or passwords.

End-to-End Encrypted

Every message is sealed to its recipient with HPKE before it leaves the phone. The hub routes sealed envelopes and can’t read or forge them.

Push That Decrypts on the Phone

When the app is closed, the hub sends a push with the sealed message inside. A notification extension opens it on the phone, so the lock screen shows “Mom: dinner at 7” while Apple only ever sees ciphertext.

AI Personas

Bot contacts live on the hub, each defined by a short config file and a system prompt. Each has its own chat, streams its replies as they’re written, and is available to every member.

A Home Server, No Port Forwarding

Phones reach the hub by its key from anywhere, on Wi-Fi or cellular, through iroh’s hole punching and relays. No public IP, domain or TLS certificate needed.

Why Tribe?
#

No real reason, honestly. Everybody in my family is in the Apple ecosystem and iMessage is fine. Not really scriptable and extensible, but fine. I don’t have major privacy needs or concerns. And to be frank, it will be hard to convince my family to even install this new chat app, let alone use it. But then again, I always wanted a “lightweight family Slack” that also supports bots and scripts but preserves privacy.

Tribe is my attempt at that:

  • A chat that’s ours: one small server at home that we control, with nothing in anyone else’s cloud but encrypted push notifications.
  • AI that’s part of the family chat: a coding helper, a recipe assistant, or a grocery-list helper that sits in the contact list next to my wife, with a system prompt I write, instead of yet another app.
  • No setup for the family: install the app, tap a link, done.

And last but not least, I wanted a real project as a vehicle to learn Rust. The hub is written in Rust, one exercise at a time, with Claude as my mentor and reviewer.


How It Works
#

1. The Hub
#

The hub is a Rust program that runs all the time on a Mac at home. It has an identity (a key) instead of an address, and every phone keeps one connection to it while the app is open. Since iOS suspends apps shortly after they leave the screen, two phones are rarely online at the same moment, so every message goes through the hub: delivered at once if the recipient is connected, otherwise queued, with a push notification.

2. Joining
#

The owner runs tribe-hub invite --label Mom and sends the link it prints. The link’s secret is in the #fragment, which browsers and iMessage previews never send to a server, so it only ever exists in the message, on the phone, and at the hub. It works once and expires after a week.

3. Messages
#

Each message is sealed to its recipient’s key and sent to the hub, which stores it until the recipient’s phone confirms it has it. A message to the Everyone room is sealed once per member. Delivery shows the usual ✓ (the hub has it) and ✓✓ (it arrived).

4. Personas
#

Messages to a persona stop at the hub, which sends the conversation to the Claude API and streams the reply back into the chat. Each persona is a folder with a persona.toml and a system.md, so adding one is editing two small files.


Privacy
#

The hub delivers messages; it doesn’t read them. Messages between people are encrypted on the sender’s phone and only opened on the recipient’s.
  • What the hub sees: who messages whom, when, and how large each message is. It needs that much to route and queue.
  • What it can’t see: the content of messages between people, and it can’t forge them.
  • Personas are the exception: the hub is every persona, so it reads what members send to them and sends it to the Claude API to answer. The admin interface deliberately has no way to show those conversations.
  • Keys are pinned: each phone remembers every member’s key the first time it sees it and warns if it ever changes, so a compromised hub can’t quietly swap in a key of its own.
  • Admin stays private: the hub’s admin API listens only on the Mac itself; remote admin goes through Tailscale.

Technology Stack
#

  • Hub & CLI: Rust, tokio, iroh, axum (admin API), SQLite via rusqlite
  • iPhone App: Swift and SwiftUI, iroh through its Swift bindings, CryptoKit for HPKE
  • Notifications: APNs, with a Notification Service Extension that decrypts on the device
  • Personas: the Claude Messages API, streamed
  • Targets: iOS 27+, hub on macOS 27+ (Apple Silicon)

Following Along
#

I write about learning Rust on this project in the Crab Walks series.