This is the overall guide to getting this codebase running locally.
Intended for developers associated with Tufts University WMFO.
For making changes to the codebase, please reference the CONTRIBUTING.md
guide once you've followed all the steps below.
These installation steps are written with Mac OS in mind. Some Windows/Linux tips may be scattered throughout but are untested. The main setup.sh
script assumes bash is available.
- Install Homebrew, a package manager for Mac OS (ignore if on Windows; if on Linux, use your standard package manager).
- Install Node and NPM with
brew install node
. You may need to change some XCode permissions on Mac OS (you'll be prompted if that's the case) (if on Windows, install Node and NPM however you can :) ) - Rename the file
server/.dev.env
toserver/.env
, which will set you up with the bare minimum environment config variables. - In the root directory of the repo, run
./setup.sh
which will try to install all the necessary dependencies and build the front end for the first time. There should be no errors. - Install Postgres (maybe follow this, but we don't need steps 5 or 6), and get it running.
- Be sure that the
DEV_DATABASE_URL
field inserver/.env
is set to the valuepostgres://localhost/wmfo_db
. This should already be the case. - Run
cd server/db; ./setupDb.sh localhost
which will set up the databasewmfo_db
in Postgres. BE AWARE that this will delete thewmfo_db
database if it exists already, so be sure to only give an argument other thanlocalhost
if you REALLY know what you're doing.
- Change into the
server/
directory withcd server/
- Do
npm run dev
. If you have set everything up in the Installation section, you should be able to go tolocalhost:5000
in your browser and see an example page.