Corpointa uses TanStack Router with its file-based routing convention: every file insideDocumentation Index
Fetch the complete documentation index at: https://mintlify.com/EricMartinez758/corpointa-frontend/llms.txt
Use this file to discover all available pages before exploring further.
src/routes/ automatically becomes a route, and the router plugin generates a fully type-safe routeTree.gen.ts at build time. This means route paths, search parameters, and navigation calls are all validated by TypeScript with zero manual type maintenance. The Vite plugin also enables automatic code-splitting so each route is only loaded when the user navigates to it.
Route Tree
Folders wrapped in parentheses —
(auth) and (errors) — are pathless layout groups. They let you share layouts or file organisation without adding segments to the URL.The createFileRoute Pattern
Every route file exports a single Route constant created by createFileRoute. The string argument is the route path and is validated against the generated route tree at compile time.
Root Layout (__root.tsx)
The root route is created with createRootRouteWithContext so the QueryClient instance is available to every route via context. It renders the navigation progress bar, the global <Toaster>, and developer tools (Router devtools and React Query devtools) in development mode only.
Protected Layout (_authenticated/route.tsx)
The _authenticated prefix marks this as a pathless layout route — it matches all child routes but adds no URL segment. Its beforeLoad hook enforces authentication before any child component is allowed to render:
AuthenticatedLayout renders the AppSidebar, the SessionWarning dialog, and a <SidebarInset> that hosts the active page via <Outlet />.
Layout Wrappers (route.tsx files)
Nested route.tsx files act as layout wrappers for all sibling and child routes in the same directory. For example, _authenticated/entradas/route.tsx can wrap the receipts section in a feature-specific context provider or apply a shared loader without affecting the URL.
Lazy Routes (.lazy.tsx)
Routes with the .lazy.tsx suffix are explicitly lazy-loaded in addition to the automatic code-splitting applied to all routes. The router defers downloading and executing the component bundle until the user first navigates to that URL:
Search Parameter Synchronisation
Table state — pagination page, page size, global text filter, and per-column filters — is synchronised bidirectionally with URL search parameters via theuseTableUrlState hook from src/hooks/use-table-url-state.ts.
- Bookmark any filtered or paginated table view.
- Share a link that restores exact table state for a colleague.
- Use the browser back/forward buttons to step through filter changes.
Automatic Code Splitting
The TanStack Router plugin invite.config.ts handles code splitting with zero configuration:
autoCodeSplitting: true, every route file becomes its own async chunk in the production bundle. The router pre-fetches route chunks on intent (hover or pointer-down) so most navigations feel instantaneous:
defaultPreload: 'intent'
When a user hovers over or presses down on a
<Link>, the router begins prefetching that route’s JavaScript chunk and running its loader function — so the page is often ready before the click completes.defaultPreloadStaleTime: 0
Prefetched loader data expires immediately, so navigating to a prefetched route always re-runs its loader to guarantee fresh data rather than serving a stale cached result.