EncoreLink uses a Vagrant virtual machine as the development environment. This isolates your dev environment from your host machine, ensures everyone has the same setup, and automatically installs everything you need to get going. Just follow these steps:
- Install or Update VirtualBox.
- Install or Update Vagrant.
- Run
vagrant plugin install vagrant-hostmanager
to install the Vagrant Hostmanager Plugin. - Clone this repository to your machine.
- Navigate to the repo directory.
- Run
vagrant up
. - Enter your password when prompted.
Running vagrant up
downloads an Ubuntu image to your host machine and
provisions it with everything this project needs to run. This will take a few
minutes, so be patient.
For port errors, make sure postgres is not running
Once vagrant up
has finished, follow these steps to start the server.
vagrant ssh
to login into the virtual machine.cd /vagrant
to navigate to the project.npm start
to start the server.- Open your browser
-
- Backend: http://encorelink.dev:3000/explorer
- Frontend: http://encorelink.dev:8080
- Rejoice!
-To shut down any running vagrant processes use 'vagrant halt'
-After using 'vagrant destroy' your computer should be left at a clean state, as if you never created the guest machine in the first place.
Just code as you normally would in the repo directory you cloned above. Vagrant automatically syncs with this repo directory and runs your code inside the virtual machine.
- Install Node.js
- Install PostgreSQL
- Clone this repo
- Navigate to your repo folder
- Run
npm install
- Create a new database in postgres
- Copy the server/datasources.local.example.json to
server/datasources.local.json
and update the config to match the postgres database. - Run
node .
To gain additional features from StrongLoop, such as clustering, run the
following inside Vagrant, in the /vagrant
directory:
npm install -g strongloop
slc run
This project uses eslint for checking coding practices and standards. It is expected that any opened pull requests have a passing eslint run.
It is highly recommended that you configure your editor to run eslint on the fly while you code.
Additionally, you can run eslint on the command line with npm run lint
(or
npm run lint -- --fix
to have eslint attempt to fix some of the issues)
We run the app with a different configuration for local development than we do
for deploying. If things work when running locally, but fail when deploying,
run npm run heroku
to emulate the config used for
production (visible on localhost:3000).
You might also want to make sure you have the same npm modules that will be
installed on heroku (this can be done with rm -rf node_modules && npm install --production
). In this case, you'll have to start the app with
NODE_ENV=production npm start
(or otherwise export NODE_ENV=production
before starting).