A ready-to-use boilerplate for React JS with Redux and Saga.
This is a basic project structure with repeatative use cases. Added some essential feature for every projects. It is very useful to build mid to complex level project. This project structure is based on NodeJs api boilerplate app: https://github.com/maitraysuthar/rest-api-nodejs-mongodb
I had tried to maintain the code structure easy as any beginner can also adopt the flow and start building a great app. Project is open for suggestions, Bug reports and pull requests.
If you consider my project as helpful stuff, You can appreciate me or my hard work and time spent to create this helpful structure with buying a coffee for me.
Feature | Details |
---|---|
Structure | Project is build with extenensible and flexible Moduler pattern |
Authentication | Basic Authentication (Register/Login) |
Confirm Account | Account confirmation with OTP verification |
Route Protection | Route protection with middleware and localstorage |
Lazy Loading | Added Lazy Loading of components to fasten the execution process of application |
App State Management | Application level state management with Redux |
Async Call | Managed async calls with Saga middleware |
Forms | Managed apllication forms & validations with Formik and Yup |
- Node.js 8+
- Clone the project from github. Change "myproject" to your project name.
git clone https://github.com/maitraysuthar/react-redux-saga-boilerplate.git ./myproject
- Download repository
- Uncompress to your desired directory
cd myproject
npm install
- You will find a file named
.env.example
on root directory of project. - Create a new file by copying and pasting the file and then renaming it to just
.env
cp .env.example .env
- The file
.env
is already ignored, so you never commit your credentials. - Change the values of the file to your environment. Helpful comments added to
.env.example
file to understand the constants.
npm start
All the modules of the project will be in /src/modules/
folder, If you need to add more modules to the project just create a new folder in the same folder.
- Component file (
index.jsx
) - Actions file (
actions.js
) - Reducer file (
reducer.js
) - Saga file (
saga.js
) - Style file (
[module].css
) - Sub module folder, if any.
Module's root module folder is /src/modules/app/
it contains main Routes file (routes.js
), Reducer file (mainReducer.js
) and Saga file (mainSaga.js
). You will need to add your every component,reducer & saga to make your module work.
Every project needs improvements, Feel free to report any bugs or improvements. Pull requests are always welcome.
This project is open-sourced software licensed under the MIT License. See the LICENSE file for more information.