This is an application starting point that is fully configured with the following:
- React (v 15.6.2 - via
create-react-app
) - React Router
- Redux (with form and router)
- Express
- Node.js
- MongoDB
-
Install all dependencies from the server level
yarn install
-
Install all dependencies from the client level
cd client && yarn install
-
Use nodemon to start the express server
nodemon server.js
. This will listen for any changes to the server file and automatically update. -
Start the client server
cd client && yarn start
The client of this app was built using create-react-app. It comes complete with react router for easy page/component navigation. In order to get started, modify the routes in client/components/App.js
. A home page component has already been created as a template, as well as a 404 page.
You need to configure the database URL found in /config/index.json
. If you're using an online source like mLab, just paste the access URL in the file.
Once the application has been setup, simply create a heroku instance (heroku create
from the terminal if you've installed the Heroku CLI) and then push up the files git push heroku master
. Buildpacks are automatically enabled.
Add your Heroku URL to /client/tools/api-config.js
. This will allow the production code to use your production API.
You should now be able to access <your-app>.herokuapp.com
for the client and make requests to <your-app>.herokuapp.com/api/:your-endpoint
**NOTE: There is a slight issue with rendering GET requests as JSON in the browser. You can, however, make http requests via postman or a similar client to see responses and data.
If there are any issues or concerns, please feel free to file them on Github. I welcome all contribution efforts and pull requests!