
Table of contents
How to install
You can use this project like template.
To do this, you need press button "Use this template".
Or clone repository and go to the project folder.
git clone https://github.com/awibox/react-redux-app-template.git ProjectName
cd ProjectName
Then you should install required dependencies.
yarn install
Getting started
To launch project you need to execute following command:
yarn start
Open in browser: http://localhost:8888
You can change the port in the webpack.config.js
ESlint
For code checking we use ESLint with airbnb configuration.
To run linter you need to execute command:
yarn lint
If you need to launch automatic mistakes fixing you need to execute following command:
yarn fix
Jest tests
Jest with Enzyme is used for testing.
yarn test
Setup pre-commit
You can set up git hook (pre-commit). In this case linter will be launched for necessary files before commit.
yarn setup
Project structure
react-redux-app-template/
|
βββpublic/ // Directory for the build
| βββicons // Icons for the manifest.json and favicon
| βββfavicon.ico
| βββmanifest.json // The web app manifest is a simple JSON file
| // that tells the browser about your web application
| // and how it should behave when 'installed'
| // on the user's mobile device or desktop.
|
βββspec/ // Directory with setup files for jest
| βββ...
|
βββsrc/
| βββactions // Redux actions
β β βββ[name]Actions.js
β β βββ...
β β βββtypes.js // Redux action type constants
β β
| βββcomponents // Components that are reused
β β βββ[Name]
β β β βββ[Name].js
β β β βββ[Name].test.js // Jest test
β β β βββ[Name].test.js.snap // Jest snapshot
β β β βββ[Name].scss // Components style
β β βββ...
β β
| βββpages // Components that use redux connect (Containers)
β β βββ[Name]
β β β βββ[Name].js
β β β βββ[Name].test.js // Jest test
β β β βββ[Name].test.js.snap // Jest snapshot
β β β βββ*[Name].scss // Container styles (optional)
β β βββ...
β β
| βββreducers // Reducers
β β βββ[name]Reducer.js
β β βββ[name]Reducer.test.js // Jest test
β β βββ...
β β βββindex.js // combineReducers
β β
| βββselectors // reselect
β β βββ[name]Selectors.js
β β βββ...
β β
| βββstyles
β β βββ_variables.scss // SCSS variables (should be imported for use)
β β βββbuild.scss // Basic styles
β β βββcontainer.scss // Style for router.js
β β
| βββtemplates
β β βββindex.html // The template by which index.html is created in public
β β
| βββconfig.js // Constant config
| βββindex.js // App entry
| βββrouter.js // Router
| βββstore.js // createStore
|
βββwebpack.config.js // webpack config for development and production