Discord-style Chat App
A Discord-style real-time chat application with servers, channels, direct messages, and a friend system, built with Vue 3 + Go. The backend now supports K3s horizontal scaling and Redis Pub/Sub for cross-pod realtime broadcast.

Project Overview
A Discord-inspired real-time chat application with a Vue 3 frontend and a Go backend. It supports servers (guilds), channels, direct messages, friendship flows, file uploads, and WebSocket messaging. The original version centered on a single-instance in-memory WebSocket hub, then evolved toward a K3s-deployable realtime system: Redis Pub/Sub now propagates room events across pods so multiple chat-app replicas can preserve a consistent realtime experience under horizontal scaling. MongoDB, Redis, Prometheus, pprof, k6, and ArgoCD/GitOps complete the project by moving it beyond feature delivery into production-like deployment and validation.
Technical Challenges & Solutions
Evolving from Single-instance WebSockets to Cross-pod Broadcast
The original realtime layer kept room state in a single process. Once the service runs across multiple pods, messages only reach the instance that owns the connection and cannot be broadcast across pods.
JWT Auth & Security
Implementing a secure, stateless auth system for an SPA while keeping login, refresh, and revocation flows consistent across multiple pods.
K3s Deployment and Horizontal Scaling Validation
Docker Compose can run the app, but it does not validate real multi-replica load balancing, readiness probes, rolling updates, or autoscaling behavior.
File Storage Under Stateless Pods
Chat apps need avatars and server images, but K3s pods are stateless. A local uploads directory can disappear or diverge when pods restart or scale.
Observability and Scaling Validation
After scaling out, it becomes difficult to tell whether bottlenecks come from WebSockets, Redis, MongoDB, or pod resource limits unless the system is observable.
Architecture
Frontend: Vue 3 + TypeScript + Pinia + Element Plus. Backend: Go 1.25 + Gin + gorilla/websocket, organized with a Controller → Service → Repository layering and handwritten dependency injection. The realtime layer uses RoomManager to track rooms and local clients. After persisting messages, MessageHandler publishes events to Redis channels in the form room:<type>:<id>; each pod subscribes when a room is initialized and forwards incoming events only to its own local WebSocket clients, solving cross-instance broadcast after horizontal scaling. Deployment uses K3s, Deployments, HPA, Kustomize, and ArgoCD, while Prometheus, pprof, and k6 are used to observe and validate scaling behavior.
Learnings
This project pushed me beyond building a single-node realtime app toward designing a scalable realtime system. I not only learned Go backend development, JWT flows, and WebSocket lifecycle management, but also had to address the harder problem that appears after scaling out: once WebSocket connections are spread across multiple pods, in-memory broadcast is no longer enough. Implementing Redis Pub/Sub and validating the behavior on K3s with HPA made me understand how realtime data flow, stateless deployments, monitoring, and load testing need to be designed together.