This repo contains some boilerplate code for an application that uses Node on the back end and React on the front end.
Just get me up and running
git clone https://github.com/regexpressyourself/React-Node-Boilerplate.git cd React-Node-Boilerplate npm install cd client npm install cd .. npm start
Most of this is shamelessly ripped off from the guys over at Fullstack React.
I use the create-react-app package for the React half of it. Find more on it here
npm start from the project root will get everything up and running for you.
The backend server is more or less the same on production as on development.
The webpack server can be configured for production by running
npm run build in the ./client directory. This will compile all the front end goodness to the ./client/build folder as static assets. Host these assets from wherever, point them to your server, and you’ll be up and running!
Where’s my Webpack config?
The create-react-app package does a lot for you, but it also obfuscates a lot away from you in the process. If you want to dig in to your configs a bit more on the React side, just run
npm run eject in the ./client directory.