Inspiration

Most gifts are finished the moment you give them: flowers are beautiful for a week, and then they die. But what if I could create something, even a virtual one, that I take care of together with the people I love?

With Stilk I can plant a flower or a tree that represents my marriage, or one in memory of a loved one who has passed away, so everyone who misses them can come by, take care of it, and leave a message.

How I built it

Stilk is a native iOS app: SwiftUI plus a custom Metal renderer for the 3D garden. Plants and islands are procedurally generated from the plant's id, so everyone sharing a plant sees exactly the same one; golden tests pin the generated geometry vertex by vertex, to within $2 \times 10^{-5}$.

A plant's state is never stored; it's derived from its care stats and the clock. Health, for $h$ hours since the last watering.

Since it's a pure function of time, the Home Screen widgets show "needs water" days ahead without the network, using pictures of your actual island rendered off-screen by the same Metal renderer.

RevenueCat handles purchases: one free species, $1.99 per extra plant, and Stilk Plus ($5.99) for unlimited. Its webhook grants purchases on my server, so a plant bought on one phone is ready for everyone it's shared with. Plus push notifications, Sign in with Apple, and 20 languages.

Challenges

Making procedural plants fully deterministic (seeded randomness, float precision, build order), getting physically based lighting and shadows right in Metal, and handling UTC day boundaries for people sharing a plant across time zones, including in widgets while the app isn't running.

Maybe it doesn't count for the Shipaton but the app works in sync with the web version at stilk.app.

What I learned

Golden tests turned "looks about right" into a number I could drive to zero, and RevenueCat let me spend my time on what people actually see, a tiny tree that two people keep alive together, instead of on receipts.

Built With

  • apns
  • app-intents
  • google-sign-in
  • ios
  • keychain
  • metal
  • postgresql
  • push-notifications
  • revenuecat
  • sign-in-with-apple
  • storekit
  • supabase
  • swift
  • swift-package-manager
  • swift-testing
  • swiftui
  • universal-links
  • vercel
  • widgetkit
  • xcode
  • xctest
Share this project:

Updates

Submission history