#๐ Backend
18 messages ยท Page 1 of 1 (latest)
@undone wigeon
Remember to:
- Ask your Python question, not if you can ask or if there's an expert who can help.
- Show a code sample as text (rather than a screenshot) and the error message, if you've got one.
- Explain what you expect to happen and what actually happens.
:warning: Do not pip install anything that isn't related to your question, especially if asked to over DMs.
how are you currently storing the conversation?
In mongo
I have to show live conversation in frontend which I don't know how to do it now.
To "push" data to the frontend live, you'll want to look into websockets. When the frontend loads, the frontend initiates a websocket connection with the backend, which has a websocket server listening for connections. Then, when a message is generated, you emit that to the socket server, which relays the message to the connected clients.
For the frontend, you'd probably want this library: https://www.npmjs.com/package/socket.io-client
That's good for production too like in future I will deploying in it azure or other
Websockets are a mature technology. A large portion of the websites you use on a daily basis have websockets connections in the background.
I wouldn't be surprised if that's how chat is done in this DIscord client.
If you want to see websockets in action, load up a site like Stackoverflow, open the dev tools, go to the Network tab, filter for "Socket"/"WS" traffic, then restart the page. You can see all the messages sent back and forth in the background.
Ok
This help channel has been closed. Feel free to create a new post in #1035199133436354600. To maximize your chances of getting a response, check out this guide on asking good questions.