A CLI tool to quickly create a new Vite + React + TypeScript project with modern tooling and best practices pre-configured.
- ⚡️ Vite for blazing fast development
- ⚛️ React 19 with TypeScript
- ⚡️ React Router v7 data mode
- 🎨 Tailwind CSS for styling
- 🔧 ESLint + TypeScript ESLint for code quality
- 🎭 Shadcn UI components
- 🌗 Dark/Light mode out of the box
- 📱 Responsive layouts with modern CSS
- 🎯 Absolute imports
- 🔄 Hot Module Replacement
- 📦 Optimized production build
npx create-vite-starter-ts@latest my-app
cd my-app
npm run devYou can create a new project in two ways:
npx create-vite-starter-ts@latestThis will guide you through project creation with interactive prompts.
npx create-vite-starter-ts@latest my-appThis will create a new project in the my-app directory.
During the interactive setup, you'll be asked:
- Project location: Where to create the project (default: current directory)
- Git initialization: Whether to initialize a Git repository
- Dependencies installation: Whether to install dependencies automatically
The tool automatically detects your preferred package manager (npm, yarn, pnpm, or bun) and uses it for installation.
my-app/
├── public/
│ └── vite.svg
├── src/
│ ├── assets/
│ ├── components/
│ │ ├── providers/
│ │ ├── routes/
│ │ ├── shared/
│ │ └── ui/
│ ├── context/
│ ├── hooks/
│ ├── lib/
│ ├── App.tsx
│ └── main.tsx
├── .eslintrc.js
├── index.html
├── package.json
├── tsconfig.json
└── vite.config.ts
- Location:
src/addons/routes/ - In-depth guide: see
src/addons/routes/README.md
Route map
/
├── / (HomePage)
├── /about (AboutPage)
├── /dashboard (DashboardLayout)
│ ├── / (DashboardPage)
│ ├── /profile (ProfilePage)
│ └── /settings (SettingsPage)
├── /users
│ ├── / (UsersPage)
│ └── /:userId (UserPage, loader: userLoader)
│ └── /posts
│ ├── / (PostsPage)
│ └── /:postId (PostPage, loader: postLoader)
└── * (NotFoundPage)
Key features
- Data APIs:
createBrowserRouter+ per-routeloader/action+errorElement; mounted viaRouterProvider. - Typed loaders:
LoaderFunctionArgsfor params/request; read in components withuseLoaderData(). - Nested layouts:
MainLayout,DashboardLayout, andUserPagerender<Outlet />for children. - Fetcher usage:
useFetcher()demo on posts index to refresh data without navigation. - v7 future flags: enabled for transitions/fetchers/forms/hydration (see add-on README for the list).
Files overview
src/addons/routes/
├── index.tsx # Exposes <AppRouter />
├── router.tsx # Route tree + v7 flags
├── layouts/
│ ├── MainLayout.tsx
│ └── DashboardLayout.tsx
└── pages/
├── AboutPage.tsx
├── HomePage.tsx
├── NotFoundPage.tsx
├── dashboard/
│ ├── DashboardPage.tsx
│ ├── ProfilePage.tsx
│ └── SettingsPage.tsx
├── users/
│ ├── UsersPage.tsx
│ ├── UserPage.tsx
│ └── user.loader.ts
└── posts/
├── PostsPage.tsx
├── PostPage.tsx
├── posts.loader.ts
└── post.loader.ts
npm run dev- Start development servernpm run build- Build for productionnpm run preview- Preview production buildnpm run lint- Lint code with ESLint
- React 19
- TypeScript
- Vite
- Tailwind CSS
- Shadcn UI
- Radix UI Primitives
- Lucide Icons
- ESLint
- TypeScript ESLint
- Fork the repository
- Create your feature branch:
git checkout -b feature/amazing-feature - Commit your changes:
git commit -m 'Add amazing feature' - Push to the branch:
git push origin feature/amazing-feature - Open a Pull Request
MIT License - see the LICENSE file for details
HimanshuKumarDutt094
- GitHub: @HimanshuKumarDutt094
- Repository: vite-starter
- Run the unit tests:
```bash
npm run test
- Build the library:
npm run build