- Once the user enter localhost/account/register register page loads where user can register and user data is stored in the postgresql database as in below:
- if the url conatins localhost/account/login login page loads where the verification of users beign done before going tho the chat window:
- if url contains localhost/chat/ chat pages load where multiple registered users can chat simultaneously through websockets.
- chat room conatains textArea, input text and send button
- At loading we fetch the user from the database with {{ request.user.username|json_script:"user-name"}}
- Channel used for communication is redis.
- Through routing re path it as ws(websocket)/chat/ and asgi wrapper of consummers for each connection
- ChatConsumers have async 4 functions connect(for connecting to the specified room),disconnect(disconnect from the room),receive(receive message from websockets and send to room group),chat_message(receive from room group and send to websocket to deisplay to text area)