A random video chat application (like Omegle) built using microservices architecture.
This project was made as a Final Assignment for my undergraduate course "Microservice Architecture and Programming" at university.
Deployed on Fly.io: StrangerSync
So basically its a peer-to-peer video chat app where you can connect with random strangers. The whole point was to learn microservices so I broke down this app into multiple services that talk to each other.
Here's how everything connects together:
Browser
│
▼
Fly.io Proxy (HTTPS/WSS)
│
├── /ws ──────────────────▶ signaling-service (WebSocket + Matching)
└── /* ──────────────────▶ core-service (Static files + User API)
│
┌──────▼──────┐
│ PostgreSQL │
│ (Fly.io) │
└─────────────┘
Ended up with 2 main services after merging some stuff together:
The most important one. Handles all WebSocket connections, WebRTC signaling (offer/answer/ICE candidates) AND the matching queue. When someone clicks find match it puts them in a queue and pairs them with the next person who also clicks it. All in memory with a single machine so the queue stays consistent.
Serves the frontend (HTML/CSS/JS) and handles user session tracking in the database. Also has a /config.js endpoint that tells the frontend where the signaling service is so the WebSocket connects to the right place.
- FastAPI - Python web framework for both services
- PostgreSQL - Database for session and match logs
- WebSockets - Real-time communication
- WebRTC - Peer to peer video/audio
- Fly.io - Deployment (2 machines, fits in free tier)
These are the patterns I learned in class and implemented here:
- Service Decomposition - split by business capability (real-time vs HTTP)
- Shared Database - both services share same postgres db (easier for learning)
- API Gateway Pattern - core service acts as the HTTP entry point
- Config as a Service -
/config.jsendpoint for dynamic frontend config
StrangerSync/
├── services/
│ ├── shared/ # Shared DB models between services
│ │ ├── database.py # DB models & connection
│ │ └── utils.py # Helper functions
│ ├── signaling-service/ # WebSocket + WebRTC + Matching
│ └── core-service/ # Static files + User session API
├── static/ # Frontend (HTML, CSS, JS)
├── fly-signaling.toml # Fly.io config for signaling
├── fly-core.toml # Fly.io config for core
└── README.md
- User opens the app → core service serves the HTML
- Browser loads
/config.js→ gets the signaling service WebSocket URL - Browser connects WebSocket to signaling service
- User clicks "Find Match" → signaling service puts them in queue
- Next person who also clicks gets paired with them
- Both users get notified, WebRTC signaling happens through the same WebSocket connection
- Direct peer-to-peer video connection established!
- Random stranger matching
- Video and audio chat (peer to peer)
- Text chat
- Camera flip (front/back)
- Mute/unmute
Made for my Microservices class project 🎓