A full-stack, Discord-like real-time chat platform featuring a microservices backend in Go and a modern React frontend. Built with scalability, reliability, and developer experience in mind.
RTCP is a comprehensive real-time communication platform that enables users to:
- Create and manage servers (guilds) with text channels
- Send real-time messages with WebSocket delivery
- Have direct conversations with other users
- See online/offline presence status
- Moderate content with role-based permissions
┌─────────────────────────────────────────────────────────────────────────────────┐
│ RTCP Architecture │
├─────────────────────────────────────────────────────────────────────────────────┤
│ │
│ ┌──────────────────┐ ┌───────────────────────────────────────────────┐ │
│ │ │ │ Backend Services │ │
│ │ Frontend │◄───────►│ ┌─────────────────────────────────────────┐ │ │
│ │ (React/TS) │ HTTP │ │ API Gateway │ │ │
│ │ │ /WS │ │ (Auth, Rate Limiting, Routing) │ │ │
│ │ • Modern UI │ │ └─────────────────┬───────────────────────┘ │ │
│ │ • Real-time │ │ │ │ │
│ │ • Mock Support │ │ ┌─────────────────┼────────────────┐ │ │
│ │ │ │ │ │ │ │ │
│ └──────────────────┘ │ ▼ ▼ ▼ │ │
│ │ ┌────────┐ ┌────────────┐ ┌──────────────┐ │ │
│ │ │Identity│ │ Guild │ │ Message │ │ │
│ │ │Service │ │ Service │ │ Service │ │ │
│ │ └───┬────┘ └─────┬──────┘ └──────┬───────┘ │ │
│ │ │ │ │ │ │
│ │ └────────────┼───────────────┘ │ │
│ │ ▼ │ │
│ │ ┌───────────────────────────────────────┐ │ │
│ │ │ Event Bus (RabbitMQ) │ │ │
│ │ └───────────────────┬───────────────────┘ │ │
│ │ │ │ │
│ │ ▼ │ │
│ │ ┌───────────────────────────────────────┐ │ │
│ │ │ Delivery Service (WebSocket Hub) │ │ │
│ │ └───────────────────────────────────────┘ │ │
│ └───────────────────────────────────────────────┘ │
│ │
│ ┌───────────────────────────────────────────────────────────────────────────┐ │
│ │ Infrastructure │ │
│ │ ┌──────────┐ ┌──────────┐ ┌───────────┐ ┌──────────┐ ┌────────────┐ │ │
│ │ │PostgreSQL│ │ Redis │ │ RabbitMQ │ │Prometheus│ │ Grafana │ │ │
│ │ │ (Data) │ │ (Cache) │ │ (Events) │ │(Metrics) │ │(Dashboard) │ │ │
│ │ └──────────┘ └──────────┘ └───────────┘ └──────────┘ └────────────┘ │ │
│ └───────────────────────────────────────────────────────────────────────────┘ │
└─────────────────────────────────────────────────────────────────────────────────┘
Playground/
├── rtcp-backend/ # Go microservices backend
│ ├── cmd/ # Service entry points
│ ├── internal/ # Shared packages
│ ├── services/ # Business logic
│ ├── deployments/ # Docker, Kubernetes
│ └── docs/ # Architecture docs
│
├── rtcp-frontend/ # React/TypeScript web frontend
│ ├── src/
│ │ ├── api/ # API client & services
│ │ ├── components/ # React components
│ │ ├── hooks/ # Custom hooks
│ │ ├── pages/ # Page components
│ │ └── store/ # Zustand stores
│ └── ...
│
├── rtcp-mobile/ # React Native/Expo mobile app
│ ├── app/ # Expo Router screens
│ ├── src/ # Source code
│ │ ├── api/ # API client
│ │ ├── components/ # UI components
│ │ └── store/ # Zustand stores
│ └── ...
│
├── rtcp-tester app/ # Visual testing tool
│ └── index.html # Single-page tester
│
└── README.md # This file
- Docker & Docker Compose
- Node.js 18+ (for frontend development)
- Go 1.23+ (for backend development)
cd rtcp-backend/deployments/docker
# Windows
./start.ps1
# Linux/Mac
./start.shThis starts all services:
- PostgreSQL - Database
- Redis - Caching & rate limiting
- RabbitMQ - Event messaging
- All microservices - Identity, Guild, Message, etc.
- Prometheus & Grafana - Monitoring
- Jaeger - Distributed tracing
cd rtcp-frontend
# Install dependencies
npm install
# Start development server
npm run dev| Service | URL | Credentials |
|---|---|---|
| Frontend | http://localhost:5173 | (Register or use mock mode) |
| API Gateway | http://localhost:8080 | - |
| RabbitMQ | http://localhost:15672 | guest / guest |
| Grafana | http://localhost:3001 | admin / admin |
| Prometheus | http://localhost:9090 | - |
| Jaeger | http://localhost:16686 | - |
| Feature | Description |
|---|---|
| Microservices | 8 independent services with clear boundaries |
| Event-Driven | RabbitMQ with transactional outbox pattern |
| Distributed Caching | Redis for caching and rate limiting |
| Distributed Locking | Redlock for consistency |
| Dead Letter Queue | Failed event handling with admin API |
| Saga Pattern | Distributed transaction management |
| Observability | Prometheus, Grafana, Jaeger integration |
| Testing | Unit tests with 80%+ coverage |
| Feature | Description |
|---|---|
| Mock-First | Works without backend (for development) |
| Real-Time | WebSocket for live updates |
| Type-Safe | Full TypeScript support |
| Modern UI | TailwindCSS with dark theme |
| State Management | Zustand for predictable state |
| Developer Tools | Built-in endpoint health monitor |
cd rtcp-backend
# Run tests
go test ./...
# Run specific service
go run ./cmd/gateway
# Build all
go build ./...cd rtcp-frontend
# Development mode (with mocks)
npm run dev
# Connect to real backend
# Edit .env.development:
VITE_USE_MOCK_DATA=false
VITE_MOCK_WEBSOCKET=falsecd rtcp-backend
# Unit tests
go test ./internal/... -v
# Integration tests (requires Docker)
go test ./tests/integration/... -v
# With coverage
go test ./internal/... -covercd rtcp-frontend
# (Tests can be run when configured)
npm testPre-configured dashboard showing:
- Request rate by service
- P95 latency
- Error rates
- HTTP status distribution
Available at /metrics on each service:
http_requests_totalhttp_request_duration_secondshttp_requests_in_flight
Distributed tracing across all services:
- Request flow visualization
- Latency breakdown
- Error tracking
- JWT authentication with HTTP-only cookies
- bcrypt password hashing (cost 12)
- Rate limiting (sliding window algorithm)
- Input validation on all endpoints
- CORS configuration
| Document | Location |
|---|---|
| Backend README | rtcp-backend/README.md |
| Frontend README | rtcp-frontend/README.md |
| Mobile README | rtcp-mobile/README.md |
| Tester Tool | rtcp-tester app/README.md |
| System Design | rtcp-backend/docs/SYSTEM_DESIGN.md |
| Implementation Plan | rtcp-backend/docs/IMPLEMENTATION_PLAN.md |
| Architecture Diagrams | rtcp-backend/docs/Diagrams and Blueprints/ |
- Voice channels (WebRTC)
- File uploads
- Message search (Elasticsearch)
- Push notifications
- Mobile apps (React Native)
- Kubernetes deployment configs
This project is for educational and demonstration purposes.
[Backend](rtcp-backend/) · [Frontend](rtcp-frontend/) · [Mobile](rtcp-mobile/) · [Documentation](rtcp-backend/docs/)