A simple demo of Redis Streams backed Chat app using Websockets, Python Asyncio and FastAPI/Starlette.
Requires Python version >= 3.11 and Redis 7+
This project has been created to help understand some related concepts. Python standard library asyncio, websockets (which are often cited as a classic use case for async python code), also Redis Streams. It is very much inteded to be an intentionally simple starting point rather than a usable product as is.
$ pip install -r requirements.txtMake sure you have Redis running locally:
$ redis-server$ python chat.pyThen open http://localhost:9080 in your browser.
The easiest way to run the application with all dependencies:
$ docker-compose upThis will start both the chat application and Redis in containers. The app will be available at http://localhost:9080
The following environment variables can be configured:
REDIS_HOST- Redis server hostname (default:localhost, set toredisin Docker)REDIS_PORT- Redis server port (default:6379)