Git Product home page Git Product logo

moody-tunes's Introduction

moody-tunes

alt_text

Visit: MoodyTunes

MoodyTunes is a music sharing site where users can find the perfect playlist for their mood. Each playlist has reaction upvotes which endorses that playlist's mood. Users can also follow their favorite playlists for easy access.

Technology

This app is built on a MERN tech stack. It uses MongoDB as the database for Node.js and Express.js on the backend, and Javascript/React/Redux to render the front-end.

Features

  • User authentication
  • Embedded, followable Spotify playlists (for registered users)
    • Easy access
  • User dashboard (for registered users)
    • Displays user's followed playlists
  • Reaction buttons on playlists
    • With live-updated reaction counts

Playlist reaction buttons and follow button

  • Each playlist object in the database has an associated reactions object, which contains information about the number of reactions recorded for each emotion.
  • When a reaction button is clicked, the reaction count is instantly updated and the backend is modified to reflect the newly-added reaction.
reactOnPlaylistChill(e) {
        e.preventDefault();
        var playlistId = this.props.playlist._id;
        const reactionData = {id: playlistId, reaction: "chill"}
        this.props.playlist.reactions ? document.querySelector("#react-counts-chill").textContent++ : console.log(null);
        this.props.sendReaction(reactionData);
    }
  • Also, each playlist can be followed, after which users can go to their profile page to view their followed playlists.
  • This was implemented by having a separate "follows" collection in MongoDB, where each follow document contains the userId and the current playlistId.
 followPlaylist(e) {
        // console.log('follow button clicked')
        e.preventDefault();
        let userId = this.props.user ? this.props.user.id : null;
        let playlistId = this.props.playlist._id;
        const followData = {playlistId: playlistId, userId: userId};
        var followButtonText = "Unfollow"
        this.props.sendFollow(followData);
    }
  • When a user clicks the follow button, a new follow document is created in the database. The user profile page simply fetches all follows associated with the current userId, and displays the playlists by accessing the corresponding playlistId.

Feature Implementation Issues

  • Persisting reaction count data to the database
  • Persisting follow playlist action
    • Passing and recieving state shape correctly in order to make the follow action persist

moody-tunes's People

Contributors

c-kan-42 avatar kevin-nguyenn avatar prescottiec avatar mayanag avatar

Watchers

James Cloos avatar  avatar  avatar

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.