Skip to content

DupMix/microservice

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

73 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

MixDup

Contributors Forks Stargazers Issues

View the Site · Report Bug · Request Feature

Table of Contents

About The Project

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

Built With

Express
Javascript
Firebase
Spotify API

Getting Started Locally

Prerequisites:

  • npm: (npm install npm@latest -g)

Instructions:

  1. Fork the repo
  2. Clone down the forked repo
  3. cd into your local project and run npm install
  4. You will need to add the following variables into a .env file 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
  1. Run the app!
npm run local
  1. Follow the instructions in the Mixdup Front End Repo to run the client side of the app.

Endpoints

/

Method: GET
For local use only Redirects to Spotify for oAuth if access tokens are expired.

/authorize

Method: GET
For local use only Receives a redirect from Spotify and parses authentication codes from url parameters.

/search-spotify

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.

/contest-playlist

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.

/new-theme-new-list

Method: POST
Headers authorization - 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.

/submit-song

Method: POST
Headers:
authorization - an id token generated by Firebase.
Body:
user_id: the users id submission_uri: the Spotify URI of the song being submitted trackName: the name of the song being submitted date: any Date

/submit-votes

Method: POST
Headers:
authorization - an id token generated by Firebase.
Body:
user_id: the users id votes: An object containing the song titles of votes - <{ first: string, second: string, third: string, heard: string[]}> date: any Date

/all-playlists

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)

get-playlist

Method: POST
Headers:
authorization - an id token generated by Firebase.
Return: A readable stream containing a Spotify Playl ist

Roadmap

See the open issues for a list of proposed features (and known issues).

Contributing

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.

  1. Fork the Project
  2. Create your Feature Branch (git checkout -b feature/AmazingFeature)
  3. Commit your Changes (git commit -m 'Add some AmazingFeature')
  4. Push to the Branch (git push origin feature/AmazingFeature)
  5. Open a Pull Request to this branch

Contact

Greyson Elkins - greysonelkins@gmail.com

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published