- Download and setup the project directory
git clone https://github.com/RxNT/ES6-React-Redux-Seed.git your-project-name
- Setup your project as git repo
cd your-project-name
npm run init-setup
git init
git add .
git commit-m 'initial commit'
git remote add origin <url>
git push origin <branch_name>
- Install yarn dependencies run
yarn install
- Start the site in development mode
yarn Start
- WebPack configuration changes, make following changes in webpack.config.env_name.js file at root of the project directory
- Replace ApiServiceUrl value with url for API service to connect
- Change HostedIP value to actual url where the app will be hosted, this information will be used for logging purpose
-
Create new directory named
search-students
undersrc\components
with below files Most of the code insidesearch-students
will be similar to that ofsearch-master
- Add new component
search-students.component.js
.- Create class SearchStudentsComponent and render appropriate components. Use search-master as reference to create the table.
- Inside mapStateToProps add the following
data: store.searchStudentsReducer.data, loading: store.searchStudentsReducer.loading,
- Inside mapDispatchToProps the first argument to bindActionCreators will be the actions we imported for this file
actions: bindActionCreators(studentIndexActions, dispatch)
- Export SearchStudentsComponent appropriately
- Add new styles
search-students.component.scss
- Identify list of actions you want to perform in this page, and define action types in
constants.js
- To begin, you can refer the actions in
search-master/constants.js
. - You can add more constants if needed.
- To begin, you can refer the actions in
- Define state in
initial.state.js
. Initial state is the same as insearch-master/initial.state.js
- Define actions like fetching data from APIs in
actions.js
action.js
will also look much similar to the action creator insearch-master
- The following can be used for api get request:
apiProxy.get(appConstants.appInfo.apiServer + appConstants.apiRoutes.searchStudentsRoute)
- Navigate to src/appConstants and add
searchStudentsRoute: '/students?_sort=id&_order=desc',
at the bottom of apiRoutes
- Define reducer methods to update state in
reducer.js
. Reducers change the application state.- Make appropriate change to the application state as required
- Add new component
-
Create new folder named as
search-students
undersrc\containers
- Add new container component
search-students.container.js
and render the component created instep-1
.
- Add new container component
-
Import reducer created under step (1) in
src\store\reducers.js
and add in to combineReducers -
Configure route under
src\containers\app.js
with container component created understep-2
after importingSearchStudentsContainerComponent
. Add<Route exact path="/students" component={SearchStudentsContainerComponent} />
to the list of routes -
Finally, navigate to
src/uicomponents/menu/topnav-component.js
. Configure the anchor tag on the second li ofnav
div to point to #/students<a href="#/students" tabIndex="-1">
and rename Menu2 to Students -
The list should be empty as we haven't added anything yet. Next lets add a form that lets us add students
-
Create new folder named as
add-students
undersrc\components
with below files Most of the code insideadd-students
will be similar to that ofadd-master
- Add new component
add-students.component.js
- UIComponents should be imported from
/ES6-React-Redux-Seed/src/uicomponents/
- Create class AddStudentsComponent and render a redux form containing name and email field.
- Rename
addMasterReducer
inside mapStateToProps toaddStudentReducer
too. The reducer will be created later. - Replace the constants
form: types.COMPONENTS_ADD_MASTER_FORM
toform: types.COMPONENTS_ADD_STUDENTS_FORM
- Inside function saveInfo replace the last line to
this.props.history.push('/students');
- UIComponents should be imported from
- Add new styles
search-students.component.scss
- Identify list of actions you want to perform in this page, and define action types in
constants.js
- To begin, you can refer the actions in
search-master/constants.js
. - You can add more constants if needed.
- To begin, you can refer the actions in
- Define state in
initial.state.js
. Initial state is the same as inadd-master/initial.state.js
- Define actions like fetching data from APIs in
actions.js
action.js
will also look much similar to the action creator inadd-master
- Change the constants to refer to the constants in
add-students
directory - The post command should to save the formValues should be ```apiProxy.post(appConstants.appInfo.apiServer
- appConstants.apiRoutes.searchStudentsRoute, formValues)``` where form value is supplied to the function that saves the data to the server
- Define reducer methods to update state in
reducer.js
. Reducers change the application state.- Make appropriate change to the application state as required
- Add new component
-
Create new directory
add-students
undersrc\containers
- Add new container component
add-students.container.js
and render the component created instep-1
. Import AddStudentsComponent from'../../components/add-students/add-students.component'
- Add new container component
-
Import reducer created under step (1) in
src\store\reducers.js
and add in to combineReducers. (Add ‘addStudentsReducer’ to combineReducers.) -
Configure route under
src\containers\app.js
with container component created understep-2
after importingAddStudentsContainerComponent
. Add<Route exact path="/new/students" component={AddStudentsContainerComponent} />
to the list of routes -
Navigate to
src/containers/search-students.components.js
and rename the Link destination to“/new/students”
<Link to="/new/students”>
-
Navigate to tests/db.json and add
"students": [ ], before “masters”
-
Prepare build for
Production Release
$yarn run prod-release-build-package
-
Prepare build for
ProdQA
$yarn run prodqa-build-package
-
Prepare build for
DevQA
$yarn run devqa-build-package
-
Start website in development environment
$yarn run start
-
Get lint issues
$yarn run lint
-
Get outdated packages information
`$yarn run getoutdatedpackages`