Federation
A self-hosted, Discord-style communication platform built as microservices: text, voice, file sharing and moderation, running on my own Kubernetes cluster.
Inspired by decentralized protocols like Matrix, Federation looks at how independent servers can communicate without a central authority. Every user has a federated ID (user@server) that lives on their own home server.
What I built
What started as a small CLI texting app grew into a full platform:
- 7 .NET microservices (users, messages, rooms, voice, files, moderation, services) behind an Ocelot API gateway
- Event-driven communication with RabbitMQ, real-time updates with SignalR, voice chat with LiveKit
- An Electron desktop client (React + TypeScript) with themes, sound packs, per-channel notification rules, auto-updates and a signed installer
- Moderation: reports, redactions, and global or room-scoped blocks for users and entire nodes
Infrastructure & quality
Everything runs on a self-hosted k3s Kubernetes cluster with separate staging and production environments. Each deploy runs automated pipelines:
- Security: SAST in CI, DAST with OWASP ZAP against every service, and Trivy container scanning that fails the build on critical findings
- Performance: k6 smoke, load and stress tests against defined non-functional requirements (p95 latency, error rates)
- Observability: Prometheus + Grafana dashboards, distributed tracing with OpenTelemetry + Jaeger, and centralised logging in Seq
I used that monitoring data to find real bottlenecks (N+1 queries, unnecessary awaited bus publishes), then validated fixes like Redis caching and horizontal pod autoscaling in controlled before/after experiments.
What's next
The platform is still running for me and my friends. Next up: federation between multiple nodes (trust and networking across instances) and moving beyond a single-node cluster.
Gallery
13 images# Client UI
Login screen: "Your homeserver, your rules" A room with text and voice channels and the member list Profile editor: avatar, banner, background and gradient name colours Built-in themes and fully custom colour schemes Auto-updater with a security-hardening changelog Room admin: channels, federation join requests, redactions and blocks
# Architecture
Container diagram: seven services behind the Ocelot gateway, with RabbitMQ, LiveKit and Kubernetes Event-driven room join across services via RabbitMQ
# Operations
Grafana: CPU and memory usage per service A single request traced across services in Jaeger All services running in the k3s cluster
# Quality & security
k6 performance results checked against the non-functional requirements Trivy container image scan in the security pipeline