Skip to content
Daniel Guddemi edited this page Nov 11, 2019 · 1 revision

Introduction

SongFlong is shared BPM analyzer and video generator. When given a song title, it searches for songs with similar beats per minute (BPM) and overlays the audio over the input song's music video. Occasionally the audio and music video overlay line-up to produce an amusing video. Best results come from music videos with lots of action or dramatic moments that offer places in the video to sync with the shared BPM audio.

Getting Started

Install Dependencies

To simplify the environment setup of this application, everything is built into Docker container. So all you need to do is install the Docker engine onto your computer and the necessary dependencies will be managed by the containers.

Docker installation can be found with a quick search for your operating system. Official Docker Install Page

Once you've installed Docker, you'll need to create an account on Docker Hub for access to the necessary base images. Running docker login should give you the necessary instructions.

Starting the Application

The application is broken into two parts: the React website and the REST API. Navigate into SongFlong's root directory and follow the instructions below.

SongFlong Website

First build the application by running docker build -t songflong-react:latest -f Dockerfile.react . (don't forget the period at the end, its important). This will build the image and tag it as songflong-react.

To start the Docker container with the image, run: docker run -p 80:80 songflong-react:latest. This will start the container and expose the standard http port 80 to your localhost. Navigating to localhost in your browser will send you to the SongFlong website.

SongFlong Application

SongFlong exposes a REST API for the website to use. The application is built with a Redis Task Queue that run as processes outside of the main application server. To simplify the setup, execution, and networking of these services, we use Docker Compose to handle it all.

To build the service containers for the Compose, simply run docker-compose build in the SongFlong root directory. This will download and build the necessary images.

To start the application services, execute the following command docker-compose up. This will start the application and create a single worker for the task queue. If you want to scale the workers, add the following flag to your command docker-compose up --scale worker=<# of workers> The web application will be opened on port 5000 and a simple GET request to localhost:5000/ping will test that the service is up.