/react-apollo-graphql

JavaScript meets web. React in tandem with Apollo. Minimal implementation that will help you get started with GraphQL.

Primary LanguageTypeScript

Actions Status Test Coverage Maintainability Dependabot Mergify Status

React Apollo GraphQL [from scratch]

Today you have basically two ways how to start new React application: NextJs or Create React App.

However, there is no fun in using other peoples frameworks so I created this application from scratch. If you ever wondered how to set up your own boilerplate. This is a good place to start.

Deploy

Demo

You can try the application here (it might take a while before the free server wakes up)

📘 Backend API is running here. You can find the source code of the backend application here.

Development

System Dependencies:

  1. brew install node
  2. brew install yarn

Run development server:

  1. yarn install
  2. yarn apollo:generate-types:watch
  3. yarn watch

Useful Commands

  • yarn lint:ts lint TS files
  • yarn lint:css lint CSS
  • yarn lint:circular-dependencies detect circular dependencies
  • yarn apollo:generate-types generate TS definitions from GraphQL schema
  • yarn apollo:remove-all-types remove all automatically generated TS definitions
  • yarn test run jest
  • docker-compose up run the application in Docker 🐳 container

TODO

  • Optimize antd package with babel-plugin-import
  • Create custom vendors config with DllPlugin
  • Implement request password reset + request password change
  • Implement automatic token refresh

Production

Keep in mind that main and vendors packages are huge. I plan to implement babel-plugin-import and DllPlugin in the future.

  1. SERVER_URL=https://node-type-orm-graphql.herokuapp.com/graphql yarn build
  2. yarn prod