Skip to content

Commit

Permalink
more readme and install scripts
Browse files Browse the repository at this point in the history
  • Loading branch information
mikehelland committed Jan 5, 2018
1 parent 906fee6 commit 0e85d89
Show file tree
Hide file tree
Showing 4 changed files with 47 additions and 20 deletions.
2 changes: 0 additions & 2 deletions .gitignore
Expand Up @@ -2,8 +2,6 @@
.*
node_modules/
!.gitignore
setup_database.sh
install_database.sh
nbproject/
/nbproject/private/
www/soundsets.json
30 changes: 12 additions & 18 deletions README.md
Expand Up @@ -17,39 +17,33 @@ That means that with a few taps of your finger, you can remix the music in OpenM

----

## Setup
## Installation

This is a node.js web app. You can see in action at https://openmusic.gallery.

CD to the directory with the project files and run:
CD to the directory with the project files and edit `install.sh`. At the top it says:

npm install
## IMPORANT! Set the password for the database in this environment variable
## It is used by the app and by the ./create_database.sh

## Database
export OMG_DB_PW=password_here

### Requires OMG_DB_PW environment variable to access the database
Change `password_here` to something better than that. Save the script and run it:

* You can run **export OMG_DB_PW=password** to set it
./install.sh

### Requires Postgresql 9.4 or later)
**IMPORTANT!:** This requires Postgresql 9.4 or later!
`install.sh` will install Postgresql only if there isn't another version installed, so you should check to see if it's 9.4 or later, and if not run `./install_database.sh`.

* You can install Postgres with the included script **./install_postgres.sh**

### Needs omusic_db in Postgres

* With the Postgres installed and the *OMG_DB_PW* env variable set run **./create_database.sh**

### You're setup!

Now just run:
The last line of the `install.sh` runs the app by doing this:

node main.js

And browse to localhost:8080 (8080 is the default, you can also set environment variable *OMG_PORT*).
Now browse to localhost:8080 and make music!

## Other


* (8080 is the default, you can also set environment variable *OMG_PORT*)
* [OMG Basics](https://openmusic.gallery/omg_basics.htm)
* [OMG Data Formats](https://openmusic.gallery/omg_formats.htm)
* [What is Open Music?](https://openmusic.gallery/what_is_open_music.htm)
28 changes: 28 additions & 0 deletions install.sh
@@ -0,0 +1,28 @@

## IMPORANT! Set the password for the database in this environment variable
## It is used by the app and by the ./create_database.sh

export OMG_DB_PW=password_here

## IMPORTANT! This requires Postgresql 9.4 or later!
## This will install Postgresql if there isn't a version installed
## But you should check to see if it's 9.4 or later

which psql
if [ "$?" -gt "0" ]; then
./install_database.sh
else
echo "Postgresql is installed. Hopefully 9.4 or later!"
fi

# Now we can create our database with the password in OMG_DB_PW

./create_database.sh

# This will install all the node modules for the project

npm init

# And now we're good to go!

node main.js
7 changes: 7 additions & 0 deletions install_database.sh
@@ -0,0 +1,7 @@
#installs postgresql-9.5
sudo sh -c 'echo "deb http://apt.postgresql.org/pub/repos/apt/ `lsb_release -cs`-pgdg main" >> /etc/apt/sources.list.d/pgdg.list'
wget -q https://www.postgresql.org/media/keys/ACCC4CF8.asc -O - | sudo apt-key add -
sudo apt-get update
sudo apt-get install postgresql postgresql-contrib


0 comments on commit 0e85d89

Please sign in to comment.