- Club Admin Dashboard: http://localhost:8081/admin/
- Jukebox Frontend: http://localhost:3000
- Aggregated Api Docs: http://localhost:8080/api/docs/
- Jukebox Server Api Swagger Docs: http://localhost:9000/api/docs/
- Club Manager Api Swagger Docs: http://localhost:8081/api/docs/
- Spotify Login: http://localhost:8080/api/v1/spotify/login/
You can run network mode in 2 ways:
- Via the frontend docker-compose file
- Via the server docker-compose files
- Docker, Docker Compose (install)
- Header injection browser extension:
- ModHeader: Chrome
- Requestly: Chrome, Safari
- Modify Header Value: Firefox
- simple-modify-headers: Firefox
Optionally:
- PgAdmin (install)
- Jukebox Frontend repo cloned locally (github)
-
In the jukebox frontend repo, run
docker-compose -f docker-compose.network.yml build
to build the frontend image for use with the docker-compose file. -
Optionally, if you want to override the default admin credentials, you can make a copy of the sample.env file and enter your own credentials.
cp sample.env .env
-
Then run
docker-compose -f docker-compose.network.yml up
to run the servers.
- Jukebox Server repo cloned locally
- Club Manager repo cloned locally
- Jukebox Frontend repo cloned locally
-
In teh jukebox server repo, build the images:
docker-compose -f docker-compose.network.yml build
-
Run this command to run just the jukebox server:
docker-compose -f docker-compose.network.yml up server
-
Run this command in the Club Manager to build the image:
docker-compose -f docker-compose.network.yml build
-
If you want to change the default user, make a copy of the sample env file:
cp sample.env .env
-
Then, run the club manager server:
docker-compose -f docker-compose.network.yml up
-
Once the jukebox and club manager servers are running, go back to the jukebox repo and start up the proxy:
docker-compose -f docker-compose.network.yml up proxy --build --force-recreate
-
In the Jukebox Frontend, start up the dev server:
npm run network
It's necessary to run the jukebox server and club manager server before the proxy because the proxy requires both servers to be online in order for it to run. Eventually, there will be a liveliness probe to check if they're online before starting, but for now it needs to be run only after the servers are started up.
Once you get the network up and running, proceed with the following steps to set up the models, Spotify, etc.
- Log in to the admin dashboard using the default credentials, or you can set your own credentials using the instructions above in Server Setup.
- Create a new club in the admin dashboard, the name can be anything.
- In the club manager swagger api docs, get a new auth token via the
/api/v1/user/token/
route. - Install one of the header modification plugins described in Required Tools,
and add the header
Authorization
with the valueToken token-value-here
, replacingtoken-value-here
with the token you got from the club manager api. - In the Jukebox Server api, create a new Jukebox, and for
club_api
use the api from the new club.
Once you have the club model and jukebox model created, and have a way of authenticating with the api, proceed with the following steps to connect to spotify.
-
Make sure header modification extension is activated for the current tab, and visit the link http://localhost:8080/api/v1/spotify/login/.
This will redirect you to Spotify, then once you log in to Spotify you will be redirected back to the jukebox server. If Spotify authentication was successful, you should see a block of JSON displaying your Spotify account info.
-
In the swagger docs page for Jukebox Server, use the POST route for
/api/v1/jukebox/{jukebox_id}/links
to create a new Jukebox Link - or a connection between a Jukebox and a user's spotify account.For the "type" field, use "spotify", and for the email field use the email connected to your spotify account (doesn't need to be the same email to your Club Manager user account)
-
Log in to the admin dashboard for Jukebox Frontend at http://localhost:3000/admin/, and once a button appears to connect to spotify, click connect.