diff --git a/doc/MacInstallation.md b/doc/MacInstallation.md index f3470170..8d10eda5 100644 --- a/doc/MacInstallation.md +++ b/doc/MacInstallation.md @@ -15,9 +15,10 @@ Now install homebrew. ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)" -Then install nodejs +Then install nodejs and frontend code brew install nodejs + (cd frontend && npm install && npm run build) And postgresql: diff --git a/doc/UbuntuInstallation.md b/doc/UbuntuInstallation.md index 12aacacd..4df4762f 100644 --- a/doc/UbuntuInstallation.md +++ b/doc/UbuntuInstallation.md @@ -50,6 +50,12 @@ Install the specific version of ruby needed this will take some time rvm install $(cat metamaps/.ruby-version) +While that is running, you can open another terminal and install the npm frontend code + + cd frontend + npm install + npm run build + Now we also need to copy .example-env to a new file named .env. Review the configuration in here to see if you need any changes. diff --git a/doc/WindowsInstallation.md b/doc/WindowsInstallation.md index f7617260..7580fe7f 100644 --- a/doc/WindowsInstallation.md +++ b/doc/WindowsInstallation.md @@ -20,6 +20,13 @@ Now you are ready to clone the Metamaps git repository: The third `bundle install` command downloads and installs the rubygem dependencies of Metamaps. +You also need to install the Javascript frontend code from the nodejs repositories: + + cd frontend + npm install + npm run build + cd .. + At this point you should be in C:\git\metamaps, or whatever equivalent directory you've chosen. The next step is to set up your database configuration. From the metamaps directory, run diff --git a/doc/production/first-deploy.md b/doc/production/first-deploy.md index b46f9c47..8c350a08 100644 --- a/doc/production/first-deploy.md +++ b/doc/production/first-deploy.md @@ -55,12 +55,23 @@ Run this in the metamaps directory, still as metamaps: # Set up environment variables in your current session source .env export RAILS_ENV=production + export NODE_ENV=production # create, load schema, seed rake db:setup -Now set up nginx - config stored on Linode, including relevant environment -variables. +#### Install js frontend code + + sudo aptitude install nodejs npm + sudo ln -s /usr/bin/nodejs /usr/bin/node + cd frontend + npm install + npm run build + +#### Nginx and SSL + +Now set up nginx - config stored on Linode, including relevant +environment variables. Get an SSL certificate and encrypt it for the realtime video. @@ -75,8 +86,6 @@ server to see what problems show up: #### Realtime server: - sudo aptitude install nodejs npm - sudo ln -s /usr/bin/nodejs /usr/bin/node sudo npm install -g forever (crontab -u metamaps -l 2>/dev/null; echo "@reboot $(which forever) --append -l /home/metamaps/logs/forever.realtime.log start /home/metamaps/metamaps/realtime/realtime-server.js") | crontab -u metamaps - diff --git a/doc/production/pull-changes.md b/doc/production/pull-changes.md index 1586e6e0..9d58ce57 100644 --- a/doc/production/pull-changes.md +++ b/doc/production/pull-changes.md @@ -19,9 +19,11 @@ OR Now that you have the code, run these commands: export RAILS_ENV=production + export NODE_ENV=production source .env bundle install + (cd frontend && npm install && npm run build) rake db:migrate rake assets:precompile rake perms:fix