Modern, feature rich React boilerplate. Skip the redundant setup of React projects, testing frameworks, and CI/CD workflows. Start building your app right away!
βββ .github/ # GitHub Actions workflows
βββ .husky/ # Git hooks configuration
βββ config/ # Configuration files
β βββ jest/ # Jest configuration
β βββ webpack/ # Webpack configuration
β βββ babel.config.js # Babel configuration
βββ e2e/ # End-to-end tests
β βββ pages/ # Page Object Model (POM) files
β βββ tests/ # E2E test files
βββ src/ # Source code
β βββ components/ # Reusable components
β β βββ __tests__/ # Unit tests for components
β βββ config/ # Environment and app configuration
β βββ hooks/ # Custom React hooks
β βββ pages/ # Page components
β βββ router/ # Routing setup
β βββ store/ # Redux store and state management
β βββ utils/ # Utility functions
β βββ entry.tsx # Entry point for the app
β βββ index.html # HTML template
β βββ styles.css # Global styles (Tailwind)
βββ types/ # TypeScript type declarations
βββ .gitignore # Files to ignore in Git
βββ .lintstagedrc.json # Linting configuration for staged files
βββ .prettierignore # Prettier ignore file
βββ .prettierrc.cjs # Prettier configuration
βββ commitlint.config.ts # Commit message linting
βββ eslint.config.mjs # ESLint configuration
βββ jest.config.js # Jest configuration
βββ netlify.toml # Netlify deployment configuration
βββ package-lock.json # Locked dependencies
βββ package.json # Project metadata and dependencies
βββ playwright.config.ts # Playwright E2E testing configuration
βββ postcss.config.js # PostCSS configuration
βββ README.md # Project documentation
βββ tailwind.config.js # Tailwind CSS configuration
βββ tsconfig.json # TypeScript configuration
βββ tsconfig.paths.json # TypeScript paths configuration
Ensure that you have the following versions installed:
Start by cloning the repository to your local machine:
git clone https://github.com/Borislav99/react-webpack-ts-boilerplate.git
cd react-webpack-ts-boiler-plate
Install the required dependencies:
npm install
Playwright requires certain browsers for end-to-end testing. Install them by running:
npx playwright install
Start the development server to view the app in your browser:
npm start
Build the app for production:
npm run build
Run the unit tests with the following command:
npm run test
Run the end-to-end tests using Playwright:
npm run e2e
This project is integrated with GitHub Actions to automate testing and deployment.
Push to master
or Pull Request:
Whenever thereβs a push to the master
branch or a pull request is created, the following tasks are triggered:
Manual PR-Link Workflow:
You can manually trigger the pr-link
workflow to create a preview link for testing a pull request. This is helpful
for reviewing changes before merging.
Push Tags:
When a new tag is pushed, the Release Workflow is triggered, which automatically deploys a new version of the app
to Netlify.
To enable the pr-link and release workflows, you need to add the following secrets to your GitHub repositoryβs Secrets and Variables under Actions:
These secrets are necessary for the workflows to function correctly and automatically deploy to Netlify.
With this setup, your projectβs deployment process is streamlined, and testing is automated, ensuring smooth and efficient development!
Ready to make this boilerplate your own? π₯ Feel free to tweak and extend it to suit your projectβs needs. Youβll find the core configuration files for Webpack, Tailwind CSS, and TypeScript in the root directory, so you can easily modify them to match your preferences. Whether you're building a complex app or a simple project, this template is flexible enough to grow with you. π
Contributions to this project are appreciated β€οΈ! If you have ideas for improvements, new features, or if you find a bug, please open an issue or submit a pull request. Your contributions help make this project even better for the community. π
Hereβs how you can get involved:
This project is licensed under the MIT License β feel free to use, modify, and distribute it.
Happy coding! π