Learn

How to build a Chat application using Redis

Ajeet Raina
Author
Ajeet Raina, Former Developer Growth Manager at Redis
git clone https://github.com/redis-developer/basic-redis-chat-app-demo-python
cd client
yarn install
yarn start
You can now access a chat window in the browser.

  Local:            http://localhost:3000
  On Your Network:  http://192.168.1.9:3000
cd ..
pip3 install -r requirements.txt
python3 -m venv venv/
source venv/bin/activate
python3 app.py
python3 app.py
 * Restarting with stat
 * Debugger is active!
 * Debugger PIN: 220-696-610
(8122) wsgi starting up on http://127.0.0.1:5000
SET username:nick user:1
  HSET user:1 username "nick" password "bcrypt_hashed_password".
 SADD user:1:rooms "0"
 SADD user:1:rooms 1:2 and SADD user:2:rooms 1:2
 ZADD room:1:2 1615480369 "{'from': 1, 'date': 1615480369, 'message': 'Hello', 'roomId': '1:2'}"
 SADD online_users 1
 PUBLISH message "{'serverId': 4132, 'type':'message', 'data': {'from': 1, 'date': 1615480369, 'message': 'Hello', 'roomId': '1:2'}}"
 HGETALL user:2
 SMEMBERS user:2:rooms
 ZREVRANGE room:1:2 0 50