2026Open Source

FreedomTalk

Fastify 5 · Socket.io · mediasoup · PostgreSQL · Redis · Next.js 16

Overview

A Discord-style platform you can actually host yourself: voice, video and permissions included.

Chat forces every backend problem at once, which is why it was worth building alone. freedomtalk covers a real-time API, message history, DMs, reactions, attachments, webhooks and audit logs, with email verification and MFA shipped end to end.

freedomtalk poster, chat interface
real-time chat · dms · roles · webhooks · audit logs

How do the permissions work?

The permission system is 34 BigInt bit-flags in a shared package: three-state (allow / neutral / deny), resolved by walking the channel → role → server hierarchy in constant time. The same flags drive REST middleware, WebSocket handlers and the frontend's useCan hook, one source of truth.

Why does voice run on an embedded SFU?

Voice and video run on a mediasoup SFU embedded in the Fastify process rather than a separate media server, a deliberate trade: simpler self-hosting, voice can't scale independently.

Field notes

  • ~39k lines of API TypeScript, ~28k web, ~1,350 lines of voice signaling, 41 Knex migrations.
  • Dual transport (Socket.io for live events, REST/TanStack Query for history) was the source of the project's real security bugs. All three were found by self-review and fixed in commits 2b31e85, 3bef167 and 9ffb434.
  • The frontend was rewritten 2-3 days in: the first approach didn't survive contact with real-time requirements.
  • Honest ledger: RabbitMQ is provisioned but not yet wired into code; voice is unvalidated under load.
freedomtalk voice channel view
webrtc voice via mediasoup sfu
freedomtalk server settings
mfa · email verification · 34-flag permissions

Source

github.com/notdezzi/freedomtalk