Backend App
Resource:
- Using Postman with GraphQL https://learning.postman.com/docs/sending-requests/graphql/graphql-http/
- Deploy with Heroku and MongoDB Atlas https://coding-boot-camp.github.io/full-stack/mongodb/deploy-with-heroku-and-mongodb-atlas
- Sample projects, see
food-frontend
andfood-backend
repos here:https://github.com/orgs/Chicago-2020/repositories
- Push code to heroku
git push heroku main
- Seed db by accessing heroku’s terminal
heroku run bash
then run the seed command - To test, use a POST request in Postman with the new backend heroku url +
/graphql
Frontend App
- Add a buildpack to the frontend app on Heroku. Settings -> Add buildpack -> paste this in:
https://github.com/mars/create-react-app-buildpack
- In the frontend app run
npm run build
. This will create a build directory. - Where ever you have set the value of the httpLink, (maybe the App.js), make the
uri
dynamic based on if we’re in a development or production. You need YOUR backend URL that you'll have after deploying the backend to Heroku.
App structure