This application is a boilerplate for complex and large systems, especially those that need to scale with security and code quality.
We sought to achieve 3 pillars: readability, reusability, and refactorability.
In the construction of the UI, the Atomic Design structure was chosen, organizing the global components into atoms, molecules, organisms and templates.
In addition to being constantly updated, this project was configured in the smallest details to serve as a basis for professional projects that require standardized and easy-to-maintain code architecture and design.
- Technologies
- Features
- Prerequisites
- How to install and run the project
- Clone Repository
- Install Dependencies
- Start Development Environment
- Generate Production Build
- Generate Development Build
- Start Production Environment
- Run Tests
- Run Tests in Watch Mode
- Launch Storybook in Development Mode
- Generate Storybook Production Build
- Run Lints
- Format code with prettier
- Check for Available Updates for Dependencies
- Generate Semantic Releases
- Important Considerations
- Author
β React.js
π₯ TypeScript
π Styled-Components
π© Lints: Husky, ESlint, Commitlint, Lint-Staged, Prettier, EditorConfig and Typecheck
πΈ Semantic Release
β Jest
π React Testing Library
π Storybook
π§ Webpack
-
Responsive design;
-
Atomic Design;
-
Accessible for mouseless navigation and screen readers;
-
Custom hook for:
- set page title dynamically;
-
Theme created with styled-components without using a provider and no need to access theme properties with arrow functions;
-
100% coverage in tests including: components, templates, pages and hooks;
-
Detection prefers-reduced-motion;
-
node (latest version lts)
-
yarn
git clone https://github.com/everton-dgn/boilerplate_webpack.git
yarn
yarn dev
Available in http://localhost:3000
yarn build:prod
yarn build:dev
Available in http://localhost:3000
yarn test
yarn test:w
yarn test:ci
yarn storybook
Available in http://localhost:6006
yarn build-storybook
yarn lint
yarn typecheck
yarn check:format
yarn format
yarn check:update
-
The husky is configured to not allow commit if there are any lint and typescript errors. The push can only be done if all tests and builds (of the project and the storybook) pass.
-
Due to husky's build check settings, to push with git, the development server must be stopped first or an error will occur in the
git push
command. -
Some conventions widely used in the React ecosystem were used. For example:
-
In the root of the components folder, an export index was created to facilitate the use of components with named import. In this way, to use a component, just import it as an object and use it with the prefix "C", thus avoiding several unnecessary lines of imports:
import * as C from 'ui/components' ... <C.Card> <C.Input /> </C.Card> ...
-
To import style sheets that use styled-components, named imports were used for the same reason as before, thus:
import * as S from './styles' ... <S.Wrapper> <S.Title /> </S.Wrapper> ...
-
-
To create a complete component folder with tests, storybook, index and styles files, just use the command in the terminal:
yarn generate
π LinkedIn: https://www.linkedin.com/in/everton-toffanetto
π YouTube: https://www.youtube.com/c/ProgramadordeSucesso
π Site: https://programadordesucesso.com