Sign in

Realtime chat with flask, and angular

Recently I started making web applications using python. Given I am so unfamiliar with the frameworks available and that I’ve always wanted to learn how to do realtime applications with, I thought was a good idea to try to make a chat with flask, and angular as an exercise.

The back-end

So is a library that enables event-based communication between clients and a server. For this chat application, I thought the simplest thing would be to handle three different events:

  1. A user disconnects
  2. A user sends a message


The Angular front-end is a bit convoluted to be described here. But briefly, I am using two services: The LoginService (login.service.ts ) and the ChatService (chat.service.ts ) . The LoginService handles the sign_in event:

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store