Reducks Starter is a highly opinionated React/Redux boilerplate based on the re-ducks approach. Live example here.
The primary goal of Reducks Starter is to be a boilerplate I myself like to use while also giving lots of examples to be easily adoptable for others.
After evaluating other boilerplates and starter projects, I didn't find any that I would be happy to use as the foundation for my own projects. I really like the ducks approach by erikras. The re-ducks extension by alexnm makes it even better. I also like to have my Redux store to be based on Immutable.js records. Not many boilerplates have these features and as most of them are multiple versions out of the date, it's difficult to add them in. So, clearly there is room for yet another boilerplate, right?
While this boilerplate is easy way to start a new project quickly without messing around with packages and configs, it might be too much for some projects. Every project might not need everything included in Reducks Starter. You might prefer styled-components over CSS Modules. Someone might think Immutable.js is unnecessary and only adds to the weight. Sometimes removing stuff can take more time than just starting from the beginning, so you should consider your options before using any boilerplate.
Like stated before, this is boilerplate with the features and structure I like the best. Creating your own boilerplate is lot of fun and really good learning experience so I highly encourage you to start from a blank page, if you have the time.
- React v16 with React Router v5
- Redux v5 with Immutable.js v4 based store tree, side effects with redux-thunk
- Re-ducks inspired modules
- Custom REST API middleware
- CSS Modules with Sass
- Tests with Jest and Enzyme
- Next generation JavaScript with Babel v7
- Bundling with Webpack v4
- Formatting and linting with Prettier, ESLint and Stylelint
- Storybook, Redux DevTools and Webpack DevServer with hot module replacement (HMR) for pleasant developer experience
- CI/CD configs for GitHub Actions, CircleCI and Travis CI
- Examples for everything included!
src
βββ components
β βββ App
β β βββ Header
β β β βββ Navigation
β β β β βββ Navigation.jsx
β β β β βββ Navigation.scss
β β β β βββ Navigation.stories.jsx
β β β β βββ Navigation.test.jsx
β β β β βββ index.js
β β β βββ Header.jsx
β β β βββ Header.stories.jsx
β β β βββ Header.test.jsx
β β β βββ index.js
β β βββ App.jsx
β β βββ App.scss
β β βββ App.stories.jsx
β β βββ App.test.jsx
β β βββ index.js
β βββ Common
β β βββ Button
β β βββ Button.jsx
β β βββ Button.scss
β β βββ Button.stories.jsx
β β βββ Button.test.jsx
β β βββ index.js
β βββ Pages
β βββ CounterPage
β β βββ CounterPage.jsx
β β βββ CounterPage.scss
β β βββ CounterPage.stories.jsx
β β βββ CounterPage.test.jsx
β β βββ index.js
β βββ HomePage
β β βββ HomePage.jsx
β β βββ HomePage.scss
β β βββ HomePage.stories.jsx
β β βββ HomePage.test.jsx
β β βββ index.js
β βββ RepositoryPage
β βββ RepositoryList
β β βββ RepositoryList.jsx
β β βββ RepositoryList.scss
β β βββ RepositoryList.stories.jsx
β β βββ RepositoryList.test.jsx
β β βββ index.js
β βββ RepositoryPage.jsx
β βββ RepositoryPage.stories.jsx
β βββ RepositoryPage.test.jsx
β βββ index.js
βββ state
β βββ apis
β β βββ github
β β βββ index.js
β β βββ mocks.js
β β βββ requests.js
β β βββ transformers.js
β βββ middleware
β β βββ rest.js
β βββ modules
β β βββ counter
β β β βββ actions.js
β β β βββ index.js
β β β βββ records.js
β β β βββ reducers.js
β β β βββ selectors.js
β β β βββ test.js
β β β βββ thunks.js
β β β βββ types.js
β β βββ repositories
β β βββ actions.js
β β βββ index.js
β β βββ records.js
β β βββ reducers.js
β β βββ selectors.js
β β βββ test.js
β β βββ types.js
β βββ utils
β β βββ actions.js
β βββ history.js
β βββ store.js
βββ styles
β βββ breakpoints.scss
β βββ colors.scss
β βββ globals.scss
β βββ index.scss
β βββ mixins.scss
βββ index.html
βββ index.jsx
βββ setupTests.js
Clone this repository and edit package.json
to make it your own.
$ git clone https://github.com/jtiala/reducks-starter.git <my-project-name>
$ cd <my-project-name>
Install dependencies
$ npm install
Build for production
$ npm run build
Run development server
$ npm run start
Run tests
$ npm run test
Or run tests automatically every time a file changes
$ npm run test:watch
Generate test coverage report
$ npm run test:coverage
Run linters. For more linting scripts, take a look at package.json
.
$ npm run lint
Build and start Storybook
$ npm run storybook
- Initial release π
While this project's main focus is to be my idea of a perfect boilerplate, I'm also happy to hear your ideas! If you would like to contribute to Reducks Starter, please discuss the changes you want to make in the project's issues first!
This project is open source software licensed under the MIT license. For more information see LICENSE.