Skip to content

Commit

Permalink
Merge pull request #67 from jbkuczma/develop
Browse files Browse the repository at this point in the history
merge develop into master for beta release #58
  • Loading branch information
deankostorowski authored Oct 21, 2017
2 parents 5fc6a24 + 88a3934 commit 1b78814
Show file tree
Hide file tree
Showing 43 changed files with 18,388 additions and 1 deletion.
62 changes: 62 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
# Logs
logs
*.log
npm-debug.log*
yarn-debug.log*
yarn-error.log*

# Runtime data
pids
*.pid
*.seed
*.pid.lock

# Directory for instrumented libs generated by jscoverage/JSCover
lib-cov

# Coverage directory used by tools like istanbul
coverage

# nyc test coverage
.nyc_output

# Grunt intermediate storage (http://gruntjs.com/creating-plugins#storing-task-files)
.grunt

# Bower dependency directory (https://bower.io/)
bower_components

# node-waf configuration
.lock-wscript

# Compiled binary addons (https://nodejs.org/api/addons.html)
build/Release

# Dependency directories
node_modules/
jspm_packages/

# Typescript v1 declaration files
typings/

# Optional npm cache directory
.npm

# Optional eslint cache
.eslintcache

# Optional REPL history
.node_repl_history

# Output of 'npm pack'
*.tgz

# Yarn Integrity file
.yarn-integrity

# dotenv environment variables file
.env

.idea/rm

server/keys.js
6 changes: 6 additions & 0 deletions .idea/vcs.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

63 changes: 62 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,2 +1,63 @@
# moose
UB CSE 442 project
UB CSE 442 project. [Moose](moosemusic.net/) is a web app that allows users to stream music together effortlessly.

A user can create a room, becoming that room's host, and share the associated room code with their friends. Once in a room, a user can search for and add music to the room's queue which is played through the host's device. A room will close if there is no song being played and the queue is empty or if the host chooses to close the room.

# Prerequisites
**Important**

Before running, please ensure that Node.JS (we have been developing with v8.5.0) and MYSQL are installed on your machine. Our development and testing were performed primarily on macOS Sierra, but the following instructions should work for any *nix system.

You will also need a YouTube search API key to make requests. You can register for an API key [here.](https://console.developers.google.com/apis/credentials) Once on the Google APIs page, click the "Create Credentials" button and select "API key".

**Once you have a cloned repo come back to this step**

Edit the following line in server/example.keys.js:

const my_key = 'YOUR API KEY';

so that it contains the API key you just created. Then rename this file from **example.keys.js** to **keys.js**

# Installation and Running
1) Download a zip of the repo from GitHub or clone the repo

git clone https://github.com/jbkuczma/moose.git

2) Move into the project directory

cd moose

3) Install dependencies for Moose

npm install

4) Run the shell script to setup the testing database

sh create_clean_db.sh [root_username] moose

* You will need to provide a root database user and its password when prompted for the script to work
* 1 user will be created
* User: test.1
* Password: test.1
* 1 room will be created
* Room name: SaturdaysAreForTheBoys
* Room Code: 4444

5) Start Moose

npm start

You should see the following prompt:

Moose started on port 3000
Visit localhost:3000/login or [Your IP Address]:3000/login

**The following routes can be visited after following the above steps:**

localhost:3000/login
localhost:3000/rooms
localhost:3000/room/[A Room Code]

**Note**

There will be a slight delay on the room host's screen from when a user joins a room to them showing up in the "Users in room" area. There will also be a slight delay when selecting a song and having it show up in the queue. Rapidly adding songs to the queue may cause server overload which will then need to be restarted, forcing everyone to have to login again - be generous.
60 changes: 60 additions & 0 deletions create_clean_db.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
#!/bin/bash
#
# Script to create a fresh moose database
#
# @author James Kuczmarski
#
# @usage sh create_clean_db.sh [root_username] [db_name]
#

USER=$1;
DB=$2;

if [ $# -eq 2 ]
then
mysql -u ${USER} -p << SQL
DROP DATABASE IF EXISTS ${DB};
CREATE DATABASE IF NOT EXISTS ${DB};
USE ${DB};
CREATE TABLE IF NOT EXISTS users (
user_id INT NOT NULL AUTO_INCREMENT,
username VARCHAR(16) NOT NULL,
password TEXT NOT NULL,
salt VARCHAR(16) NOT NULL,
created_at TEXT,
current_room VARCHAR(5),
PRIMARY KEY (user_id)
);
CREATE TABLE IF NOT EXISTS rooms (
room_name VARCHAR(22) NOT NULL,
room_code VARCHAR(5) NOT NULL,
created_at TEXT,
room_owner_name VARCHAR(16) NOT NULL,
PRIMARY KEY (room_code)
);
CREATE TABLE IF NOT EXISTS music (
youtube_id TEXT NOT NULL,
room_code VARCHAR(5) NOT NULL,
rank_in_queue INT NOT NULL AUTO_INCREMENT,
song_name TEXT NOT NULL,
PRIMARY KEY (rank_in_queue)
);
INSERT INTO users (username, password, salt, created_at, current_room) VALUES ('test.1', 'f6537d74a07a61d7a7524e4f5d4070a3fffcdf51c72c6ee22792fd21d76aca388c08abab492790f91879731c427b1653f91e484386b951b61e1783a61732eeaf', '5fc0f38ea20272f8', NOW(), NULL);
INSERT INTO rooms (room_name, room_code, created_at, room_owner_name) VALUES ('SaturdaysAreForTheBoys', '4444', NOW(), 'test.1');
INSERT INTO music (youtube_id, room_code, song_name) VALUES ('Kp7eSUU9oy8', '4444', '3005');
SQL
echo "Finished creating database ${DB}";
else
echo "syntax: sh db.sh [root_username] [db_name]";
exit 1;
fi

#
# creates 1 user
# user: test.1
# pass: test.1
#
# creates 1 room
# name: SaturdaysAreForTheBoys
# code: 4444
#
9 changes: 9 additions & 0 deletions licenses/background_images_licenses.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
Sources for our background images
================================


Login page background image - https://vimeo.com/136092725

================================

Create/join room page background image - https://commons.wikimedia.org/wiki/File:EDMcrowd.jpg
14 changes: 14 additions & 0 deletions licenses/landy_license.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
---------------------
LICENSE CONDITIONS
---------------------

You are completely free to use this template for your personal use or as a work for your client as
long as you keep the link at the template footer pointing to us and our partner.

If you would prefer removing the backlink from the theme footer, please donate (https://bootstrapious.com/donate)
to support themes' development. Suggested amount per template is $10.
Also, as a bonus for donors, I can provide you the SCSS files for even easier template customization. Drop me a line at hello@bootstrapious.com after donating.

However you cannot redistribute the template nor its derivatives on the internet - neither for free or commercially (e.g. selling it on template marketplace).

Thank you for understanding and respecting the license conditions.
Loading

0 comments on commit 1b78814

Please sign in to comment.