Create-React-App + Apollo + Express boilerplate ready to be deployed to Heroku

Hi everybody,

Just wanted to share a boilerplate I’ve been working on. The idea is to have simple Create-React-App + Apollo + Express app that is ready to be deployed to Heroku (Heroku provides free hosting, that’s why I chose this service).

It took me quite a while to figure out how to put all the pieces together, so I thought it could be helpful for someone trying to get started with Apollo.

Here is the repo of the project: https://github.com/fede-rodes/crae-apollo-heroku

And here is the app: https://crae-apollo-heroku.herokuapp.com/

I suggest reading the following articles (thanks!) in order to understand the boilerplate:

  1. https://originmaster.com/running-create-react-app-and-express-crae-on-heroku-c39a39fe7851
  2. https://dev-blog.apollodata.com/full-stack-react-graphql-tutorial-582ac8d24e3b
  3. https://dev-blog.apollodata.com/react-graphql-tutorial-part-2-server-99d0528c7928
  4. https://dev-blog.apollodata.com/react-graphql-tutorial-mutations-764d7ec23c15
6 Likes

Thanks for this! I have been trying to achieve this setup. You saved me time.

1 Like

Glad it helped, @martineboh :slight_smile:

Hi,

Just for those of you interested in the boilerplate, I’ve just created a new branch called ‘mongo’ that extends the code in the ‘master’ branch by adding MongoDB support using mongoose for easier collection manipulation.

Here is the link of the new branch:

Below is the link of the app deployed to heroku. The app basically displays a list of ‘authors’ stored in a MongoDB instance hosted in mLab. When the user selects one of the authors (using the input box for author’s name or surname) the list of posts associated to said author is be displayed:
https://crae-apollo-mongo-heroku.herokuapp.com/

Next step is to add authentication using passport.js

Cheers