View the Site · Report Bug · Request Feature
This app serves data from a Firebase Realtime database and the Spotify API to Mixdup, a progressive web app for making weekly playlists with friends to find new music. This middleware is a temporary solution while a graphQL database is developed to replace Firebase's Realtime DB.
The concept for Mixdup was developed by Ruthie Rabinovitch and Noa Harnik
Express
Javascript
Firebase
Spotify API
- npm: (
npm install npm@latest -g)
- Fork the repo
- Clone down the forked repo
cdinto your local project and runnpm install- You will need to add the following variables into a
.envfile in the root directory. These values can be created at the Spotify Developer dashboard and with a Firebase account.
FIRE_API_KEY,
FIRE_AUTH_DOMAIN,
FIRE_DATABASE_URL,
FIRE_PROJECT_ID,
GOOGLE_APPLICATION_CREDENTIALS,
SPOTIFY_CLIENT_ID,
SPOTIFY_CLIENT_SECRET,
APP_CREDENTIALS_TYPE,
APP_CREDENTIALS_PROJECT_ID,
APP_CREDENTIALS_PRIVATE_KEY_ID,
APP_CREDENTIALS_PRIVATE_KEY,
APP_CREDENTIALS_CLIENT_EMAIL,
APP_CREDENTIALS_CLIENT_ID,
APP_CREDENTIALS_AUTH_URL,
APP_CREDENTIALS_TOKEN_URL,
APP_CREDENTIALS_AUTH_PROVIDER,
APP_CREDENTIALS_CLIENT_CERT_URL
- Run the app!
npm run local- Follow the instructions in the Mixdup Front End Repo to run the client side of the app.
Method:
GET
For local use only Redirects to Spotify for oAuth if access tokens are expired.
Method:
GET
For local use only Receives a redirect from Spotify and parses authentication codes from url parameters.
Method:
POST
Headers:
authorization- an id token generated by Firebase
Body:
query: string
Return:
A readable string containing search result data from Spotify. Types for this data can be viewed here.
Method:
POST
Headers:
authorization- an id token generated by Firebase.
Body:
date: any Date
Return:
A readable string containing a playlist object from Spotify. Types for this data can be viewed here.
Method:
POST
Headersauthorization- an id token generated by Firebase.
Body:
date: any Date
Return:
If there an existing playlist for the week of the provided date, it will be returned. Otherwise, a new one will be generated and returned.
Method:
POST
Headers:
authorization- an id token generated by Firebase.
Body:
user_id: the users idsubmission_uri: the Spotify URI of the song being submittedtrackName: the name of the song being submitteddate: any Date
Method:
POST
Headers:
authorization- an id token generated by Firebase.
Body:
user_id: the users idvotes: An object containing the song titles of votes - <{ first: string, second: string, third: string, heard: string[]}>date: any Date
Method:
GET
Headers:
authorization- an id token generated by Firebase. **Return: A readable stream containing an array of [Spotify Playlists](https:/ /**github.com/GreysonElkins/mixdup/blob/main/src/types/spotifyData.d.ts#L1)
Method:
POST
Headers:
authorization- an id token generated by Firebase.
Return: A readable stream containing a Spotify Playl ist
See the open issues for a list of proposed features (and known issues).
Contributions are what make the open source community such an amazing place to be learn, inspire, and create. Any contributions you make are greatly appreciated.
- Fork the Project
- Create your Feature Branch (
git checkout -b feature/AmazingFeature) - Commit your Changes (
git commit -m 'Add some AmazingFeature') - Push to the Branch (
git push origin feature/AmazingFeature) - Open a Pull Request to this branch