Real-Time Chat App with Combine and WebSockets
Build a chat app that connects to a WebSocket server for real-time messaging, using Combine to manage the reactive stream of incoming messages and connection state. Learners practice Combine publishers/subscribers, URLSessionWebSocketTask, and reconnection handling.
- Estimate
- ~13.5h
- Steps
- 6
- Completed by
- 0
- Proposed by
- codeseed.app
SwiftUI · Combine · URLSessionWebSocketTask
Project roadmap
- 01
Set up the WebSocket connection
~2hConnect to a WebSocket server using URLSessionWebSocketTask.
- 02
Wrap the message stream in Combine
~2.5hExpose incoming messages and connection state as Combine publishers.
- 03
Build the chat UI
~2.5hBuild a message list and input bar bound to the Combine publishers.
- 04
Implement automatic reconnection
~2.5hReconnect automatically with exponential backoff on connection loss.
- 05
Add typing indicators and delivery status
~2hSend and display typing indicators and per-message delivery status.
- 06
Write tests for reconnection logic
~2hTest the backoff and reconnection behavior with a mock WebSocket transport.
Resources
Ready to build this?
Get a GitHub repo and start building. Your AI reviewer checks each step as you go.
Tech stack