This is a step by step guide for setting up your local production environment. This includes setting up the server, the database, and the build system.
I wrote this guide after going through this grueling process three times. The first time taking me several weeks to figure out.
**NOTE: ** I am no expert in this stuff, so these steps are very specific to my exact situation. If you have a Windows computer, these steps will surely vary (for example, Im pretty sure Homebrew is mac only) but there are alternatives; I just don't know them because like I said, I am no expert.
Paste this into your terminal to get the code.
git clone https://github.com/CARSILab/spatial-linkedscience.git
If you don't already have it, here is how you can download Git
This is a package manager for OSX. You can install it by pasting this into your terminal:
ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
After it is installed, run this command to make sure everything went okay:
brew doctor
- Run
brew install nginx
from the terminal - Navigate to
usr/local/etc/nginx
- Replace
nginx.conf
with_config/nginx.conf
from this repo - Open
nginx.conf
and go to ~line 152 - Replace the
root
path with the path to your project directory +/dist
- Download Fuseki
- Extract and rename folder to
fuseki
- Move folder into
usr/local
- Move
spatial-data/
andconfig-spatial\@linkedscience.ttl
intofuseki/
folder
Now this is my area of expertise!
You can download Node the easy way or the less easy way, but I suggest the latter because it will allow you to use npm without needing to use sudo
all the time, and allows you to easily switch versions of Node on the fly.
Once you have Node installed, you can install Gulp which will be our task runner:
npm install gulp -g
From inside the project directory,
npm install
then
gulp build
Now you should have everything you need to get started!
Whenever you want to start working, just go navigate to the project directory and
Start up the server and database with:
./server.sh
Then, in a new terminal window, go back to the project directory and simply enter:
gulp
This will automatically compile your sass, javascript, and html, and run a browsersync server that is pure magic!
You can hit ctrl + c
in both tabs to stop them.