Project for generating new Spotify Playlists with a node based logic.
- Install and setup docker and docker compose
- Setup your .env file. See below for details
- Generate the API files, see below
- Run
docker-compose up
This project contains a backend using NodeJs and a frontend using react. The backend uses mongodb to store data. The application uses only the Spotify authentication for user authentication.
This project relies on .env files for an easy setup. The only file should have to change to take advantage of this is ./.env. Avaliable properties are:
CLIENT_IDThe Spotify client id. See the Spotify documentation on how to get oneCLIENT_SECRETthe Spotify client secret. See the Spotify documentation on how to get one. Note: Make sure to never leak this to the publicREDIRECT_URIto where should Spotify redirect after login. Should be similar tohttp://localhost:3000/auth/spotify/callbackMONGOOSE_CONNECTION_STRINGConnection string for mongodb. Currently has to have the hardcoded password likemongodb://root:example@mongodbPUBLIC_URLthe url, where the app is hostedREACT_APP_API_BASEbase url for the apiREACT_APP_BASEbase url for the react application
To regenerate the api for the frontend, use the following command with swagger codegen:
java -jar swagger-codegen-cli.jar generate -i api.yaml -l typescript-fetch -o frontend/src/api -DsupportsES6=trueOr you can use this docker command to generate the files:
docker run -it -v $(pwd):/data swaggerapi/swagger-codegen-cli generate -i /data/api.yaml -l typescript-fetch -o /data/frontend/src/api -DsupportsES6=true