Skip to content
This repository has been archived by the owner on Sep 1, 2020. It is now read-only.

benyap/react-boilerplate-typescript-apollo

 
 

Repository files navigation

React Boilerplate: Apollo & Typescript

Created by Max Stoiber, forked and maintained by Ben Yap.

An opinionated fork of react-boilerplate made for the GraphQL stack, written in Typescript.

This fork was created to extend the great work done by the guys at React-Boilerplate to provide an opinionated set up with one of the most popular stacks out there: the GraphQL stack.

Currently up to date with React-Boilerplate v3.7.0.

New in react-boilerplate-typescript-apollo

Todo

  • Add Storybook stories to example app
  • Add documentation for new changes in react-boilerplate-typescript-apollo

Features

Quick scaffolding
Create components, containers, routes, selectors and sagas - and their tests - right from the CLI!
Instant feedback
Enjoy the best DX (Developer eXperience) and code your app at the speed of thought! Your saved changes to the CSS and JS are reflected instantaneously without refreshing the page. Preserve application state even when you update something in the underlying code!
Predictable state management
Unidirectional data flow allows for change logging and time travel debugging.
Next generation JavaScript
Use template strings, object destructuring, arrow functions, JSX syntax and more.
Next generation CSS
Write composable CSS that's co-located with your components for complete modularity. Unique generated class names keep the specificity low while eliminating style clashes. Ship only the styles that are on the page for the best performance.
Industry-standard routing
It's natural to want to add pages (e.g. `/about`) to your application, and routing makes this possible.
Industry-standard i18n internationalization support
Scalable apps need to support multiple languages, easily add and support multiple languages with `react-intl`.
Offline-first
The next frontier in performant web apps: availability without a network connection from the instant your users load the app.
Static code analysis
Focus on writing new features without worrying about formatting or code quality. With the right editor setup, your code will automatically be formatted and linted as you work.
SEO
We support SEO (document head tags management) for search engines that support indexing of JavaScript content. (eg. Google)

But wait... there's more!

  • The best test setup: Automatically guarantee code quality and non-breaking changes. (Seen a react app with 100% test coverage before?)
  • Native web app: Your app's new home? The home screen of your users' phones.
  • The fastest fonts: Say goodbye to vacant text.
  • Stay fast: Profile your app's performance from the comfort of your command line!
  • Catch problems: AppVeyor and TravisCI setups included by default, so your tests get run automatically on Windows and Unix.

There’s also a fantastic video on how to structure your React.js apps with scalability in mind. It provides rationale for the majority of boilerplate's design decisions.

Keywords: React.js, Redux, Hot Reloading, ESNext, react-router, Offline First, ServiceWorker, styled-components, redux-saga, FontFaceObserver

Quick start

  1. Make sure that you have Node.js v8.10 and npm v5 or above installed.
  2. Clone this repo using git clone --depth=1 https://github.com/bwyap/react-boilerplate-typescript-apollo.git <YOUR_PROJECT_NAME>
  3. Move to the appropriate directory: cd <YOUR_PROJECT_NAME>.
  4. Run yarn setup in order to install dependencies and clean the git repo.
    At this point you can run yarn start to see the example app at http://localhost:3000.
  5. Run yarn clean to delete the example app.

Now you're ready to rumble!

Storybook

  1. To start Storybook, run yarn storybook.
  2. This will start the Storybook app on https://localhost:9001.

Please note that this boilerplate is production-ready and not meant for beginners! If you're just starting out with react or redux, please refer to https://github.com/petehunt/react-howto instead. If you want a solid, battle-tested base to build your next product upon and have some experience with react, this is the perfect start for you.

Documentation

Supporters

Please see the original repository for supporters: react-boilerplate.

License

This project is licensed under the MIT license, Copyright (c) Ben Yap. For more information see LICENSE.md.

Packages

 
 
 

Languages

  • TypeScript 73.0%
  • JavaScript 20.2%
  • HTML 6.8%