REALTIME / MOBILE
Kage — Cross-Platform Realtime Messaging Platform
A private messaging platform wrapped in an original Elemental Ninja design language. One Flutter codebase targets Android, iPhone, iPad, macOS and Windows, backed by a horizontally-scalable NestJS realtime backend — and architected so end-to-end encryption can be added later without a refactor.
Source code
5 — platforms from one Flutter codebase
The problem
A messaging app is easy to demo and hard to build honestly: realtime delivery has to survive flaky networks, presence has to be right across multiple server instances, and privacy has to be enforced by the data model rather than promised in a README. Doing that across five platforms without maintaining five clients is the actual engineering problem.
The approach
A monorepo where client and server are versioned atomically. The Flutter client uses Riverpod, GoRouter, Freezed and Dio, with clean architecture and feature-first structure mirrored on both sides. The NestJS backend splits REST (join requests, profile, history, admin) from a Socket.IO gateway (messaging, presence, typing, receipts), with Prisma over PostgreSQL and explicit migrations. Privacy is enforced by connections — a mutual accept in the Connection table gates who can message whom. Auth sits behind an AuthVerifier interface with Firebase and dev implementations, so the full flow is testable before the Firebase project is wired in. The backend is stateless: Socket.IO events fan out across instances through the Redis adapter, so any node can serve any socket.
The results
Ten milestones shipped end-to-end: realtime 1:1 and group chat with reply, edit, delete, emoji reactions, typing indicators and delivered/read receipts; image sharing behind a storage abstraction (local dev → Cloudflare R2); message search with paginated history; FCM push that fires only for participants without a live socket; five live-switching elemental themes; and an in-app admin dashboard with an append-only audit log. Five-platform builds, Nginx reverse proxy, Docker Compose, and GitHub Actions CI with lint, unit tests and build green each milestone.
Stack: Flutter, Dart, Riverpod, NestJS, Socket.IO, Prisma, PostgreSQL, Redis, Firebase, Docker