with redub-cli
# installation
$ npm i -g redub-cli
# create anew project
$ redub new testProject
# generate a new component
$ redub generate comp myNewComponent
Documentation for redub-cli click here
cd into root directory
$ npm install
run this for to copy index.html to dist and to bundle javascript and load to dist/js
$ npm run dev
run this for serving the index.html and the bundle.js on localhost:3000
$ npm run start
Simply install redux devtools extension for chrome and use all the features for debugging the application's state changes.
Devtools only work in development.
.
+-- src
| +-- config
| |
| +-- js
| | +-- actions
| | +-- components
| | +-- conainers
| | +-- reducers
| | +-- views
| | app.js
| |
| +-- scss
| |
| index.html
|
.babel.rc
.gitignore
package.json
readme.md
webpack.config.js
Inside here is the code for the complete redux application.
It holdes the following files & folders:
- config: for now it only holdes the configuration for the API routes
- js: basically is the redux application
- scss: holdes the stylesheets for the application
- index.html: is the only html file you need
Inside here all the configurations are set.
It holds the following files & folders:
- apiRoutes.js: this file configures the url-path to the api (
default
: for development)
Inside here is all the javascript code for the redux application.
It holds the following files & folders:
- actions: the complete logic of the redux application
- components: the dumb just presentational components of the application (rarely have a state)
- conainers: the intelligent conainer components (often statefull components)
- reducers: the complete statemanagement for the redux application
- views: the different views that are displayed to the user. Can consist of multiple components and/or containers
- app.js: the entrypoint for the application
This is the only html file you need for the redux application. It holds a div with an id 'root' (here will the application render) and a script with the src 'js/bundle.js' which is the webpacked js code for the redux application.