This project was bootstrapped with Create React App.
- Typescript
- React.js, Create React App
- React Router, React Hook Form, Yup, React-i18next
- MUI - Material UI, Styled Components
- Redux, Redux Toolkit , Redux Saga, Redux First History , Redux Logger , Redux Saga Test Plan
- Mock Service Worker, Jest, React Testing Library , Cypress
- StoryBook
- ESLint, Prettier, Husky , Commitlint , Standard Version , Lint-staged, Pretty Quick
./src βββ assets # assets folder contains all the static files (images, fonts, etc). βββ components # shared components βββ config # global configuration, env variables etc. βΒ Β βββ Env.ts βΒ Β βββ i18n βββ features βΒ Β βββ feature # 'feature' βΒ Β βΒ Β βββ api # API folder contains http service calls βΒ Β βΒ Β βββ assets # 'feature' assets folder βΒ Β βΒ Β βββ components # 'feature' components βΒ Β βΒ Β βββ hooks # 'feature' hooks βΒ Β βΒ Β βββ index.ts # entry point for 'feature' public API βΒ Β βΒ Β βββ store # 'feature' state stores contains slices, sagas, etc. βΒ Β βΒ Β βββ types # 'feature' typescript types βΒ Β βββ another_feature # 'another_feature' βββ hooks # shared hooks βββ libs # libraries imported or exported that can be used in different projects βΒ Β βββ ui βββ pages # contains all application pages βββ routes # routes configuration βββ store # root store and store settings βββ App.tsx # Application entrypointInstall NPM packages:
yarn installTo start the application in the development mode run:
yarn startπ Note: Application starts in sandbox-mode, with all backend calls mocked by MSW library. To disable it change REACT_APP_MSW_ENABLED variable to false.
π‘ Tip: Open http://localhost:3000 to view application in the browser.
To build the application for production, run:
yarn buildLaunch the test runner in the interactive watch mode:
yarn testSee the section about running tests for more information.
Run yarn coverage to generate code coverage.
To run e2e use below command:
yarn build yarn test:e2eπ Note: This script will start the server, wait until application is running, execute e2e tests and after that it will shut down the server.
π‘ Tip: To run Cypress in interactive mode, start the application and run
yarn cy:open
Start Storybook in development mode:
yarn storybookTo build Storybook as static web application, run the following command inside project's root directory:
yarn build-storybookπ‘ Tip: run
npx http-server ./storybook-staticto preview static web application locally.
Running the script yarn format will format the code style of all TypeScript files.
The script yarn lint will run linter in the project. If any code standards or styles are not met in code, it will display the errors or warnings.
Run yarn lint:fix command to format code and fix automatically any error found - if the linter knows how to fix itπ.
π‘ Tip: To enforce code conventions and prevent bad commits this project is setup to use Husky. Husky is used to run validation and format code before every commit. Additionally, it will check if git message is following conventional commits format.
Absolute imports should always be configured and used because it makes it easier to move files around and avoid messy import paths such as ../../../Component. Wherever you move the file, all the imports will remain intact.
To enable Absoulte imports in Intelij ide go to Settings -> Editor -> Code Style -> TypeScript -> Imports and enable Use paths relative to tsconfig.json.
Create release version and generate a changelog file:
yarn releaseπ Note: use
yarn release:first-releaseif this is the first release.
π‘ Tip:
yarn release:dry-run- allows you to see what commands would be run, without committing to git or updating files.
- React Developer Tools
- Redux DevTools
- Testing Playground
- Window Resizer
- React Hook Form - form builder
- i18next-scanner