Giter VIP home page Giter VIP logo

music-mixer-takneek's Introduction

Spotify Music Mixer

This Site is live at https://music-mixer.onrender.com/

Disclaimer

We have used Spotify Web API for getting user information like recently played, top artists, top tracks and to recommend songs based on user's spotify data. Due to API restrication (App in Development Mode) it is required that your email id is registered in our spotify developer dashboard. So please provide your email id before using our webapp.

Running the App

Clone the repo and go the repo folder and run the following commands.

Docker

// Build docker image
docker build . -t <your username>/music-mixer

// Run the docker image
docker run -p 8080:8080 -d <your username>/music-mixer

//Now you can send Request to server using Thunder client or Postman or you can run cli.py and enter the port number to play the game.

W/O Docker

npm install
node app.js

API

There are three api endpoints which are specified below. To get your token visit https://music-mixer.onrender.com/mytoken after logging in.

  1. POST https://music-mixer.onrender.com/api/favorite/artists : Request body will have parameters token. for e.g.

    {
        "token":"dfjakf3124a", // This will be provided to you when you login to Music Mixer and go to /mytoken
    }

    In response you will get a ranked list of name of 5 artists

  2. POST https://music-mixer.onrender.com/api/favorite/tracks : Request body will have parameters token. for e.g.

    {
        "token":"dfjakf3124a", // This will be provided to you when you login to Music Mixer and go to /mytoken
    }

    In response you will get a ranked list of name of 5 tracks

  3. POST https://music-mixer.onrender.com/api/favorite/genre : Request body will have parameters token. for e.g.

    {
        "token":"dfjakf3124a", // This will be provided to you when you login to Music Mixer and go to /mytoken
    }

    In response you will get a ranked list of your top 5 genre.

Documentation

Our backend is written in Javascript(NodeJS) and uses MongoDB to store database. We have used majorly following modules/packages in our backend.

  1. express - To handle GET and POST requests and to provide responses.
  2. mongoose - To store and access data that is stored in MongoDB.
  3. spotify-web-api-node - To make requests to spotify server and to retrieve data.
  4. express-session - To store and handle sessions.
  5. ejs - To render pages on server side and then send it to user.

When you click on Login with Spotify, a code is generated which is send to backend and we get access_token and refresh_token. Both the tokens are stored in our DB. Now we can use access_token to make request to Spotify on behalf of that user. access_token will expire in some time. When the access_token expires, we can use refresh_token to get new access_token and both will be updated in our Database.

Recommended Songs are generated on basis of your top 5 recently played songs from past month. We use spotify api to generate recommended songs. Recommended songs are refreshed when you refresh the web page.

music-mixer-takneek's People

Contributors

sayymeer avatar

Stargazers

 avatar

Watchers

 avatar

music-mixer-takneek's Issues

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.