- Fork repo and push to a remote of your choice.
npm installin both top-level directory and client directory. From top-level directory,npm run start. Open browser to 127.0.0.1:3000 and there should be a welcome page. If there isn't, open an issue cuz I haven't seen that before. :P- (Optional) Update your two
package.jsonfiles (top-level and client/) with the name of your app and GitHub repo.
- If you don't have it, install PostgreSQL. If you choose another database, you're on your own here!
- Set up Homebrew to manage your background PostgreSQL processes:
brew tap homebrew/servicesthenbrew services start postgresql. - Run
createuser --superuser --password [username]. Remember both these credentials. - Run
createdb [db_name] --username=[username] --password. Then enter a password for your new DB. Keep these credentials on hand as we're going to use them in a second. - Run
psql [db_name] < node_modules/connect-pg-simple/table.sql. One of our dependencies requires a custom table and this is a short SQL script to create it. - Update
db/config/config.jsonwith the credentials you just created (i.e. key[username]to"username",[password_you_entered]to"password"and[db_name]to"database") in the"development"key. - Repeat steps 4 - 6 with the same username but instead of
[db_name]use[db_name]_testor something similar and update the"test"key instead of the"development"key. - Restart the development server and make sure you can create a user and log in/out with them (this is making sure your DB is set up correctly). Again, open an issue if you have problems here.
- Finally,
npm run testto make sure your test database is also working.
- Set up Heroku if you haven't already.
- Create your Heroku app:
heroku create [app_name].
heroku addons:create heroku-postgresql:hobby-devto provision a free, basic database from Heroku.heroku pg:psql --app [heroku_app_name] < node_modules/connect-pg-simple/table.sql.
cd client && npm run buildto build your client for production. Then add and commit the newly built files (I believe create-react-app addsbuild/to its .gitignore, so make sure to comment that out until you have a better build and deploy system) andgit push heroku master.