Side project
Habit Check-in Service
Instead of checking a box alone, people leave a photo or a note for what they did today and share a goal. The main clients are iOS and Android. The web app is the API. Chat is secondary.
Process
- Plan
Leave proof of what you did today, visible to people with the same goal.
- Design
REST for records, a separate realtime path for chat.
- Build
Next.js API, SwiftUI and Compose apps, WebAuthn.
- Ship
API merges deploy automatically; app releases go through internal test builds first.
- Improve
Moved web screens to native and moved chat onto a shared relay.
Overview
A habit app: people leave a photo or a note for what they did today, and others with the same goal can see it. The main clients are iOS and Android. The web app is the API and a download landing. Chat is secondary.
Why I built it
A list of checkboxes fades in a few days. Check-ins, shared runs, and channels belong on one API and schema. Realtime chat, which drops easily, sits apart.
Web screens stopped being the product after the native move. Development used Socket.IO for rooms and reconnects. Production uses an in-house relay for subscriptions, broadcast, and heartbeats, separate from REST.
System
Web: Next.js API routes, Prisma, MySQL, NextAuth v5. This is the REST the apps call.
iOS: SwiftUI. Android: Jetpack Compose. Store apps draw the feed, check-ins, and execution boards.
Realtime relay: a Socket.IO gateway. The app server mints a token. The gateway asks the app server to resolve that token to a user.
Images go to the in-house file server. Push is APNs and FCM. Mail and SMS go through AWS SES and NCloud SENS.
See this in the system diagram
Architecture and data
Tasks, check-ins, and the social graph go through Next.js API routes and Prisma. Only chat connects to the realtime server.
Accounts use sessions and WebAuthn. Tasks have participants, sub-items, and daily check-in photos. Shared runs and channels sit beside that. The feed has follows, likes, and comments. Execution boards are nodes and memos.
Screens and protection
Create and invite tasks, photo and text check-ins, shared runs, execution boards, feed, likes, comments, follows, completions. Chat and alerts come after that.
Passwords are one-way hashes. Recovery tokens are single-use and expiring. Mail and SMS use cooldowns, daily caps, and account and IP limits so sends cannot run back to back.
Stack
Web: Next.js 16, React 19, Prisma 6, MySQL, NextAuth 5, Socket.IO, SimpleWebAuthn.
Apps: SwiftUI, Jetpack Compose, APNs, FCM.
Notes
Hard parts: when the check-in feed and chat share a screen, it is unclear where to absorb duplicate, reordered, or missing realtime messages. Before the gateway asked the app server to resolve tokens, sharing a signing key was a hole. NextAuth v5 session cookies took trial and error.
What held: today’s check-ins live in REST and Prisma, so tasks and relationships survive a chat outage. Native apps ride the same API with no web UI in the loop.