├── public
└── favicon.ico
├── src
├── store
│ ├── actions
│ │ ├── actionTypes.js
│ │ └── counter.js
│ ├── reducer
│ │ ├── index.js
│ │ └── counter.js
│ └── index.js
└── pages
│ ├── _app.js
│ └── index.js
├── README.md
├── package.json
├── .gitignore
└── components
└── nav.js
/public/favicon.ico:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/VladymyrPylypchatin/nextjs-redux-boilerplate/HEAD/public/favicon.ico
--------------------------------------------------------------------------------
/src/store/actions/actionTypes.js:
--------------------------------------------------------------------------------
1 | export const COUNTER_INCRIMENT = 'COUNTER_INCRIMENT'; //Will add one to counter
2 | export const COUNTER_DECRIMENT = 'COUNTER_DECRIMENT'; //Will subscruct one from counter
3 |
--------------------------------------------------------------------------------
/src/store/reducer/index.js:
--------------------------------------------------------------------------------
1 | import { combineReducers } from 'redux';
2 | import counterReducer from './counter';
3 |
4 | const rootReducer = combineReducers({
5 | counter: counterReducer,
6 | });
7 |
8 | export default rootReducer;
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 | # nextjs-redux-boilerplate
2 | An example of the Next.js Project using Redux, Redux-thunk and Redux Debuger
3 |
4 | To run the project folow the instructions
5 |
6 | `npm i`
7 |
8 | `npm run dev`
9 |
10 | Then open in the browser `http:/localhost:3000`
11 |
--------------------------------------------------------------------------------
/package.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "redux-next-app",
3 | "version": "0.1.0",
4 | "private": true,
5 | "scripts": {
6 | "dev": "next dev",
7 | "build": "next build",
8 | "start": "next start"
9 | },
10 | "dependencies": {
11 | "next": "9.2.1",
12 | "react": "16.12.0",
13 | "react-dom": "16.12.0"
14 | }
15 | }
16 |
--------------------------------------------------------------------------------
/.gitignore:
--------------------------------------------------------------------------------
1 | # See https://help.github.com/articles/ignoring-files/ for more about ignoring files.
2 |
3 | # dependencies
4 | /node_modules
5 | /.pnp
6 | .pnp.js
7 |
8 | # testing
9 | /coverage
10 |
11 | # next.js
12 | /.next/
13 | /out/
14 |
15 | # production
16 | /build
17 |
18 | # misc
19 | .DS_Store
20 | .env*
21 |
22 | # debug
23 | npm-debug.log*
24 | yarn-debug.log*
25 | yarn-error.log*
26 |
--------------------------------------------------------------------------------
/src/pages/_app.js:
--------------------------------------------------------------------------------
1 | import withRedux from 'next-redux-wrapper';
2 | import { Provider } from 'react-redux';
3 | import initStore from '../store';
4 |
5 |
6 | function MyApp({ Component, pageProps, store, ...rest }) {
7 | return (
8 |
17 | To get started, edit pages/index.js and save to reload.
18 |