Generates route trees from a pages directory for Vite apps, with type-safe navigation, layouts, modals, and data loaders for React Router and Solid Router.
Overview
Generouted brings Next.js-style file-based routing to Vite-powered client applications. It scans files under src/pages via Vite's glob import API, builds a routes tree, and wires conventions for nested layouts, dynamic segments, pathless layout groups, and global modals.
Integrations ship for React Router and Solid Router, with optional lazy-loading entry points, Vite plugins for type generation, and experimental TanStack React Router support. Conventions cover index routes, catch-all dynamics, ignored paths prefixed with underscores, optional route segments, and page exports for loaders, actions, pending UI, and error boundaries.
Developers add pages by creating files that map to URLs—for example an index file for the home route—and can explore patterns in an online StackBlitz playground. Type-safe hooks and utilities such as useNavigate, useParams, and useModals come from generated router types when using the plugin packages.
The design draws ideas from Next.js, Remix, Expo, Docusaurus, and SvelteKit while staying focused on client-side SPAs. Custom integrations can use lower-level core packages if the default Router component is not sufficient.
Key features
- Vite glob-based route generation
- Type-safe navigation and modals
- Nested and pathless layouts
- Route code-splitting and lazy loading
- Data loaders and route actions
- Dynamic and optional URL segments
- React Router and Solid Router packages
- Vite plugin for generated types
Use cases
- Vite React apps with filesystem routes
- Solid SPA projects using file routing
- Prototyping routing conventions in StackBlitz
- SPAs needing typed modal routes
- Migrating from manual React Router setup