miguelgrinberg / microflack_messages Goto Github PK
View Code? Open in Web Editor NEWLicense: MIT License
License: MIT License
Hey Miguel,
I do hope to not bore you (with all my questions), but I would be pleased if you have some hints for me on how to get started extending the microflack_app for a multi-chat room app.
The Design
I therefore extended each user with an additional roomid field. The idea is that everyone can login to a chat room with a roomid and can only see the messages inside the room. Additionally it should be possible to send from the server side messages to all users (broadcasting) inside a room and also to only specific clients.
The original message workflow is like this:
app.socket.emit('post_message', {source: args.message}, app.token.get('token'));
→ [socketio] : on_post_message(data, token)
→ [socketio] rv = requests.post('/api/messages', json=data, headers={'Authorization': 'Bearer ' + token},
→ [messages] @app.route('/api/messages', methods=['POST']) – def new_message():
→ [ui] if a new message is registered in the db it is rendered to the ui
Now what I wanted to do is to include
join_room, leave_room inside socketio. But currently socketio works with sending requests so I cannot use e.g.
emit('status', {'msg': session.get('name') + ' has entered the room.'}, room=room)
inside socketio. For this reason I wondered where I have to use the emit?
Do I have to handle diffrent rooms all on client side and should each message contain instead the roomid it is send to?
When running docker build . -t mikroflak
i get this error
ERROR: Could not find a version that satisfies the requirement MicroFlack-Common==0.3 (from -r /app/requirements.txt (line 22)) (from versions: none)
ERROR: No matching distribution found for MicroFlack-Common==0.3 (from -r /app/requirements.txt (line 22))
WARNING: Url '/app/wheels' is ignored. It is either a non-existing path or lacks a specific scheme.
The command '/bin/sh -c pip install --find-links /app/wheels -r /app/requirements.txt' returned a non-zero code: 1```
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.