Skip to content
Protocols
BACKENDIN DEVELOPMENT

HABIBIBYE — Trust Foundation

Invitation-only trust network for the WANA diaspora

HABIBIBYE is community infrastructure, not a social network. It sits beside WhatsApp and Telegram rather than replacing them, and answers one question they cannot: can I trust this person? Every member is invited by someone already inside, and every member's standing rests on Amana — the Arabic word for a sacred trust — given by other members who are willing to stand behind them.

There is no open sign-up. A member joins through a personal invitation link, which expires after seven days, or through a partner's referral link, which a cookie remembers for 30 days. Invited members can arrive already vouched for, if the inviter ticks "Also give Amana" beneath an accountability warning; everyone else arrives Restricted and asks a Full Member for Amana. A request is silent, only one can be open at a time, and it is answered with Khalas Yallah (give it) or Habibi Bye (decline it — the requester is never told). Amana can be revoked at any time. A member left with none has 30 days to earn it back before full restriction, and only full restriction starts a 30-day grace period for the people they invited.

Around that core the platform is built to make the network visible and useful. The Diaspora Map shows where members of each origin live, country by country, and switches to a pan-and-zoom tree of every member's place in the chain. A profile shows how you are connected to someone — YOU → @user → @user → them — by the shortest path through that tree, without ever listing who vouched for whom. Members are placed automatically into geographic circles such as "Algerians in Paris" or "All Moroccans abroad", each with Dardasha: threaded conversation with replies, likes and Decision polls of two to five options.

Two boards put the trust graph to work. Safara matches people travelling between cities with people who need something carried; Baraka is a barter and gift board for goods, skills and services. Both rank posts by how few trust hops separate you from the author, and both keep contact details hidden until the author accepts a request — then both sides see each other's, and nobody else does. Members also run their own public or private channels, leave short notes on each other's profiles, and come back to a growth recap that shows how their chain, circles and Amana have changed since their last visit.

Problem

Diaspora communities from West Asia and North Africa live on group chats. They are good for talking and bad for trust: anyone added to a group looks the same as everyone else, a stranger offering to carry a parcel from Paris to Algiers has no history, and nothing records who brought whom in. The brief asked for a trust layer under those conversations — identity that is earned from other members and can be withdrawn by them — while collecting as little personal data as possible and showing no public follower counts, vouch counts or impact numbers that would turn trust into a popularity contest.

Architecture

Next.js 16 on the App Router with React 19, TypeScript and Tailwind CSS 4, backed by Supabase: Postgres, Auth and Storage. The schema grows through 23 ordered SQL migrations — users, invitations, amana and amana_requests, partner referrals and clicks, circles and memberships, Dardasha posts, options, votes, likes and reports, notifications, Safara and Baraka posts with their connect requests, profile messages, channels with join requests and invites, read cursors for unread badges, and an append-only admin audit log. Row-level security is enabled on every table; the browser holds only the anon key, and server routes use the service role for writes that cross users.

The trust tree is precomputed. Each member's tree parent is the earliest active Amana giver whose link would not close a loop — mutual vouches fall back to the next-earliest giver — and is stored in a user_tree_parents table that mirrors the TypeScript implementation exactly. Feeds, profiles and the map then read one parent row per member instead of scanning every Amana. Connection paths come from the lowest common ancestor of two members on that tree, and Safara and Baraka rank posts by the same hop distance, up to five hops.

The whole app also runs on an in-memory demo store, with the same data layer behind a single switch, so every screen can be developed and demonstrated without a database. Logic that must agree in both modes — chain notifications, growth recap diffs, tree parents — lives in shared pure modules so the two cannot drift. 59 API routes sit behind 28 pages, built for Netlify with Sentry for error monitoring and Resend for transactional email.

Development

Built screen by screen from the brief's wireframes: landing and invitation check, registration by invitation and by partner link, the Welcome Wall, the Diaspora Map with its chain tree, My Amana with its private inbox, profiles, and the Invite Habibi modal, which takes several invitees in one submission. Then the next wave: auto-assigned circles in five kinds (origin city, origin country, worldwide, mixed city and mixed country), Dardasha with replies nested to three levels before "Continue thread", search across circles and @usernames with a 250 ms debounce, notifications for replies, mentions, Amana, new invitees, newcomers, chain milestones and six-degrees discoveries, a moderation queue, partner analytics and the growth recap.

The chain tree stays interactive at the brief's target of 10,000 members: above 250 nodes it draws only what is inside the viewport, plus the hovered node and your own. The growth recap is computed on the server when the app opens and scales with time away — skipped on the same day, about three seconds after a short absence, up to a full welcome-back after three months — and falls back to plain text under reduced motion. Long feeds are virtualised and paginated, with optimistic updates on likes and votes.

Cultural language is part of the specification, not decoration. Amana, Familia, Dardasha, Safara, Baraka, Khalas Yallah and Habibi Bye are the primary labels, each with a tooltip; circles are named by origin ("Algerians in Paris", never a collective "Arabs"); origin flags lead every profile and tree node; and the interface ships in light and dark themes with Arabic-capable typography and right-to-left-ready layout. Each feature has a scripted check — Safara, Dardasha, circles, notifications, settings, cultural copy and security — beside a 570-line manual test matrix.

Security

Email is the only personal identifier collected, and it is never shown — the profile query leaves it out entirely. There are no phone numbers, documents or KYC. Who vouched for a member is visible only to that member, member-since shows the year alone, and there is no online status or last-seen. Each member chooses whether their contact links are visible to everyone, to vouched members only, or to nobody.

Sign-up is defended in layers: a honeypot field, Cloudflare Turnstile on registration, invitations and password reset, per-IP rate limits on registration, invitations and every Amana action, and a device fingerprint hashed with SHA-256 in the browser so repeat accounts from one device land in a review view. Registration is geo-blocked for sanctioned regions both by the country fields and by the hosting edge's IP country header, and screened against blocked email domains, with every refusal reported to Sentry.

Moderation is deliberately light: three distinct reporters move a post into the admin queue, and no public state shows it. Administrators can restrict a member independently of their Amana, soft-delete an account — revoking its Amana and removing its sign-in — and every such action is written to an append-only audit log that only the service role can read. Members can delete their own account from Settings.

Challenges

Trust has edge cases a follow button does not. A revoked Amana must change one member's status without punishing everyone they invited, unless they lose all of it and then fail to recover in 30 days — so restriction is two-stage, and the cascade to invitees starts only at the second stage. Mutual vouching would loop the family tree, so the tree parent skips any giver who would close a cycle. Declines must be truly silent, so a declined request leaves no trace the requester can see. And the same rules had to hold in the demo store and in Postgres, which is why they live in shared modules with scripts that check both.

Results

The Stage 1 launch scope and the first wave after it are built end to end: both registration paths, the Amana system with retraction, revocation and the grace cascade, the map and chain tree, circles, Dardasha, search, notifications, the growth recap, moderation, partner tracking, Safara, Baraka, channels and profile messages — running against local Supabase and ready for hosted deployment. Still ahead are hosted production, the React Native iOS and Android apps, and the PWA.

Outcome

Commits
126
Screens
28
API routes
59
Database migrations
23