Create React App Template
This project was bootstrapped using cra-template-app, a batteries included create-react-app
template with Chakra UI & Typescript made by Tiso Alvarez Puccinelli.
Requirements
Installation
Clone this project using Git. In a terminal, navigate to the cloned project’s root folder, and run the following command:
yarn && yarn start
Enabling GitHub Actions
Once you push your project to your own GitHub repo, you need to add some configurations so all the GitHub actions here work properly. If you don’t want those, you can delete the .github/workflows
folder.
For the Code Quality analysis, enable code scanning on your repository.
For Chromatic, you need to create and account there, add your GitHub project, and add a CHROMATIC_PROJECT_TOKEN
to your project secrets, as instructed here.
For Vercel deploy with E2E testing, you need to add VERCEL_ORG_ID
, VERCEL_PROJECT_ID
and VERCEL_TOKEN
to your project secrets.
-
You can get both
VERCEL_ORG_ID
,VERCEL_PROJECT_ID
by linking your project with your vercel account using thevercel
CLI command, and checking the file created at.vercel/project.json
in your project. Further action instructions here. -
The
VERCEL_TOKEN
one can be generated on your Vercel token page, make sure to create a unique one.
Commands
yarn build-storybook
: Creates a production build from the component library docsyarn build
: Creates a production build from this projectyarn check
: Runs type and spell checking, code linter and unit testsyarn coverage
: Runs unit tests and opens a code coverage report onhttp://127.0.0.1:8080/
yarn start
: Starts the project with hot reload athttp://localhost:3000
yarn generate-theme-typings
: Generates TypeScript typings for your custom Chakra theme (runs automatically on post-install)yarn lint
: Runs the code linteryarn spellcheck
: Checks for spelling typos in codeyarn start
: Starts the project athttp://localhost:3000
, but you need to execute theyarn build
command beforehandyarn storybook
: Starts the component library docs with hot reload athttp://localhost:6006
yarn test-e2e
: Runs all end to end tests using the locally installed Firefox browser, but you need to have started the project in another terminal for it to workyarn test
: Runs all unit tests and code coverage reportyarn type-check
: Check validity of all types in the project
Technologies
This template uses:
- Create React App framework
- TypeScript type checking
- Chakra UI as the default component library
- Redux Toolkit for state management
- Jest and React Testing Library for unit tests
- TestCafé for End-to-End tests
- Chromatic for visual regression testing
- GitHub Actions and Vercel for CI/CD pipelines
- Storybook for component documentation
- ESLint and Prettier for code style standardization
- Yarn for caching project dependencies
- CSpell for code spell checking
Support
Liked this project and want to show your support? Buy me a coffee: