Coder Social home page Coder Social logo

bchiang7 / spotify-profile Goto Github PK

View Code? Open in Web Editor NEW
632.0 5.0 85.0 4.61 MB

A web app for visualizing personalized Spotify data built with React, Express, and the Spotify API

Home Page: https://spotify-profile.herokuapp.com/

JavaScript 94.54% HTML 5.30% Shell 0.16%
spotify-profile spotify-web-api react styled-components express nodejs reach-router

spotify-profile's Introduction

Spotify Profile

A web app for visualizing personalized Spotify data

Built with a bunch of things, but to name a few:

Setup

  1. Register a Spotify App and add http://localhost:8888/callback as a Redirect URI in the app settings
  2. Create an .env file in the root of the project based on .env.example
  3. nvm use
  4. yarn && yarn client:install
  5. yarn dev

Deploying to Heroku

  1. Create new heroku app

    heroku create app-name
  2. Set Heroku environment variables

    heroku config:set CLIENT_ID=XXXXX
    heroku config:set CLIENT_SECRET=XXXXX
    heroku config:set REDIRECT_URI=https://app-name.herokuapp.com/callback
    heroku config:set FRONTEND_URI=https://app-name.herokuapp.com
  3. Push to Heroku

    git push heroku master
  4. Add http://app-name.herokuapp.com/callback as a Redirect URI in the spotify application settings

  5. Once the app is live on Heroku, hitting http://app-name.herokuapp.com/login should be the same as hitting http://localhost:8888/login

spotify-profile's People

Contributors

bchiang7 avatar dependabot[bot] avatar imgbotapp avatar nurgasemetey avatar vj-abishek avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

spotify-profile's Issues

Should LocalStorage be used to store api tokens?

Noticed that localStorage is being used to store access and refresh tokens, and Local Storage can be vulnerable to XSS attacks. An alternative could be using http-only cookies.

See:

Ofc, there are limitations (time + complexity) for deciding how the tokens can be stored. I mainly wanted to open up discussion on possible solutions and considerations.

App fails to logout with access_token in url

After logging in, the user is brought to the <Profile /> component and the url is set to something like https://spotify-profile.herokuapp.com/#access_token=BQBkftL1q6csOOMYZojUD...

Hitting 'Logout' from here refreshes the page with the profile still loaded. To get around this, one can navigate to any page and back to their profile to have the url reset without the access_token query present. When it's gone, the Logout button works again.

I think it's because in the server's index.js there is:

 res.redirect(
            `${FRONTEND_URI}/#${querystring.stringify({
              access_token,
              refresh_token,
            })}`,
          );

and the only path back to / is in the Nav.js component:

<NavLink to="/">
    <IconUser />
    <div>Profile</div>
</NavLink>

Missing license

I noticed that there is no license for this project. I suggest that a license be added such MIT to allow people to make use of the project without worrying about legal complications.

I hope that you take this into consideration in the spirit of open source.

Thank you.

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.