Fork this repo to easily make a node-and-react-based service that can be hosted on #{my-service}.internal.patreon.com
Forked from 21echoes's fork of erikras's starter kit. 21echoes's fork adds JSON-API support, db integration (incl. easy migrations) and easy heroku deploys.
- make sure node and npm are installed
npm install
- make sure postgres is installed
- rename the db in
db-init.sql
and.env
(find/replacemy_react_starter_kit
) psql postgres < db-init.sql >/dev/null
./migrate_local.sh
Now you can start developing!
npm run dev
- visit
localhost:3000
As you change code, the server will auto-reboot and/or auto-hot-reload (swaps out React components without needing a browser refresh)
WIP! Copy these changes, but customize to your service: https://github.com/Patreon/ansible/commit/f10b16e5cc62e3b0fad08582b3f2ce0c338b3128 (gonna need a fair amount of work, as this PR is for a python-based service)
- Create heroku app, add heroku remote, etc.
- Add Postgres and Redis services to your Heroku app
- Set the following heroku config vars
- PG_USER: (user from heroku pg settings)
- PG_PASS: (password from heroku pg settings)
- NPM_CONFIG_PRODUCTION: false
- NODE_PATH: ./src
- NODE_ENV: production
- DATABASE_URL: (should already be set)
- REDIS_URL: (should already be set)
- Update
src/config.js
to have the properproduction.api.host
(where it currently says "your-url.herokuapp.com") ./migrate_remote.sh