LosKeeper / skot_backend

Backend for the SKOT Streaming App

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Spartacus Project Backend

This is the backend for the top secret Spartacus Project. It is a simple server that encodes the audio files to mp3 and serves them to the frontend.

Requirements

This project requires ffmpeg to be installed on the system. You can download it from here.

Installation

  1. Clone the repository
  2. Install the dependencies
pip install -r requirements.txt
  1. Make sure that ffmpeg is installed on your system
ffmpeg -version
  1. Make the .env file (for the moment the folder have to be named "audio")
FOLDER=<path to the folder with the audio files to enceode>
  1. Run the encoder
python main.py

Many arguments are available:

Argument Description
--folder The folder to encode (if not in the .env file)
--force Force the re-encoding of the existing files
--message The message wanted to be added on the backend
--title The title of the message to add
--selection The audio files that are highlighted on the frontend
  1. Run the server using docker
docker-compose up

Usage

You can access the files on the url: http://localhost:42024//...

Web Server to upload files

You can use a webserver web_upload.py to upload files to the backend. It is a simple webserver that allows you to upload files to the backend using accounts. The accounts are stored in the users.json file.

You need to define the following environment variables in the .env file:

FOLDER=<path to the folder with the audio files to enceode>

You need to define the following environment variables in the users.json file:

{
    "users": [
        {
            "username": <username>,
            "password": <password_hashed_in_sha256>
        },
        {
            "username": <username>,
            "password": <password_hashed_in_sha256>
        }, 
        ...
    ]
}

You can run the server using the following command:

gunicorn -w 4 --preload web_upload:app -D

About

Backend for the SKOT Streaming App

License:GNU Affero General Public License v3.0


Languages

Language:Python 75.6%Language:HTML 17.8%Language:CSS 6.6%