Set React App
Author: Shubham Sarda / @shubham_ul
Overview
Set React App is a lightweight, opinionated setup for building modern React applications. Inspired by Create React App, it leverages Vite for blazing-fast bundling, hot module replacement, and a streamlined developer experience. This template provides common tooling and sensible defaults to get you up and running quickly.
Features
- Vite-Powered: Enjoy fast bundling, instant dev server start, and on-demand file serving.
- Latest React & React DOM: Includes React and React DOM 19.x for modern React development.
- Testing: Pre-configured with React Testing Library and Jest DOM with Vitest for unit and integration tests.
- Simple Scripts: A minimal set of npm scripts for development, production builds, previews, and tests.
- Web Vitals: Measures performance for React apps, integrated out of the box.
Requirements
Use Node.js 22.22.2 or later in the 22.x line, 24.15.0 or later in the 24.x line, or Node.js 26 or newer.
Steps to Use (Similar to Create React App)
Install Globally (Optional)
npm install -g set-react-appThis allows using the
set-react-appcommand system-wide.Create a New Project
npx set-react-app project-name # or if you installed globally: set-react-app project-nameMove into the Newly Created Directory
cd project-nameStart the Development Server
npm startThis will start the Vite dev server on http://localhost:3000 by default.
Available Scripts
Once inside your project directory, you can run:
npm run startornpm run dev
Runs the app in development mode using Vite on port 3000.npm run build
Builds the app for production to thedistfolder. It bundles React in production mode, optimizes builds for the best performance, and is ready for deployment.npm run preview
Serves the production build from thedistfolder locally. Helpful for verifying your production build before deploying.npm testRuns the test suite once with Vitest.
Project Structure
.
├── public # Public assets that are directly served
├── src # Main source code for the application
│ ├── App.jsx # Root App component
│ ├── index.jsx # Entry point for React application
│ └── ... # Other components and files
├── tests # Test files (if separated from src)
├── package.json
├── vite.config.js # Vite configuration
└── ...
Feel free to modify this structure based on your project’s needs.
Dependencies
"dependencies": {
"react": "^19.3.1",
"react-dom": "^19.3.1",
"web-vitals": "^6.2.3"
},
"devDependencies": {
"@testing-library/dom": "^10.4.2",
"@testing-library/jest-dom": "^8.0.0",
"@testing-library/react": "^16.3.3",
"@testing-library/user-event": "^14.6.13",
"@vitejs/plugin-react": "^6.3.0",
"jsdom": "^31.0.1",
"vite": "^8.3.8",
"vitest": "^5.1.1"
}
Contributing
Contributions, suggestions, and feedback are welcome!
- Fork the repository
- Create a new branch (
git checkout -b feature/some-new-feature) - Commit changes (
git commit -m 'Add some feature') - Push to the branch (
git push origin feature/some-new-feature) - Open a Pull Request
License
This project is free to use and distributed under the MIT License. See the LICENSE file for more details.
Connect with Me
Author: Shubham Sarda / @shubham_ul
If you find this project helpful or have any questions, feel free to reach out on LinkedIn/Twitter!
Happy Coding!