React Template
An enterprise react template application showcasing - Testing strategies, Global state management, middleware support, a network layer, component library integration, localization, PWA support, route configuration, lazy loading, and Continuous integration & deployment.
Expert teams of digital product strategists, developers, and designers.
react-floki
Built usingGlobal state management using reduxSauce
-
Global state management using Redux Sauce
Take a look at the following files
-
Computing and getting state from the redux store using Reselect
Take a look at the following files
Implementing a Redux middleware using redux-sagas
-
Side effects using Redux Saga
Take a look at the following files
Network requests using apisauce
-
API calls using Api Sauce
Take a look at the following files
Styling using styled-components
-
Styling components using Styled Components
Take a look at the following files
Using antd as the component library
-
Reusing components from Ant design
Take a look at the following files
Localization using react-intl
-
Translations using React Intl
Take a look at the following files
Routing using react-router
-
Routing is done using React Router
Take a look at the following files
Creating and showcasing components individually and in isolation using Storybooks
-
Storybooks allows you to work on one component at a time. You can develop entire UIs without needing to start up a complex dev stack, force certain data into your database, or navigate around your application.
Take a look at the following files
Bundling your application using Webpack
-
We're using and configuring webpack to bundle our React application.
Take a look at the following files
Analyzing the bundle size using webpack-bundle-analyzer
-
The size of the bundle is analyzed using the webpack-bundle-analyzer to make sure that the bundle is lean and optimized.
Take a look at the following files
Implementing CI/CD pipelines using Github Actions
-
CI/CD using Github Actions. The CI pipeline has the following phases
- Checkout
- Install dependencies
- Lint
- Test
- Build
The CD pipeline has the following phases
- Checkout
- Install dependencies
- Build
- Deploy
Take a look at the following files
Testing using @testing-library/react
-
Testing is done using the @testing-library/react.
Take a look at the following files
Scaffolding components/containers/tests using react-floki
- Components, containers, tests and stories can be scaffolded using
For the documentation take a look at: react-floki
yarn generate
Misc
Aliasing
- @app -> app/
- @containers -> app/containers/
- @components -> app/components/
- @services -> app/services/
- @utils -> app/utils/
Take a look at the following files
Chunkify and Lazy loading
Take a look at the following files
App entry point
PWA
Take a look at the following files
Gotchas
- For github pages to work on an arbitrary route we have used some workarounds.
For production builds deployed directly on
/
you need to make the following changes- publicPath: process.env.NODE_ENV === 'production' ? '/react-template/' : '/'
should be:
publicPath: '/'
- relativePaths: process.env.NODE_ENV === 'production'
should be:
relativePaths: false,
- const history = createBrowserHistory({ basename: baseUrl });
should be:
const history = createBrowserHistory();
- publicPath: process.env.NODE_ENV === 'production' ? '/react-template/' : '/'
should be: