- @testing-library/jest-dom
- @testing-library/react
- @testing-library/user-event
- axios
- jwtdecode
- lodash
- prop-types
- react-cookie
- react-hook-form
- react-redux
- react-router-dom
- redux
- redux-saga
- eslint
- eslint-config-airbnb
- eslint-config-prettier
- eslint-plugin-import
- eslint-plugin-jsx-a11y
- eslint-plugin-prettier
- eslint-plugin-react
- eslint-plugin-react-hooks
- http-proxy-middleware
- prettier
src
|
├── assets
│ ├── file11.png
│ └── file12.png
├── components
│ ├── your-component.js
│ └── index.js
├── constants
│ ├── your-constant.js
│ └── index.js
├── hooks
│ ├── your-hooks.js
│ └── index.js
├── layout
│ ├── your-layout.js
│ └── index.js
├── pages
│ ├── your-page.js
│ └── index.js
├── redux
│ auth
│ | ├── action.js
│ | └── reducer.js
| | ├── saga.js
| | └── type.js
│ ├── actions.js
| ├── index.js
| ├── reducers.js
| └── sagas.js
|
├── routes
│ ├── private.js
│ └── index.js
├── styles
│ base
│ | ├── _app.css
│ | └── _home.css
│ abstract
| |
| components
| |
| utilities
| |
| index.css
|
├── theme
│ └── colors.js
| ├── index.js
|
|
├── utils
│ ├── auth.js
│ └── request.js
| ├── index.js
|
└── App.js
└── App.test.js
└── index.js
└── logo.svg
└── reportWebVitals.js
└── setupProxy.js
└── setupTests.js
|
.env
|
.eslintrc.json
|
.gitignore
|
.prettierrc
|
package.json
|
README.md
|
yarn.lock
- first, clone this repository
$ git clone https://github.com/usamahbass/my-reactapp-setup.git your-app
$ cd your-app
$ yarn install
- open your-app in your IDE and add .env file with contents like this and put in your api.
REACT_APP_API_URL=your api here
- go to file setupProxy.js, and by default like this
const { createProxyMiddleware } = require('http-proxy-middleware');
module.exports = function (app) {
app.use(
'/v1', // your version or front yout path api , empty if not available
createProxyMiddleware({
target: process.env.REACT_APP_API_URL, // your env name
changeOrigin: true,
}),
);
};
You can rename env with the name env and version with your version.