A production-ready React scaffold for desktop web: React 19, Rematch, React Router 7, TypeScript and webpack 5 — with mocking, request middleware and monitoring already wired up.
Changelog · Contributing · 中文文档
Stack: React · Redux · React Router · Rematch · webpack · TypeScript · Mock.js · ESLint · Prettier · fetch
Node >= 20, and pnpm.
pnpm install # install
pnpm start # dev server on http://localhost:5591
pnpm start:size # dev server, with the bundle analyzer
pnpm start:mock # dev server, with Mock.js intercepting requests
pnpm build # production build, output in release/
pnpm lint # eslint
pnpm typecheck # tsc --noEmit
pnpm test # vitest
pnpm format # prettier --write- Current React — use classes or hooks freely; Redux for state and React Router for routing.
- Rematch as the Redux layer, which removes most of the boilerplate.
- webpack 5, with separate dev / test / staging / production environments and hot reloading.
- Bundle analysis on demand in both dev and production, so an oversized dependency does not reach production unnoticed.
- Cache-aware asset splitting — rarely-changing vendor code is emitted as a fixed
cached.bundle.js, everything else is content-hashed and injected into the HTML automatically. - ESLint 9 (flat config) + Prettier for a single code style across projects.
- Pre-commit enforcement through husky and lint-staged: unformatted or failing code cannot be committed.
- Mock.js for local API mocking, intercepting requests in dev mode without touching the source.
- TypeScript in strict mode, so more mistakes surface at compile time.
- fetch as the HTTP layer, with per-environment configuration.
- Worked examples of routing, components, sync and async actions, reducers, request handling and shared helpers — start from them rather than from an empty folder.
src/
configs/ environment config, API URLs and request options
middleware/ the request middleware that wraps async actions
models/ rematch models
pages/ routed pages and components
utils/ request, storage, monitoring, shared helpers
webpack/ dev.ts and prod.ts
mock/ Mock.js definitions
tests/ vitest
See CONTRIBUTING.md.