Skip to content

mobx, react-router v4, material-ui bootstrapped with create react app with a node backend

License

Notifications You must be signed in to change notification settings

caseychoiniere/mobx-cra-node

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

This app runs a node server API and a React client on Heroku

Design Points

A combo of two npm projects, the backend server and the frontend UI. So there are two package.json configs.

  1. package.json for Node server & Heroku deploy
    • heroku-postbuild script compiles the webpack bundle during deploy
    • cacheDirectories includes react-ui/node_modules/ to optimize build time
  2. react-ui/package.json for React web UI

Deploy to Heroku

git clone
cd /
heroku create
git push heroku master

This deployment will automatically:

  • detect Node buildpack
  • build the app with
    • npm install for the Node server
    • heroku-postbuild for create-react-app
  • launch the web process with npm start
    • serves ../react-ui/build/ as static files

👓 More about deploying to Heroku.

Local Development

Run the API Server

In a terminal:

# Initial setup
npm install

# Start the server
npm start

Run the React UI

The React UI is configured to proxy backend requests to the local Node server. (See "proxy" config)

In a separate terminal from the API server, start the UI:

# Always change directory, first
cd react-ui/

# Initial setup
npm install

# Start the server
npm start

About

mobx, react-router v4, material-ui bootstrapped with create react app with a node backend

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 3

  •  
  •  
  •