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
- Host: GitHub
- URL: https://github.com/j2kun/flask-sockets-example
- Owner: j2kun
- Created: 2016-10-08T19:28:38.000Z (over 9 years ago)
- Default Branch: main
- Last Pushed: 2023-07-04T02:04:01.000Z (almost 3 years ago)
- Last Synced: 2025-04-02T19:46:52.852Z (about 1 year ago)
- Language: Python
- Size: 139 KB
- Stars: 8
- Watchers: 1
- Forks: 4
- Open Issues: 6
-
Metadata Files:
- Readme: README.md
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.