SASuraj Kiran Airi
  • About
  • Projects
  • Certificates

© 2026 Suraj Kiran Airi. Built with Next.js and Tailwind.

  • Email
  • Resume
  • LinkedIn
  • GitHub
All projects
Full stack, Frontend, BackendOct 2026 - PresentWeb app, API

Talk Space - Walk-Around Voice Rooms

Browser voice rooms: walk a pixel-art map and hear people by distance, peer-to-peer over WebRTC.

Live DemoGitHub
Landing page with a live, walkable room

Landing page with a live, walkable room

The problem

Voice rooms and video calls make everyone talk over everyone: one shared channel, no sense of space, and no natural way to drift in and out of conversations the way you would at a real party. Peer-to-peer voice also normally means anyone can be heard by anyone, and the server ends up either relaying all the audio or knowing nothing about who is behaving badly.

The result

Built and deployed a full-stack social audio app where each room is a small pixel-art world: you walk an avatar around, hear people by distance, and get private conversation zones, with voice and chat travelling directly between browsers while the server only handles signaling, accounts, and moderation.

How it works

Talk Space is a pnpm + Turborepo monorepo with a React 19/Vite web app and an Express 5 + Socket.IO API. Every room is a tile map rendered by a custom 2D canvas engine; voice, chat and avatar positions flow peer-to-peer over WebRTC, so the server never carries audio. It only authenticates sockets, tracks who is in which room, and relays the connection handshake. The deployed system runs the web app on Netlify, the API on Render, live room state on Upstash Redis and accounts/reports on Neon PostgreSQL.

Key technical achievements include:

  • Proximity audio model: a pure, symmetric hearingGain function gives full volume within 2 tiles, quadratic falloff out to 7 tiles, and silence beyond; people in the same audio zone hear each other at full volume while a zone is isolated from everything outside it. Because the function is symmetric, both sides of a conversation always agree on whether they can hear each other.
  • Cross-browser audio mixing: each remote voice is routed through its own Web Audio GainNode (iOS Safari treats <audio>.volume as read-only), smoothed over ~60 ms so walking past someone fades instead of clicking, with a muted media-element workaround for Chromium's WebRTC-to-WebAudio quirk. Voice is also not sent at all to peers who are out of earshot.
  • Hand-built P2P networking layer: a NetworkManager/PeerLink pair implements WebRTC's 'perfect negotiation' pattern (a deterministic polite/impolite side resolves two people joining at the same instant), buffers early signals, redials failed links with exponential backoff, and keeps a reliable data channel for chat plus an unreliable one for positions. Linking policy sits behind a single shouldLink function, so the full mesh (8 people per room) can later be swapped for a sparser topology.
  • Treating peers as untrusted: every peer message passes per-peer token-bucket rate limits before it is parsed and schema-validated after, and a peer that floods is reported to the client for muting.
  • Redis-only live rooms with atomic Lua scripts: join, leave and kick are Lua scripts so capacity checks and bans cannot race between concurrent connections; a Socket.IO Redis adapter lets several API instances serve one room; a dropped connection keeps its seat for a short grace period; empty rooms expire on their own.
  • Private rooms and abuse protection: private rooms need a 6-letter room ID plus an 8-digit join code, compared in constant time, with per-user and per-room limits on wrong guesses and a Redis fixed-window rate limiter on the REST endpoints.
  • Auth and moderation: email/password accounts (bcrypt with a dummy-hash comparison so unknown emails take as long as wrong passwords), short-lived JWTs refreshed in the background, a tokenVersion counter to revoke every token at once, and better-auth used only for the Google OAuth handshake. Users can block, report or (as host) remove people; reports land in an admin queue with dismiss, strike, suspend and ban actions, and a ban disconnects the user's live sockets across all instances.
  • Connectivity and privacy: STUN by default, optional TURN with short-lived HMAC credentials (coturn REST scheme) and a relay-only mode that hides participants' IP addresses from each other.
  • Map tooling: maps are plain JSON files (6 ship in the repo), checked by a validator that catches unreachable zones and overlaps, and editable through a dev-only visual editor with play-test or a CLI; the room picker discovers new maps automatically.
  • Testing: API integration tests run against real PostgreSQL and Redis, and the web app has unit tests for the network layer, peer links, audio and forms.

Tech stack

  • TypeScript
  • React 19
  • Vite
  • React Router
  • Zustand
  • Node.js
  • Express 5
  • Socket.IO
  • WebRTC
  • Drizzle ORM
  • PostgreSQL (Neon)
  • Redis (Upstash)
  • ioredis
  • Zod
  • better-auth
  • Helmet
  • Turborepo
  • pnpm
  • Docker Compose
  • Render
  • Netlify

Tags

  • Proximity Audio
  • WebRTC
  • Peer-to-Peer Mesh
  • Perfect Negotiation
  • Signaling Server
  • Web Audio API
  • Custom Canvas Game Engine
  • Spatial Hearing Model
  • Socket.IO Redis Adapter
  • Redis Lua Scripts
  • Token-Bucket Rate Limiting
  • TURN Credentials
  • JWT Auth
  • Google OAuth
  • Moderation Queue
  • Map Editor & Validator
  • Monorepo