Skip to content
FACUNDO.DEV
Work

CASE STUDY · Fullstack · Mobile · 2026

Investamind

Investing education that feels like a habit, not a course

Mobile app that teaches investing with short lessons, a community feed and gamification. Expo and Express with biometric-safe sessions and deduped webhooks.

Role
Fullstack · Mobile
Year
2026
Stack
  • Expo 54
  • React Native
  • NativeWind
  • TanStack Query
  • Zustand
  • RevenueCat
  • Express
  • Socket.IO
  • Drizzle ORM
  • Supabase Postgres
  • Zod
  • Pino
Investamind case study cover

The problem

Most people who want to learn about investing end up with a pile of videos and threads and no sense of progress. Finance education also has a trust problem: it needs structure, a place to ask questions without feeling judged, and a reason to come back tomorrow. The product had to be as easy to open as a social app and as organized as a course, in English and in Rioplatense Spanish.

The solution

Investamind is a mobile app built by Capsule Codes for a client. It combines structured lessons, a community feed where members post and discuss, and a gamification layer with XP, streaks, badges and stories. A premium plan unlocks the full catalog. The app is live on the App Store.

The mobile client is Expo 54 with React Native 0.81, NativeWind for styling, TanStack Query for server state and Zustand for local state. The backend is an Express API with Socket.IO for realtime, Drizzle on Supabase Postgres, Zod for validation and Pino for structured logs. Subscriptions go through RevenueCat, and fixes ship over the air with expo-updates.

The screenshots use invented demo data.

Stack and key decisions

  • One biometric prompt per unlock: the refresh token lives in the device keychain, optionally behind Face ID. A naive refresh would ask for the face on every expired request. Session refresh is single-flight, so concurrent 401s collapse into one call, and an in-memory copy of the token, never persisted and cleared when the app locks, means the prompt appears once per unlock
  • Sessions in Postgres: sessions are cookie-based and stored in a table, so they can be revoked and survive deploys. Because the iOS client does not handle cookies like a browser, the session id also travels in the JSON body and the client stores it as its own session cookie
  • Idempotent subscription webhooks: RevenueCat can deliver the same event more than once. Each event id is stored with its source behind a unique index, so a duplicate is detected instead of granting or revoking access twice
  • Translations are checked, not trusted: a script compares the English and Spanish catalogs and also catches duplicate keys, which JSON.parse would silently resolve by keeping the last one
  • Over-the-air updates: copy fixes and small bugs reach users without waiting for store review, while native changes still go through a build

[INFO] Why not just store the token

Biometric protection only helps if the app does not defeat it. Keeping the secret in the keychain and a short-lived copy in memory means a locked app needs the user again, and an unlocked app does not nag them.

What I learned

Security features have a user experience cost, and the work is making that cost invisible. Face ID on every refresh would have been secure and unusable; single-flight plus a memory cache kept both.

Treat every webhook as at-least-once. A unique index on the event id is a few lines and removes a whole class of billing bugs.

Mobile clients are not browsers. Cookie sessions work, but only after you decide explicitly how the client carries them, and writing that down in the API saves a debugging week.

And validate your content like you validate your data. A translation file is a schema too, and a duplicate key is a silent bug that a script finds in milliseconds.