/mood.ly

A content generator that produces GIFs, quotes, and music based on your mood!

Primary LanguageJavaScript

Mood.ly

A place for you to explore your mood.

Check it out at moodly.io!

Build Status

Meet the Engineers

Table of Contents

  1. Overview
  2. Usage
  3. Requirements
  4. Development
  5. Installing Dependencies
  6. Current Build Health
  7. Roadmap
  8. Progress
  9. Architecture
    1. High Level Architecture
    2. Database Schema
  10. API
  11. Auth
  12. Moods
  13. Quotes
  14. Giphy
  15. Music
  16. Users
  17. Deployment

Overview

Tech Stack

Styling

Webpack

Webpack bundles all files set by the webpack.config.js input folder together so it will load in one script tag. The purpose is to create big chunks that can be loaded asynchronously to reduce initial loading time.

Usage

Input your mood and receive a giphy, quote, and music video!

Requirements

Dependencies in package.json

    "babel-cli": "^6.7.7",
    "babel-core": "^6.7.7",
    "babel-loader": "^6.2.4",
    "babel-preset-es2015": "^6.6.0",
    "babel-preset-react": "^6.5.0",
    "babel-preset-stage-1": "^6.5.0",
    "babel-register": "^6.7.2",
    "bcrypt-nodejs": "0.0.3",
    "body-parser": "^1.15.0",
    "bootstrap": "^3.3.6",
    "chai": "^3.5.0",
    "chai-things": "^0.2.0",
    "connect-flash": "^0.1.1",
    "eslint": "^2.9.0",
    "eslint-plugin-import": "^1.6.1",
    "eslint-plugin-jsx-a11y": "^1.0.4",
    "express": "^4.13.4",
    "express-react-views": "^0.10.1",
    "express-session": "^1.13.0",
    "flash": "^1.1.0",
    "jquery": "^2.2.3",
    "material-ui": "^0.15.0",
    "mocha": "^2.4.5",
    "mysql": "^2.10.2",
    "nodemon": "^1.9.1",
    "react": "^15.0.2",
    "react-bootstrap": "^0.29.4",
    "react-dom": "^15.0.2",
    "react-infinite": "^0.9.2",
    "react-tap-event-plugin": "^1.0.0",
    "request": "^2.72.0",
    "sequelize": "^3.22.0",
    "webpack": "^1.13.0"

Development

Installing Dependencies

From within the root directory:

npm install

Getting Started

After everything installed using npm install, update the API key in /server/config/authconfig.js for YouTube. The authConfig-example.js file is provided for you. Just remove -example and update keys.

mysql.server --start
mysql -u -root -p
webpack --watch
npm start

Navigate to localhost:8080 to view the app.

Testing

To run tests using Mocha and Chai, run

npm test

Roadmap

View the project roadmap here Stories in 'Backlog' Stories in 'Ready' Stories in 'In Progress'

Progress

Throughput Graph

Architecture

High Level Architecture

Architecture Diagram

Database Schema

Database in MySQL, using Sequelize.

Database Schema

API

####AUTH

  • Sign Up: POST: /signup

    • Success Response: { success: true, body: user }
    • Fail Response: { success: false, body: err }
  • Log In: POST: /login`

    • Success Response: { success: true, body: user }
    • Fail Response: { success: false, body: 'Invalid username or password' }

####MOODS

  • Saves Inputted Mood: POST: /api/moods

    • Success Response: { success: true, body: mood }
    • Fail Response: { success: false, body: err }
  • Retrieves All Moods: GET: api/moods

    • Success Response: { success: true, body: allMoods }
    • Fail Response: { success: false, body: err }

####QUOTES

  • Produce a Quote: GET: /api/wikiInfo

    • Success Response: { success: true, body: quote }
    • Fail Response: { success: false, body: err }
  • Save Particular Quote: POST: /api/quotes

    • Success Response: { success: true, body: 'Successfully saved quote.' }
    • Fail Response: { success: false, body: 'Did not save quote.' }
  • Retrieves All Quotes: GET: /api/quotes

    • Success Response: { success: true, body: { [{Text: String, Mood: String}, ... ] } }
    • Fail Response: { success: false, body: err }
  • Retrieves Quote by ID: GET: /api/quotes/:id

    • Success Response: { success: true, body: {Text: String, Mood: String} }
    • Fail Response: { success: false, body: err }

####GIPHY

  • Produce a GIF: GET: /api/giphyInfo

    • Success Response: { success: true, body: String }
    • Fail Response: { success: false, body: err }
  • Save Particular GIF: POST: /api/giphys

    • Success Response: { success: true, body: 'Successfully saved GIF.' }
    • Fail Response: { success: false, body: err }
  • Retrieves All GIFs: GET: /api/giphys

    • Success Response:
      • { success: true, body: { [{URL: String, Mood: String}, ... ] } }
    • Fail Response: { success: false, body: err }
  • Retrieves GIF by ID: GET: /api/giphys/:id

    • Success Response: { success: true, body: {URL: String, Mood: String} }
    • Fail Response: { success: false, body: err }

####MUSIC

  • Produce a Youtube Video ID: GET: /api/musicInfo

    • Success Response: { success: true, trackInfo, videoID }
    • Fail Response: { success: false, keyword, body: err }
  • Save Particular Video ID: POST: /api/music

    • Success Response: { success: true, body: 'Successfully saved Video Id.' }
    • Fail Response: { success: false, body: err }
  • Retrieves All Video IDs: GET: /api/music

    • Success Response:
      • { success: true, body: { [{VideoId: String, Mood: String}, ... ] } }
    • Fail Response: { success: false, body: err }
  • Retrieve Video ID by ID: GET: /api/music/:id

    • Success Response: { success: true, body: {VideoId: String, Mood: String} }
    • Fail Response: { success: false, body: err }

####USERS

  • Retrieves Quotes by User ID: GET: /api/user/quotes

    • Success Response:
      • { success: true, body: { [{Text: String, Mood: String}, ... ] } }
    • Fail Response: { success: false, body: err }
  • Retrieves GIFs by User ID: GET: /api/user/giphys

    • Success Response:
      • { success: true, body: { [{URL: String, Mood: String}, ... ] } }
    • Fail Response: { success: false, body: err }
  • Retrieves Video ID by User ID: GET: /api/user/music

    • Success Response:
      • { success: true, body: { [{VideoId: String, Mood: String}, ... ] } }
    • Fail Response: { success: false, body: err }

Deployment

Deployed using __Digital Ocean__. Installed a MySQL Database. Live at moodly.io!