flask-socketio-practice (A.K.A Yet Another Chat Room)
Messing around with Flask-SocketIO for some real-time goodness.
Inspired by @miguelgrinberg's Flask-SocketIO-Chat project (particularly in project format, which I think Miguel is ace at).
I'm also taking the opportunity to get more comfortable with things like CSS vars, Flexbox layouts, Redis and a few different front-end technologies.
Running it
git clone
andcd
in therevirtualenv venv
to set up a virtualenv (pip install virtualenv
if you don't already have it). venv/bin/activate
pip install -r requirements.txt
- If you don't already have Redis installed, install it (
brew install redis
on macOS) redis-server
to start a local Redis server for message storagepython run.py
- Head to localhost:5000 in your browser(s) of choice
Various Frontends
All front-ends at the moment make use of socket.io for nicer front-end sockets.
- Vanilla JS powered chat-room runs at
/sockets
- Angular 1-powered chat-room runs at
/sockets-ng
- TODO: React
- TODO: Vue2
- TODO: Angular 2
Tested on Python 2.7.13, no reason why it wouldn't also work on other versions.