Amsterdam-Music-Lab / MUSCLE

An application to easily set up and run online listening experiments for music research.
https://www.amsterdammusiclab.nl/
MIT License
4 stars 1 forks source link
cognition-and-perception experiment-design music

DOI CI Backend CI Frontend Test Backend Code Coverage Percentage Frontend Code Coverage Percentage

MUSic-related Citizen Science Listening Experiments (MUSCLE)

This application provides an easy way to implement and run online listening experiments for music research. It presents questions, and typically audio stimuli, to participants, and collects their feedback.

Try MUSCLE

Before installation

We recommend downloading a code editor, for instance Visual Studio Code, and to use git to copy this repository to your machine, as this makes it easier to keep your local copy up to date.

Installation with Docker

The easiest way to run the application locally is through Docker. Docker is an application which runs a network of virtual machines ("containers") and is therefore (mostly) platform independent.

Mac OS X or Windows 10

Install Docker Desktop.

Linux

Development build

Make a copy of the file .env.dist (in the same directory as this README) and rename it to .env. This file contains variables used by Docker to start up a container network serving MUSCLE.

Start Docker (the app icon is a whale carrying containers). Then, open a terminal and run docker compose up (add sudo on Linux). This command starts up the containers defined in docker compose.yaml:

Once you see all containers have started up, open your browser and navigate to localhost:3000. You should now be able to see the first screen of the Goldsmiths Musical Sophistication Index questionnaire.

Since the docker compose.yaml defines bind mounts for backend and frontend, any changes to the files on the host are immediately reflected in the containers, which means code watching works and hot reload works in the same way as with a native node or Django server.

To stop the containers, press ctrl-c or (in another terminal) run docker compose down.

Production build

A production build should define its own docker compose.yaml, making use of the Dockerfile of the backend and frontend environments. It should also define a custom .env file, with safe passwords for the SQL database and the Python backend. Instead of mounting the entire backend and frontend directory and using the development servers, the backend should serve with gunicorn, and the frontend should use a build script to compile static html, css and JavaScript.

Troubleshooting

Please refer to the wiki a checklist of common issues and their solutions.