Got it running perfectly at as of April 2021 ourbigbook.com with the following steps.
Initial setup for a Heroku project called To finish things off, you must now:
ourbigbook
:sudo snap install --classic heroku
heroku login
heroku git:remote -a ourbigbook
git remote rename heroku prod
# Automatically sets DATABASE_URL.
heroku addons:create -a ourbigbook heroku-postgresql:hobby-dev
# We need this to be able to require("ourbigbook")
heroku config:set -a ourbigbook SECRET="$(tr -dc A-Za-z0-9 </dev/urandom | head -c 256)"
# Password of users generated with ./web/bin/generate-demo-data
heroku config:set -a ourbigbook OURBIGBOOK_DEMO_USER_PASSWORD="$(tr -dc A-Za-z0-9 </dev/urandom | head -c 20)"
# You can get it later to login with the demo users from the Heroku web interface
- setup OurBigBook Web email sending, e.g. with OurBigBook Web email sending with Sendgrid. We haven't found a free method integrated with Heroku currently, so using this separate Sendgrid setup initially.
- setup reCAPTCHA: OurBigBook Web reCAPTCHA setup
Additionally, you also need to setup the PostgreSQL test database for both OurBigBook CLI and OurBigBook Web as documented at Section "OurBigBook Web PostgreSQL setup":
web/bin/pg-setup ourbigbook-cli
Then deploy with:
cd web
npm run deploy-prod
Get an interactive shell on the production server:From there you could then for example update the demo data with:This should in theory not affect any real user data, only the demo articles and users, so it might be safe. In theory!
./heroku run bash
cd web
bin/generate-demo-data.js --force-production
Alternatively, we could do this at once with;
./heroku run web/bin/generate-demo-data.js --force-production
Drop into a PostgreSQL shell on production:Of course, any writes could mean loss of user data!
./heroku psql
Run a query directly from your terminal:
./heroku psql -c 'SELECT username,email FROM "User" ORDER BY "createdAt" DESC LIMIT 50'
If some spurious bugs crashes the server, you might want to restart it with:
./heroku restart