Skip to content

This project is a complete React.js boilerplate, constantly updated, configured in the smallest details to serve as the basis for large professional projects that intend to scale.

License

Notifications You must be signed in to change notification settings

everton-dgn/boilerplate_webpack

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

GitHub Vercel GitHub repo size GitHub Repo stars GitHub Repo stars Vulnerabilities semantic-release: angular

Boilerplate Complete and updated with React.js, Webpack, Typescript, Styled-Components and Tests


πŸ“ About the Project

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.



πŸ“Œ Contents



🌐 Technologies

βš› React.js

πŸ”₯ TypeScript

πŸ’… Styled-Components

🚩 Lints: Husky, ESlint, Commitlint, Lint-Staged, Prettier, EditorConfig and Typecheck

🌸 Semantic Release

βœ… Jest

πŸ™ React Testing Library

πŸ“ Storybook

πŸ”§ Webpack



🚩 Features

  • 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;



βœ… Prerequisites

  • node (latest version lts)

  • yarn



❓ How to install and run the project

Clone Repository

git clone https://github.com/everton-dgn/boilerplate_webpack.git

Install Dependencies

yarn

Start Development Environment

yarn dev

Available in http://localhost:3000

Generate Production Build

yarn build:prod

Generate Development Build

yarn build:dev

Available in http://localhost:3000

Run Tests

yarn test

Run Tests in Watch Mode

yarn test:w

Run Tests CI

yarn test:ci

Launch Storybook in Development Mode

yarn storybook

Available in http://localhost:6006

Generate Storybook Production Build

yarn build-storybook

Run Lints

yarn lint
yarn typecheck
yarn check:format

Format code with prettier

yarn format

Check for Available Updates for Dependencies

yarn check:update


🚨 Important Considerations

  • 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


πŸ§‘β€πŸ’» Author

By Γ‰verton Toffanetto.

πŸ”— LinkedIn: https://www.linkedin.com/in/everton-toffanetto

πŸ”— YouTube: https://www.youtube.com/c/ProgramadordeSucesso

πŸ”— Site: https://programadordesucesso.com