Skip to content
This repository has been archived by the owner on May 17, 2022. It is now read-only.

Fork this to easily spin up a Node-&-React-based service (e.g., on x.internal.patreon.com)

License

Notifications You must be signed in to change notification settings

Patreon/service-starter-kit-react

Repository files navigation

Service Starter Kit: Node & React Edition

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.

Development

  1. make sure node and npm are installed
  2. npm install
  3. make sure postgres is installed
  4. rename the db in db-init.sql and .env (find/replace my_react_starter_kit)
  5. psql postgres < db-init.sql >/dev/null
  6. ./migrate_local.sh

Now you can start developing!

  1. npm run dev
  2. 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)

Deployment

Patreon Cluster

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)

Heroku

  1. Create heroku app, add heroku remote, etc.
  2. Add Postgres and Redis services to your Heroku app
  3. Set the following heroku config vars
    1. PG_USER: (user from heroku pg settings)
    2. PG_PASS: (password from heroku pg settings)
    3. NPM_CONFIG_PRODUCTION: false
    4. NODE_PATH: ./src
    5. NODE_ENV: production
    6. DATABASE_URL: (should already be set)
    7. REDIS_URL: (should already be set)
  4. Update src/config.js to have the proper production.api.host (where it currently says "your-url.herokuapp.com")
  5. ./migrate_remote.sh

About

Fork this to easily spin up a Node-&-React-based service (e.g., on x.internal.patreon.com)

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages