https://github.com/jcurbelo/beampressk
A Flask webserver implementation to host and control presentations built with beampress.js
https://github.com/jcurbelo/beampressk
flask flask-socketio python socket-io
Last synced: about 2 months ago
JSON representation
A Flask webserver implementation to host and control presentations built with beampress.js
- Host: GitHub
- URL: https://github.com/jcurbelo/beampressk
- Owner: jcurbelo
- License: mit
- Created: 2015-02-25T19:47:48.000Z (over 11 years ago)
- Default Branch: master
- Last Pushed: 2021-08-02T10:21:07.000Z (almost 5 years ago)
- Last Synced: 2026-05-03T01:39:14.530Z (about 2 months ago)
- Topics: flask, flask-socketio, python, socket-io
- Language: JavaScript
- Homepage:
- Size: 15 MB
- Stars: 2
- Watchers: 1
- Forks: 0
- Open Issues: 7
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# beampressk
A [Flask](http://flask.pocoo.org/) webserver implementation to host and control *presentations* built with [beampress.js](https://github.com/jcurbelo/beampress). It leverages the usage of [Flask-SocketIO](https://github.com/miguelgrinberg/Flask-SocketIO) and [socket.io-client](https://github.com/socketio/socket.io-client) to add _real-time_ control over the slides.
> If you want to use only the "static" version go to [beampress.js](https://github.com/jcurbelo/beampress)
## How to use it
1. Clone this repo using your preferred method:
```bash
# SSH
$ git clone git@github.com:jcurbelo/beampressk.git
# HTTPS
$ git clone https://github.com/jcurbelo/beampressk.git
# GitHub CLI
$ gh repo clone jcurbelo/beampressk
```
2. Install dependencies with [pipenv](https://pipenv.readthedocs.io/en/latest/):
```bash
# cd to application's root and then
$ pipenv install
```
3. Define environment variables with [`.env`](https://pipenv-fork.readthedocs.io/en/latest/advanced.html#automatic-loading-of-env) file:
```bash
# python-dotenv searches for a .env file located at root
SECRET_KEY=YOUR_SECRET_KEY
BASIC_AUTH_USERNAME=YOUR_ADMIN_USER
BASIC_AUTH_PASSWORD=YOUR_ADMIN_PASSWORD
```
4. Run Flask server using [Flask CLI](https://flask.palletsprojects.com/en/1.1.x/cli/):
```bash
$ pipenv run flask run
# or activate virtual env
$ pipenv shell
# and then run it with your local installation
(beampressk) $ flask run
# example output
Loading .env environment variables…
* Serving Flask app "beampressk" (lazy loading)
* Environment: development
* Debug mode: on
* Running on http://0.0.0.0:5000/ (Press CTRL+C to quit)
* Restarting with stat
* Debugger is active!
* Debugger PIN: 311-574-148
```
5. Navigate to the "admin" view: `/` and authenticate using the admin credentials defined on step 3 `ADMIN_USER` and `ADMIN_PASSWORD`.
> All "admin" (protected) views use [Basic Access Authentication](https://en.wikipedia.org/wiki/Basic_access_authentication) with [Flask-BasicAuth](https://flask-basicauth.readthedocs.io/en/latest/). The purpose of beampressk is to be accessed via a "local" network, we don't recommend this approach for a production-like environment.
6. Navigate to any "presentation" view (e.g `/presentation/example-warsaw`) and play with the admin controls.
## How to add your presentations
* Put your `index.html` file in `beampressk/templates/your-presentation`, where `your-presentation` is any name of your preference.
* Navigate to `/presentation/your-presentation` URL.
* All presentations must follow [beampress.js](https://github.com/jcurbelo/beampress) requirements in order to work.
* You can use [Jinja syntax](https://jinja.palletsprojects.com/en/2.11.x/) along with [Template Inheritance](https://flask.palletsprojects.com/en/1.1.x/patterns/templateinheritance/) to better organize your presentations. Have a look at the *example_warsaw* demo presentation, it uses a base template called `warsaw_base.html`. Feel free to create your own base template.
```jinja
{% extends "warsaw_base.html" %}
{% block content %}
Hello World!
{% endblock %}
```
## How it looks
