December 14th, 2025
The Day We Designed the Commitment Flow Today was about architecture decisions. We figured out how auth flows through the app, debated Convex vs Local storage, learned why scheduled jobs beat cron polling, and set up Zustand for state management.Understanding the Auth Flow
Q: How does authentication flow through our app?The Commitment Storage Problem
Q: What were we trying to build? User flow:- User creates a commitment
- Adds time, location, commitment name, and other details
- Saves it
- Data goes to Convex backend
- Also needs to be in local DB
The Two Types of Commitments
Q: What scenarios do we need to handle?Scenario 1: Time-based Commitment
- User says: “Every day from 5 PM to 6 PM I’ll be in the gym”
- Storing in Convex makes sense
- At 5 PM, Convex checks what’s happening
Scenario 2: Commitment + App Blocking
- Same commitment as above
- BUT app XYZ also needs to be blocked during that time
- This requires local storage for offline blocking
Cron Jobs vs Scheduled Jobs
Q: Aren’t cron jobs expensive since they run 24/7 with heartbeat pings? This was a big misconception we cleared up. The Wrong Way (Polling):- You know
due_at = 6 PM - You know
grace = 5 mins - 👉 Schedule a job for 6:05 PM
- That job runs ONCE
- Checks status
- Applies penalty if needed
How Does Scheduled Jobs Know When It’s Time?
Q: If you say at 6 PM we need to check this, how will the code know when it’s 6 PM? A: The system internal clock! Instead of multiple cron jobs, we have one standard main scheduler that triggers jobs at their scheduled times.Redis + BullMQ vs Convex
Q: In Redis + BullMQ, the worker kept polling the queue to check if time arrived. Is that a drawback? A: Yes, that’s the polling pattern we want to avoid. Realization: For our use case, Convex’s scheduled functions are better than Redis + BullMQ polling. Mistakes happen. Learning happens.Local Storage Options
Q: For local things like app blocking state, what do we use? Options for React Native:- AsyncStorage (simple key-value)
- MMKV (fast key-value)
- WatermelonDB (full local DB)
- SQLite (relational)
State Management Options
Q: What options do we have for state management in React Native?- Redux
- Zustand
- Jotai
- MobX
- React Context
- We already know Redux and Zustand
- Starting with new state management means setup + learning curve
- For MVP level, spending time on this isn’t the best use of time
- Zustand is simpler than Redux anyway
What State Do We Need?
Q: What state do we need even at MVP level? For derived + UI-level auth state:The Zustand Store Pattern
Q: Can we put this in Zustand, fill it centrally, and pull from there? A: Yes! This keeps the main code clean — we don’t mix API call responsibilities with state management. The pattern:- Create store at:
apps/native/stores/useCommitStore.ts - Use it in the Commits screen
- Clean separation of concerns
Key Decisions Made Today
- Convex for server-side commitment storage — time-based checks, verification
- Local DB for offline functionality — app blocking when internet is off
- Scheduled jobs over cron polling — one-time execution at scheduled time
- Zustand for state management — simple, familiar, clean separation
Summary
Today was architecture day. We mapped out:- How auth flows through the entire stack
- Why we need both Convex AND local storage
- Why scheduled jobs are better than polling crons
- How to structure state management with Zustand
Proof of Work


