https://github.com/everton-dgn/boilerplate_rspack
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.
https://github.com/everton-dgn/boilerplate_rspack
react react-testing-library rspack storybook styled-components typescript vite vitejs vitest
Last synced: 7 months ago
JSON representation
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.
- Host: GitHub
- URL: https://github.com/everton-dgn/boilerplate_rspack
- Owner: everton-dgn
- License: mit
- Created: 2023-04-09T14:41:33.000Z (over 2 years ago)
- Default Branch: main
- Last Pushed: 2023-09-27T06:31:24.000Z (about 2 years ago)
- Last Synced: 2023-09-27T08:40:51.378Z (about 2 years ago)
- Topics: react, react-testing-library, rspack, storybook, styled-components, typescript, vite, vitejs, vitest
- Language: TypeScript
- Homepage: https://boilerplate-rspack.querocriarsite.com
- Size: 2.08 MB
- Stars: 7
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README






Boilerplate Complete and updated with React.js, Rspack, Typescript, Styled-Components and Tests
# :memo: 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.
---
# :pushpin: Contents
- [Technologies](#globe_with_meridians-technologies)
- [Features](#triangular_flag_on_post-features)
- [Prerequisites](#white_check_mark-prerequisites)
- [How to install and run the project](#question-how-to-install-and-run-the-project)
- [Clone Repository](#clone-repository)
- [Install Dependencies](#install-dependencies)
- [Start Development Environment](#start-development-environment)
- [Generate Production Build](#generate-production-build)
- [Generate Development Build](#generate-development-build)
- [Start Production Environment](#start-production-environment)
- [Run Tests](#run-tests)
- [Run Tests in Watch Mode](#run-tests-in-watch-mode)
- [Launch Storybook in Development Mode](#launch-storybook-in-development-mode)
- [Generate Storybook Production Build](#generate-storybook-production-build)
- [Run Lints](#run-lints)
- [Format code with prettier](#format-code-with-prettier)
- [Check for Available Updates for Dependencies](#check-for-available-updates-for-dependencies)
- [Generate Semantic Releases](#generate-semantic-releases)
- [Important Considerations](#rotating_light-important-considerations)
- [Author](#technologist-author)
---
# :globe_with_meridians: Technologies
β React.js
π₯ TypeScript
π Styled-Components
π© Lints: Husky, ESlint, Commitlint, Lint-Staged, Prettier, EditorConfig and Typecheck
πΈ Semantic Release
β Vitest
π React Testing Library
π Storybook
π§ Rspack
---
# :triangular_flag_on_post: Features
- [x] Responsive design;
- [x] Atomic Design;
- [x] Accessible for mouseless navigation and screen readers;
- [x] Custom hook for:
- [x] set page title dynamically;
- [x] Theme created with styled-components without using a provider and no need to access theme properties with arrow functions;
- [x] 100% coverage in tests including: components, templates, pages and hooks;
- [x] Detection prefers-reduced-motion;
---
# :white_check_mark: Prerequisites
- node (latest version lts)
- yarn
---
# :question: How to install and run the project
## Clone Repository
```bash
git clone https://github.com/everton-dgn/boilerplate_rspack.git
```## Install Dependencies
```bash
yarn
```## Start Development Environment
```bash
yarn dev
```Available in http://localhost:3000
## Generate Production Build
```bash
yarn build:prod
```## Generate Development Build
```bash
yarn build:dev
```Available in http://localhost:3000
## Run Tests
```bash
yarn test
```## Run Tests in Watch Mode
```bash
yarn test:w
```## Run Tests CI
```bash
yarn test:ci
```## Launch Storybook in Development Mode
```bash
yarn storybook
```Available in http://localhost:6006
## Generate Storybook Production Build
```bash
yarn build-storybook
```## Run Lints
```bash
yarn lint
``````bash
yarn typecheck
``````bash
yarn check:format
```## Format code with prettier
```bash
yarn format
```## Check for Available Updates for Dependencies
```bash
yarn check:update
```
---
# :rotating_light: 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:
```jsx
import * as C from 'ui/components'...
...
```- To import style sheets that use styled-components, named imports were used for the same reason as before, thus:
```jsx
import * as S from './styles'...
...
```- To create a complete component folder with tests, storybook, index and styles files, just use the command in the terminal: `yarn generate`
---
# :technologist: Author
By [Γverton Toffanetto](https://programadordesucesso.com).
:link: LinkedIn: https://www.linkedin.com/in/everton-toffanetto
:link: YouTube: https://www.youtube.com/c/ProgramadordeSucesso
:link: Site: https://programadordesucesso.com