Human Jukebox is a web app for musicians and bands to connect with their audience members, sharing information such as their repertoire, their biography, and links to their social media and Venmo accounts. Musicians are authenticated via Spotify, and their repertoires are imported from playlists attached to their Spotify accounts.
This is a public repo for the Human Jukebox app. Pull requests are very welcome. For questions, comments, and bug reports, please write to human.jukebox.app@gmail.com.
You will need to create an app at the Spotify developer dashboard. Record both your Client ID and your Client Secret, and whitelist any Spotify accounts that you would like to be able to access your app in development mode.
You will also need to create a PostgreSQL database. Record its URI. The database structure will vary as more features are added, but it can be readily inferred from the database queries embedded in the codebase.
-
Clone this repo.
-
In the root folder, run
npm install
. -
In the root folder, create a new file called
.env
containing the following lines.CLIENT_ID=[your client id] CLIENT_SECRET=[your client secret] PG_URI=[your postgresql URI] PORT=4000 NODE_ENV=development
-
In the root folder, run
npm start
.
The app should now be accessible at localhost:8080
(or elsewhere if you change the value of globals.REDIRECT_URI_BASE_DEVELOPMENT
in the file /src/globals.ts
).
Instructions for hosting the app will depend on the hosting service, but here are the essential points.
-
In the file
/src/globals.ts
of your cloned repo, change the value ofglobals.REDIRECT_URI_BASE_PRODUCTION
to your root URL, including thehttp
orhttps
and ending without a slash. -
In the root folder of your cloned repo, run
npm run bundle-frontend
andnpm run bundle-backend
. (Inside of/dist
, the former will create the filesbundle-frontend.js
andindex.html
while the latter will create the filebundle-backend.js
-- all via Webpack.) -
On your server, create a dedicated root folder for Human Jukebox. Within it, create directories called
client
andserver
. -
Navigate to
/client
. Copy into here the above two frontend files (bundle-frontend.js
andindex.html
) as well as the filesauth.html
,auth.js
,qr.html
, andqr.js
living in/src/client
. -
Navigate to
/server
. Copy into here the filepackage.json
, and runnpm install
. -
Inside of
/server
, make a subfolder also calledserver
and copy into it the filebundle-backend.js
. -
To start the server, navigate to
/server/server
and runnode bundle-backend.js
(or e.g. from the root folder runnode server/server/bundle-backend.js
). -
Set up your frontend server, and proxy requests past
/api
to[your root URL]:4000/api
.
Your app should now be live.
Note the file /src/globals.ts
. In it, you can toggle longConsoleLogs
; depending on what you are working on, it may be useful to either show or hide the (possibly very long) console logs. In it, you can also set hardCutoffForPlaylistLength
, depending on your database preferences.
If you would like to allow your app to be accessible beyond the explicitly whitelisted users, you must submit a quota extension request in your Spotify developer dashboard.