How would you design a real-time chat application?

Technical