create-react-frontend
v0.1.0
Published
CLI generator for production-ready React frontends with Vite or Next.js, plus opinionated defaults.
Maintainers
Readme
create-react-frontend
CLI generator for production-ready React frontends. One command, choose your stack:
- React + Vite (SPA)
- React + Next.js (App Router, SSR)
Both stacks come with sensible defaults already wired up:
- TypeScript
- Tailwind CSS (optional)
- Prettier +
prettier-plugin-tailwindcss axiosAPI client atsrc/lib/api.ts(optional)cn()helper atsrc/lib/utils.ts(with Tailwind)- Husky + lint-staged (optional)
- Folder structure:
src/components,src/hooks,src/lib,src/types .editorconfig,.nvmrc,.env.example
Usage
Quick mode (defaults: Tailwind, axios, Husky, git all enabled):
npm create react-frontend@latest
# or
pnpm create react-frontendYou'll only be asked for:
- Project name
- Stack (Vite or Next.js)
Custom mode (choose every option individually):
npm create react-frontend@latest custom
# or
pnpm create react-frontend customAsks for project name, stack, plus Tailwind, axios, Husky, git init.
How it works
The CLI delegates the base scaffold to the official tools (create-vite and create-next-app) and then layers shared + stack-specific overlays on top. This keeps the templates small and means you always get an up-to-date base.
Local development
cd generator
pnpm install
pnpm run createPublishing
pnpm run build
npm publish