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 with auth + query (role + roomId) — instant privilege on first connect.

  • Production-safe CORS
    Explicit allowlist via CORS_ORIGINS (supports https://*.vercel.app + custom domain). Safari PNA header added for clean preflights.

  • Robust client shims
    A small WS shim queues handlers before the socket attaches, exposes window.__fi.socket, and logs with WS_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 with curl 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

Want the build notes? We’ll publish a deeper “Behind the Build” once the Android hard-lock lands.

— The RUKMAYA Team

Share this post

Share on LinkedInShare on X