{"id":16473804,"url":"https://github.com/saisilinus/react-redux-typescript-boilerplate","last_synced_at":"2025-07-15T07:33:25.329Z","repository":{"id":39919160,"uuid":"483565702","full_name":"saisilinus/react-redux-typescript-boilerplate","owner":"saisilinus","description":"A react redux typescript for building production ready react apps","archived":false,"fork":false,"pushed_at":"2024-03-25T07:55:03.000Z","size":2027,"stargazers_count":12,"open_issues_count":2,"forks_count":8,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-04-08T10:11:18.488Z","etag":null,"topics":["bootstrap","jest","react","redux","redux-toolkit","redux-toolkit-query","rtk-query","sass","typescript"],"latest_commit_sha":null,"homepage":"","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/saisilinus.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2022-04-20T08:14:19.000Z","updated_at":"2024-08-18T21:00:41.000Z","dependencies_parsed_at":"2025-02-12T16:35:01.080Z","dependency_job_id":"776e00b6-73dd-4df2-b819-2f59ca45ecc3","html_url":"https://github.com/saisilinus/react-redux-typescript-boilerplate","commit_stats":null,"previous_names":[],"tags_count":0,"template":true,"template_full_name":null,"purl":"pkg:github/saisilinus/react-redux-typescript-boilerplate","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/saisilinus%2Freact-redux-typescript-boilerplate","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/saisilinus%2Freact-redux-typescript-boilerplate/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/saisilinus%2Freact-redux-typescript-boilerplate/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/saisilinus%2Freact-redux-typescript-boilerplate/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/saisilinus","download_url":"https://codeload.github.com/saisilinus/react-redux-typescript-boilerplate/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/saisilinus%2Freact-redux-typescript-boilerplate/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":265418257,"owners_count":23761783,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["bootstrap","jest","react","redux","redux-toolkit","redux-toolkit-query","rtk-query","sass","typescript"],"created_at":"2024-10-11T12:28:17.297Z","updated_at":"2025-07-15T07:33:25.302Z","avatar_url":"https://github.com/saisilinus.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# React Redux Typescript Template\n\n[![CI/CD](https://github.com/saisilinus/react-redux-typescript-boilerplate/actions/workflows/ci.js.yml/badge.svg)](https://github.com/saisilinus/react-redux-typescript-boilerplate/actions/workflows/ci.js.yml)\n[![codecov](https://codecov.io/gh/saisilinus/react-redux-typescript-boilerplate/branch/master/graph/badge.svg?token=W45JDTDV54)](https://codecov.io/gh/saisilinus/react-redux-typescript-boilerplate)\n\nThis project was bootstrapped with [Create React App](https://github.com/facebook/create-react-app), using the [Redux](https://redux.js.org/) and [Redux Toolkit](https://redux-toolkit.js.org/) template.\n\nThis app pairs well with this [node-js express template](https://github.com/saisilinus/node-express-mongoose-typescript-boilerplate)\n\n## Table of Contents\n\n- [Available Scripts](#available-scripts)\n- [Learn More](#learn-more)\n- [Features](#features)\n- [Environment Variables](#environment-variables)\n- [Folder Structure](#folder-structure)\n- [Authentication](#authentication)\n    - [Require Auth](#require-auth)\n- [User Management](#user-management)\n- [Pagination](#pagination)\n- [Animation](#animation)\n- [Linting](#linting)\n- [License](#license)\n\n## Available Scripts\n\nIn the project directory, you can run:\n\n### `yarn start`\n\nRuns the app in the development mode.\u003cbr /\u003e\nOpen [http://localhost:3000](http://localhost:3000) to view it in the browser.\n\nThe page will reload if you make edits.\u003cbr /\u003e\nYou will also see any lint errors in the console.\n\n### `yarn test`\n\nLaunches the test runner in the interactive watch mode.\u003cbr /\u003e\nSee the section about [running tests](https://facebook.github.io/create-react-app/docs/running-tests) for more information.\n\n### `yarn build`\n\nBuilds the app for production to the `build` folder.\u003cbr /\u003e\nIt correctly bundles React in production mode and optimizes the build for the best performance.\n\nThe build is minified and the filenames include the hashes.\u003cbr /\u003e\nYour app is ready to be deployed!\n\nSee the section about [deployment](https://facebook.github.io/create-react-app/docs/deployment) for more information.\n\n### `yarn eject`\n\n**Note: this is a one-way operation. Once you `eject`, you can’t go back!**\n\nIf you aren’t satisfied with the build tool and configuration choices, you can `eject` at any time. This command will remove the single build dependency from your project.\n\nInstead, it will copy all the configuration files and the transitive dependencies (webpack, Babel, ESLint, etc) right into your project so you have full control over them. All of the commands except `eject` will still work, but they will point to the copied scripts so you can tweak them. At this point you’re on your own.\n\nYou don’t have to ever use `eject`. The curated feature set is suitable for small and middle deployments, and you shouldn’t feel obligated to use this feature. However we understand that this tool wouldn’t be useful if you couldn’t customize it when you are ready for it.\n\n## Learn More\n\nYou can learn more in the [Create React App documentation](https://facebook.github.io/create-react-app/docs/getting-started).\n\nTo learn React, check out the [React documentation](https://reactjs.org/).\n\n## Features\n\n- **Static Typing**: [TypeScript](https://www.typescriptlang.org/) static typing using typescript\n- **Testing**: unit and integration tests using [Jest](https://jestjs.io)\n- **State Management**: [Redux Toolkit](https://redux-toolkit.js.org/) state management with redux using redux toolkit\n- **Cache Handling**: [RTK Query](https://redux-toolkit.js.org/rtk-query/overview) Cache management using rtk query\n- **Notifications**: [react-toastify](https://github.com/fkhadra/react-toastify) awesome toast notifications with react-toastify\n- **Styling**: [React Bootstrap](https://react-bootstrap.github.io/) style with bootstrap components via React Bootstrap\n- **SASS**: [SASS](https://sass-lang.com/) style more with SASS\n- **Animations**: [React Transition Group](https://reactcommunity.org/react-transition-group/) animate using an Animate component created using elements from React Transition Group\n- **Pagination**: [React Bootstrap Pagination](https://react-bootstrap.github.io/components/pagination/) paginate with custom component built on React Bootstrap's Pagination\n- **Error handling**: [RTK Query Error Handling](https://redux-toolkit.js.org/rtk-query/usage/error-handling) centralized error handling mechanism for fetch requests using rtk query middleware\n- **CI**: continuous integration with [GitHub CI](https://travis-ci.org)\n- **Code coverage**: using [codecov](https://about.codecov.io/)\n- **Git hooks**: with [husky](https://github.com/typicode/husky) and [lint-staged](https://github.com/okonet/lint-staged)\n- **Linting**: with [ESLint](https://eslint.org) and [Prettier](https://prettier.io)\n- **Changelog Generation**: with [Standard Version](https://github.com/conventional-changelog/standard-version)\n- **Structured Commit Messages**: with [Commitizen](https://github.com/commitizen/cz-cli)\n- **Commit Linting**: with [CommitLint](https://github.com/conventional-changelog/commitlint)\n\n## Environment Variables\nCreate your environment variables by copying the `.env.example` file i.e.\n\n```bash\ncp .env.example .env.local\n```\n\n## Folder Structure\n\n```\nsrc\n├── app                             # Redux configuration\n│   ├── api.ts                          # base redux API\n│   ├── hooks.ts                        # redux hooks\n│   ├── middleware.ts                   # redux middleware\n│   └── store.ts                        # redux store\n├── assets                          # assets\n│   └── img\n├── custom.d.ts                     # extended custom types\n├── index.tsx                       # app entry\n├── __mocks__                       # test utils and mocks\n│   ├── data.ts\n│   ├── server.ts\n│   └── utils.tsx\n├── modules                         # app modules including pages, components and APIs\n│   ├── auth                            # pages, components, tests, and redux API for auth\n│   ├── common                          # common components and tests. includes Routing\n│   ├── dashboard                       # dashboard pages, components, and tests\n│   ├── pages                           # pages\n│   └── users                           # pages, components, tests, and redux API for users\n├── react-app-env.d.ts\n├── serviceWorker.ts\n├── setupTests.ts\n├── styles                          # styling\n│   ├── components                      # component styling e.g. loader\n│   ├── _components.scss                # imports\n│   ├── custom.scss                     # root styling file\n│   ├── layout                          # layout components\n│   ├── _layouts.scss                   # imports\n│   ├── mixins                          # mixins\n│   ├── _mixins.scss                    # imports\n│   ├── utilities                       # utilities like transform styles\n│   ├── _utilities.scss                 # imports\n│   └── _variables.scss                 # custom variables\n```\n\n## Authentication\n\nAuthentication has already been done for you with the redux-toolkit query API setup. The app was created with APIs from this [node-template](https://github.com/saisilinus/node-express-mongoose-typescript-boilerplate) in mind. \n\nPages included in the app include: \n- Login\n- Register\n- Forgot Password\n- Reset Password\n- Verify Email\n\n\u003cimg src=\"src/assets/img/screenshots/login.png\" alt=\"login form\" title=\"Login\" /\u003e\n\n## User Management\n\nLike authentication, user management has already been done for you using rtk query.\n\n\u003cimg src=\"src/assets/img/screenshots/users-list.png\" alt=\"user list\" title=\"Users\" /\u003e\n\n### Require Auth\n\nWrapper for pages that require authentication. Just wrap the route element with RequireAuth and only logged in users with permissions will have access.\n\n```javascript\nimport { Routes, Route } from 'react-router-dom';\nimport RequireAuth from './RequireAuth';\nimport { DashboardHome, Profile } from '../../dashboard';\nimport restrictions from './restrictions';\nimport routes from './routes';\n\nconst MainRouter = () =\u003e {\n    return (\n        \u003cRoutes\u003e\n            \u003cRoute path={routes.Dashboard.absolutePath}\u003e\n                {/* dashboard will be restricted to all logged in users */}\n                \u003cRoute index element={\u003cRequireAuth element={\u003cDashboardHome /\u003e} restrictedTo={restrictions.none} /\u003e} /\u003e\n                {/* profile will be restricted to logged in admin users */}\n                \u003cRoute\n                    path={routes.Profile.relativePath}\n                    element={\u003cRequireAuth element={\u003cProfile /\u003e} restrictedTo={restrictions.admin} /\u003e}\n                /\u003e\n            \u003c/Route\u003e\n        \u003c/Routes\u003e\n    );\n}\n\n```\n\nAs an added bonus: all the navigation items in the dashboard sidebar are also authenticated before being displayed. Define nav items with restrictions e.g.\n\n```javascript\n{/* They are automatically restricted to all logged in users*/}\n\u003cNavItem\n    title=\"List\"\n    link={routes.UserList.absolutePath}\n    pathname={location.pathname}\n    icon={faList}\n    restrictedTo={restrictions.admin}\n/\u003e\n```\n\n## Pagination\n\nPagination is done using custom logic built on top of [React Bootstrap's Pagination component](https://react-bootstrap.github.io/components/pagination/).\n\nJust wrap your component like so\n\n```javascript\nimport React, { useState } from 'react';\n\nconst [currentPage, setCurrentPage] = useState\u003cnumber\u003e(1);\n\nconst data = fetchSomeData({ page: currentPage });\n\nconst onPageClick = (page: number) =\u003e {\n    setCurrentPage(page);\n};\n\n\u003cPaginate currentPage={currentPage} onPageClick={onPageClick} totalPages={data.totalPages}\u003e\n    {data.map((item) =\u003e (\n        \u003ch1 key={item.id}\u003e{item.name}\u003c/h1\u003e\n    ))}\n\u003c/Paginate\u003e\n```\n\n## Animation\nAnimate your component using custom css styles and a component built using [React Transition Group](https://reactcommunity.org/react-transition-group/). Animating is as easy as:\n\n```javascript\nimport Animate from 'blob/components/Animate';\n\nconst customComponent = () =\u003e {\n    return (\n        \u003c\u003e\n            \u003cAnimate\u003e\n                \u003ch1\u003eThis text will animate\u003c/h1\u003e\n            \u003c/Animate\u003e\n        \u003c/\u003e\n    );\n};\n```\n\nYou can change animation behavior by defining css classes and adding them to the Animate component\n\n## Linting\n\nLinting is done using [ESLint](https://eslint.org/) and [Prettier](https://prettier.io).\n\nIn this app, ESLint is configured to follow the [Airbnb JavaScript style guide](https://github.com/airbnb/javascript/tree/master/packages/eslint-config-airbnb-base) with some modifications. It also extends [eslint-config-prettier](https://github.com/prettier/eslint-config-prettier) to turn off all rules that are unnecessary or might conflict with Prettier.\n\nTo modify the ESLint configuration, update the `.eslintrc.json` file. To modify the Prettier configuration, update the prettier configuration in `package.json`.\n\nTo prevent a certain file or directory from being linted, add it to `.prettierignore`.\n\n## License\n\n[MIT](LICENSE)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsaisilinus%2Freact-redux-typescript-boilerplate","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsaisilinus%2Freact-redux-typescript-boilerplate","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsaisilinus%2Freact-redux-typescript-boilerplate/lists"}