8000 GitHub - githubjakob/flask-socket-chat-demo: Demo application to create a chat using flask and socketio
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

githubjakob/flask-socket-chat-demo

Repository files navigation

Flask-SocketIO-Supervisord Example Application

This is a simple example application of a chat using Flask and Flask-SocketIO.

It consists of:

  • A Flask application using Flask-SocketIO that handles the Websocket connections (running with gunicorn and an eventlet worker)
  • A Flask application that contains the REST interface for the chat (running with gunicorn and normal sync workers)
  • Redis for handling the inter process communication between the two Flask applications
  • A nginx reverse proxy in front of the two Flask applications
  • Supervisord for running everything in a Docker container
  • Docker compose that runs the Docker container with the example application and a Redis container
  • Python AsyncIO clients for load testing

Motivation

Flask-SocketIO recommends either using eventlet or gevent as the worker type for the gunicorn web server. However, an existing Flask application might already run using the regular sync gunicorn workers. Assuming we don't want to change the setup for the existing Flask application we can run the Flask-SocketIO application in a separate process. In this case a Redis server can be used to handle the inter process communication between the two Flask applications.

Miro Board

https://miro.com/app/board/uXjVMUlDu70=/

TODO

  • Extend the clients for load testing
  • Add a database for storing the chat messages
  • Goal: Run everything in AWS Elastic Beanstalk

About

Demo application to create a chat using flask and socketio

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published
0