Skip to content

Latest commit

 

History

History
67 lines (50 loc) · 2.24 KB

BUILDING.md

File metadata and controls

67 lines (50 loc) · 2.24 KB

Prerequisites

Setup

  1. Clone the repo and switch to its directory:

    $ git clone https://github.com/poopsicles/readme-now-playing
    $ cd readme-now-playing
  2. First, we get the latest Python 3.9, as of writing that's 3.9.18:

    $ pyenv install 3.9.18
    • Set it as your default Python version for this project and install the dependencies:
    $ pyenv local 3.9.18
    $ poetry install
  3. Copy example.env to .env and fill it in with your credentials:

    $ cp example.env .env
    $ hx .env
    $ cat .env
    FIREBASE_CREDS=bmV2ZXJnb25uYWdpdmV5b3V1cAo=
    CLIENT_ID=bmV2ZXJnb25uYWxldHlvdWRvd24K
    CLIENT_SECRET=bmV2ZXJnb25uYXR1cm5hcm91bmRhbmRkZXNlcnR5b3UK
    REDIRECT_URL=https://localhost:5000/callback/q
    SCOPES=user-read-playback-state user-read-currently-playing user-read-recently-played user-top-read
  4. Run the app with Poetry:

    $ poetry run python3 api/index.py
     * Serving Flask app 'index'
     * Debug mode: on
    WARNING: This is a development server. Do not use it in a production deployment. Use a production WSGI server instead.
     * Running on https://localhost:5000
    Press CTRL+C to quit
     * Restarting with stat
     * Debugger is active!
     ...

You can update dependencies with Poetry:

$ poetry update

As well as emit a requirements.txt which Vercel seems to like (you might need to install the poetry-plugin-export plugin):

$ poetry export --without-hashes -f requirements.txt --output requirements.txt