In backend/services/
, add settings.py
client_secret = '<TouchTunes API-KEY>'
5 environment variables are needed for the database connection
Add these to activate
script in your virtual environment
export DB_USERNAME="<username of the database user>"
export DB_PASSWORD="<password of the database user>"
export DB_NAME="<name of the database>"
export SPOTIFY_CLIENT_ID="<spotify client id>"
export SPOTIFY_SECRET_ID="<spotify secret id>"
Migrations:
# Before running migrations, make sure `backend/` is in PYTHON path
# by doing:
export PYTHONPATH='./'
# To run migrations
alembic upgrade head
# To create a migration
alembic revision -m '<name>'
To run Flask developement server:
# port 5000
python app.py
# in backend/services/main.py
location_songs = dict[Location -> dict[songId -> (count, playDate, artistId)]]
Deployed with nginx
, gunicorn
, & an AWS EC2 instance. Refer to here for more information on the installation process
On the instance, run Flask from backend/
with
gunicorn app:app -b localhost:8000