React GraphQL Academy website
React GraphQL has been built with Gatsby. Gatsby is a static site generator for React and is a great solution if you are building a content heavy site, you can read more about Gatsby in the official docs and you can read more about our experiences using Gatsby.
Clone this repo to your local machine and run
Make sure that you have the Gatsby CLI program installed:
npm install --global gatsby-cli
We have several scripts in place:
- To run the site, user
npm run develop
- To run the tests use
npm run testor
npm run testwfor watch mode
- To generate a code coverage report use
npm run coverage
- To run storybook to visually see the components, use
npm run storybook
There are a few other scripts in the package.json that are used for formatting via prettier and to spin up production builds of the site, please refer to the gatsby docs for further reading on the later.
We use Jest for testing. As the site is content heavy, we use snapshot tests for parts with little or no logic and write full unit and integration tests for mission critical parts such as
Our Deploy and Hosting
We use Google's firebase platform for hosting the site. There is a generous free layer and so the site does not cost anything to host. This also allows for the rapid addition of features that you need a backend for (such as contact forms etc), for which we use cloud functions. We also use the cloud storage, which is a CDN, to keep the weight of images off the server and maintain a rapid build time.