To install all dependencies, (e.g. after cloning it from a Git repository) run
npm install
To install Homebrew & PostgreSQL, run
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install.sh)"
brew install postgresql
brew install postgis
After installing PostgreSQL, something similar to the following should be shown:
To have launchd start postgresql now and restart at login:
brew services start postgresql
Or, if you don't want/need a background service you can just run:
pg_ctl -D /usr/local/var/postgres start
You may need to create a symbolic link from the script that actually allows Postgres to run to the LaunchAgents directory and tell launchctl
to load it:
ln -sfv /usr/local/opt/postgresql/*.plist ~/Library/LaunchAgents
launchctl load ~/Library/LaunchAgents/homebrew.mxcl.postgresql.plist
If upgrading from a previous version of PostgreSQL, you might need to run the following:
rm -rf /usr/local/var/postgres
initdb /usr/local/var/postgres -E utf8
After running that command, something similar to the following should be shown:
You can now start the database server using:
pg_ctl -D /usr/local/var/postgres -l logfile start
Install Python 2.
You will want to start by installing sequelize globally:
npm install -g sequelize
To create the lbh3
database:
createdb lbh3
To enable PostGIS in the database:
psql lbh3
CREATE EXTENSION postgis;
To import a dump:
pg_restore --verbose --clean --no-acl --no-owner -h localhost -U user -d lbh3 latest.dump
To create a new migration:
DATABASE_URL="" sequelize migration:create --name="migration-name"
As you’re developing, you might want to migrate down and then back up, which you can do with the following:
npm run sequelize:migrate:rerun
To just migrate the database up:
npm run sequelize:migrate
To just migrate the database down:
npm run sequelize:migrate:undo
Development mode can be started with
npm run start:development
In Unix environment, the production application can be started like this:
npm run start:production
aws-sdk is used by the backend to communicate with S3.
The website is hosted on Heroku.
Headshots, PDF Snoozes, and other files are stored on Amazon S3.