An open API service indexing awesome lists of open source software.

https://github.com/j2kun/flask-sockets-example

A simple example app using flask, rethinkdb, and socket.io
https://github.com/j2kun/flask-sockets-example

Last synced: about 1 year ago
JSON representation

A simple example app using flask, rethinkdb, and socket.io

Awesome Lists containing this project

README

          

# Socket example

A demo app to learn to use flask with socket.io for real time updates

# Complete stack

* [Flask](http://flask.pocoo.org) using [flask-socketio](https://flask-socketio.readthedocs.io/en/latest/)
* [WebSockets](http://socket.io/)
* [RethinkDB](http://www.rethinkdb.com) (ignore for now, haven't picked a database)

# Installation

```
git clone git://github.com/j2kun/flask-sockets-example.git
cd rethink-example
virtualenv venv
source venv/bin/activate
pip install -r requirements.txt
```

# Project structure

```
.
├── README.md
├── app.py <--- main flask program
├── init_db.py
├── requirements.txt
├── static <--- third party javascript plugins
│   ├── jquery.js
│   └── socket.io.min.js
└── templates <--- html pages that get rendered by Flask
├── blah.html
└── index.html
```

# Running the application

Run the flask servery with

```
python app.py
```

Then open a browser to to see the simple html page,
and open in multiple windows to see the chat app.