This CLI applications builds Tanstack Router applications that are the functional equivalent of Create React App.
To help accelerate the migration away from create-react-app we created the create-tsrouter-app CLI which is a plug-n-play replacement for CRA.
Instead of:
npx create-react-app my-appYou can now run:
npx create-tsrouter-app@latest my-appInstead of using:
npx create-react-app my-app --template typescriptTo create a SPA application using TypeScript. You can now run:
npx create-tsrouter-app@latest my-app --template typescriptWhat you'll get is a Vite application that uses TanStack Router. All the files will still be in the same place as in CRA, but you'll get a fully functional Router setup under in app/main.tsx.
create-tsrouter-app is everything you loved about CRA but implemented with modern tools and best practices, on top of the popular TanStack set of libraries. Which includes @tanstack/react-query and @tanstack/react-router.
If you want Tailwind then just add --tailwind and that will automatically configure Tailwind V4.
You can also specify your preferred package manager with --package-manager such as npm, bun, yarn, or pnpm.
Extensive documentation on using the TanStack Router, migrating to a File Base Routing approach, as well as integrating @tanstack/react-query and @tanstack/store be found in the generated README.md for your project.
By default create-tsrouter-app will create a Code Based Routing application. If you want to use File Based Routing then you can specify --template file-router. The location of the home page will be app/routes/index.tsx.
Check out the Contributing guide.
MIT