Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/channelstream/channelstream_demos
Demonstrative applications for Channelstream
https://github.com/channelstream/channelstream_demos
Last synced: 27 days ago
JSON representation
Demonstrative applications for Channelstream
- Host: GitHub
- URL: https://github.com/channelstream/channelstream_demos
- Owner: Channelstream
- License: mit
- Created: 2020-02-09T13:30:59.000Z (almost 5 years ago)
- Default Branch: master
- Last Pushed: 2023-02-03T03:36:36.000Z (almost 2 years ago)
- Last Synced: 2024-04-15T01:17:09.336Z (9 months ago)
- Language: JavaScript
- Size: 2.69 MB
- Stars: 1
- Watchers: 2
- Forks: 0
- Open Issues: 19
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Demos
This repository provides demonstrative applications on how to connect with the server
and send information to clients.All demos assume you have Channelstream running with default secrets and ports.
You have a simple notification demo built on flask:
cd notification/
YOUR_PYTHON_ENV/bin/pip install -r requirements.txt
YOUR_PYTHON_ENV/bin/flask runNow you can open multiple browser windows to http://127.0.0.1:5000/ and test notifications.
There is also more complex chat application demo included, it showcases
multiple channel subscriptions, message edits and user state changing.YOUR_PYTHON_ENV/bin/pip install -r requirements.txt
YOUR_PYTHON_ENV/bin/python chat/app.pyOpen your browser and point it to following url:
http://127.0.0.1:6543
# Using docker compose
docker-compose up
# for live reload
USER_UID=`id -u` USER_GID=`id -g` docker-compose -f docker-compose.yml -f docker-compose.dev.yml up# Using docker manually
# start the main server
docker run --rm -p 8000:8000 -e CHANNELSTREAM_ALLOW_POSTING_FROM=0.0.0.0 channelstream/channelstream:latest
# build the demo
docker build . -t channelstream_demo
# start the demo
docker run -ti --rm -p 6543:6543 -e CHANNELSTREAM_URL=http://172.17.0.2:8000 channelstream_demo# Manual development with reload
# start the main server
docker run --rm -p 8000:8000 -e CHANNELSTREAM_ALLOW_POSTING_FROM=0.0.0.0 channelstream/channelstream:latest
# build the image for landing page backend
docker build . -t channelstream_demo
# run the backend code with hot reload
docker run -ti --rm -p 6543:6543 -e USER_UID=`id -u` -e USER_GID=`id -g` \
-e CHANNELSTREAM_URL=http://172.17.0.2:8000 \
--mount type=bind,source="$(pwd)"/chat,target=/opt/application \
--mount type=bind,source="$(pwd)"/chat/static,target=/opt/application/static \
channelstream_demo
# build frontend code builder image
docker build . -f Dockerfile.static -t channelstream_demo_statics
# run the frontend code with hot reload
docker run -ti --rm -e USER_UID=`id -u` -e USER_GID=`id -g` \
-e FRONTEND_ASSSET_ROOT_DIR=/opt/application/static \
--mount type=bind,source="$(pwd)"/chat,target=/opt/application \
--mount type=bind,source="$(pwd)"/chat/static,target=/opt/application/static \
channelstream_demo_statics