FocusIN Is Live: Real-Time Rooms for Gatekept Unlocks
Sep 2, 2025
Ship the smallest thing that proves the biggest thing — then harden it.
We just brought FocusIN from idea to live preview: a real-time system where a Gatekeeper approves or denies device unlock requests inside a Room. It’s fast, observable, and now running in the wild.
What we shipped
API on Render + Web on Vercel
NestJS API (Render) + Next.js app (Vercel) with clean separation and predictable envs.Rooms over Socket.IO (namespace
/rooms
)
Presence, joins/leaves, and events flow reliably with graceful reconnects.JWT-backed WS tokens
Client fetches/ws-token
then connects withauth
+query
(role + roomId) — instant privilege on first connect.Production-safe CORS
Explicit allowlist viaCORS_ORIGINS
(supportshttps://*.vercel.app
+ custom domain). Safari PNA header added for clean preflights.Robust client shims
A small WS shim queues handlers before the socket attaches, exposeswindow.__fi.socket
, and logs withWS_DEBUG
.Join URLs that work
API returns owner/gatekeeper URLs pointing to the right host:https://www.focusinapp.com/rooms?code=ABC123
…&role=gk
for Gatekeeper view
End-to-end verification
We validated withcurl
preflights, network inspector traces, and manual flows across localhost, Vercel previews, and prod.
Why this matters
- Real-time UX is brittle without careful CORS, origins discipline, and token lifecycles. We hardened each.
- A tiny, testable surface makes shipping faster — and debugging sane.
What’s next
- Android hard-lock (demo mode teased in the UI)
- Session history & audit trails
- Notifications (email, push)
- Admin & rate limits
- Edge caching for REST and automatic token refresh
- Native apps once flows stabilize
Try it
- Start a room: https://www.focusinapp.com/rooms
- Read the quick guide: https://www.focusinapp.com/docs
Want the build notes? We’ll publish a deeper “Behind the Build” once the Android hard-lock lands.
— The RUKMAYA Team