Welcome to the SpotifyMe repository; this is a clone of the popular music streaming app, Spotify!
SpotifyMe is built using the Flask API framework with the Flask-SQLAlchemy extension for database migrations.
$ git clone https://github.com/ericdwkim/SpotifyMe
Learn more about venv here
Unix/MacOS:
$ python3 -m venv venv
$ . venv/bin/activate
Windows:
$ python3 -m venv venv
$ . venv/Scripts/activate
This project has only been tested with the following python3
and pip
versions.
Ensure that the installed python3
is version 3.9.4
on the venv
$ python3 -V
Ensure that the installed pip
is version 21.1.2
on the venv
$ python3 -m pip install --upgrade pip==21.1.2
$ pip -V
$ cd flask
$ python3 -m pip install -r requirements.txt
There are two ways to run the app:
- If you have a working Docker Environment already, pull the following images and run the containers.
Flask application image
$ docker pull ericdwkim/spotifyme-flask:v2
Postgres database (linux/arm64) image
$ docker pull ericdwkim/spotify-me-pg:v1
pgAdmin image
$ docker pull ericdwkim/spotify-me-pgadmin:v1
$ docker compose up -d
$ docker compose up -d --build --scale app=3
This command will result in 3 separate instances of the spotifyme-flask (v2) app.
$ docker compose down --rmi all
Visit localhost:7777
/api
2. Running locally on virtual environment
Toggle SQLALCHEMY_DATABASE_URI
in flask/app.py
to localhost
Toggle host
in flask/config.py
to localhost
$ cd flask
$ export FLASK_ENV=development
$ flask run
$ cd flask
$ flask db init
$ flask db stamp head
$ flask db migrate
$ flask db upgrade
Visit localhost:5000
/api