CCasey White
← All work
Cosmic Tea logoBeta

Cosmic Tea

Your group chat with the stars.

Honest AI astrology that actually knows your birth chart. Six guides who read your compatibility, decode the texts, and never sugarcoat it.

Category
AI companion
Timeline
3.5 months · 7 sprints · 780+ commits
Focus
Consumer AI
Visit Cosmic Tea ↗
Cosmic Tea preview
01

Why I built it

I wanted astrology that actually knows you, not the vague horoscope-app fluff. AI guides that read your real birth chart and give you honest relationship advice. It is aimed at the crowd who screenshot their texts and ask what does this mean, so I gave them six distinct guide personalities to talk it out with. The whole thing runs as a real freemium business across web, iOS and Android.

02

What it does for people

  • Six AI astrology guides, each with their own voice, that actually know your real birth chart
  • Honest compatibility reads using Western and Chinese astrology, plus a synastry biwheel between you and anyone in your roster
  • Daily Cosmic Weather, tarot pulls, and decode-the-texts relationship help
  • A roster that saves every relationship with a compatibility score and chat history that remembers past conversations
  • QR scan-to-connect so you can add a friend's cosmic code instantly, with reciprocity detection
03

Under the hood

  • Claude Haiku 4.5 with a hand-tuned 4,850-token cached prompt prefix. Haiku silently drops cache markers under 4,096 tokens, so I locked a shared core above that floor to hold a 90% gross-margin target
  • A four-block system prompt: shared core and per-guide voice are both cached, while the per-relationship dossier and cross-chat memory stay uncached, so I never burn cache-write dollars on content that changes every message
  • Embedding-based cross-chat memory. Each relationship builds up remembered facts via vector retrieval, so a guide can call back to something you told it weeks ago
  • Real ephemeris astrology from astronomy-engine: actual planetary longitudes, Ascendant and MC, whole-sign houses and aspect orbs, not canned horoscope text
  • Server-side tier enforcement that the client can never spoof. Every request re-derives your tier, with monthly counters guarded by SECURITY DEFINER Postgres functions
04

The cool bits

  • One Next.js codebase ships to web, iOS and Android via Capacitor, with native push, haptics, and Apple and Google sign-in bridges
  • A hidden reviewer bypass gated on a single env var. The endpoint 404s when the secret is empty, so its existence is hidden, not just denied
  • Shipped in five locales (en, ko, es, pt-BR, ja) with per-guide localized intros
  • A founder dashboard running PostHog funnels, D1/D7/D30 retention, per-model cost attribution, and a daily Claude Sonnet business brief
05

How long it took

About 3.5 months of focused build.

3.5 months · 7 sprints · 780+ commits

06

What I worked through

The hardest part was making the unit economics work before launch. I reverse-engineered Haiku's 4,096-token cache floor and restructured the entire prompt so caching actually kicked in, then built server-side rate limiting and tier verification. Getting real astrology right was the other big one: locking down the ephemeris math with tests so the signs never drift, and computing genuine synastry instead of faking it. On top of that, shipping one codebase to web and both app stores with Capacitor, RevenueCat, push, and five languages meant a lot of moving parts had to line up.

07

The full stack

Next.js 16 (App Router)React 19TypeScriptTailwind CSS v4Claude Haiku 4.5 (prompt caching)Claude Sonnet (founder briefs)Supabase (Postgres, Auth, RLS)RevenueCat (mobile IAP)Capacitor (iOS + Android)next-intl (5 locales)astronomy-engine (ephemeris)PostHog (HogQL funnels)SentryFirebase Admin + APNs + web-pushZodVitestPlaywrightVercel