- python3.8
- python3.8-dev
- virtualenv
- build-essential
- mysql-server
- mysql-client
- libmysqlclient-dev
- libsqlclient-dev
- libssl-dev
The all can be easily installed running sudo apt install python3.8 python3.8-dev virtualenv build-essential mysql-server mysql-client libmysqlclient-dev libsqlclient-dev libssl-dev -y
.
β οΈ These requirements will allow Orchestra to work on Ubuntu 20.04. For other operative systems they might change.
- Clone this repo and open a terminal inside the project folder.
- Run
docker-compose up -d
to launch the DB container. If it fails, check that mysql.service isn't already running (in Linux, runsystemctl stop mysql.service
to stop it). - Create a Python 3.8 virtual environment (
virtualenv -p python3.8 .venv
). This step is only needed the first time you run the project. - Activate the python env running
source .venv/bin/activate
. - Inside the python environment,
pipenv install
to install all the project dependencies and runpython3 init_dbs.py
to create all the DB tables. - Reboot the virtual environment, run
deactivate
and thensource .venv/bin/activate
again.
Clone the .env.example
file and rename it as .env
. Then set up the following parameters:
- DB_ENGINE: DB container location.
- DB_ENGINE_TEST: Testing DB container location.
- CLIENT_ID: Spotify app client ID (Can be obtained from Spotify for Developers).
- CLIENT_SECRET: Spotify app client secret (Can be obtained from Spotify for Developers).
- SPOTIPY_REDIRECT_URI: Orchestra frontend location.
Once the project is installed and configured, make sure to have up and running the DB container and active the virtualenv. Then, run flask run
inside the virtualenv.
β οΈ Docker DB container must be up.
β οΈ Installation and configuration steps are needed to run the tests.
- In the
.env
file, change theDB_ENGINE
env variable to matchDB_ENGINE_TEST
to use the testing DB. - To execute the tests run
pipenv run test
from the orchestra-backend root folder. - To use the production database, change back the DB_ENGINE value.
The whole project is installed inside a virtual env. So, it's just needed to remove the project folder and the virtual env folder to uninstalled it completely. If you have followed the Installation section, your virtual environment will be inside the project folder in a folder named .venv
.