Define routes once.
Navigate everywhere.
Sirou (Simple Router) is a framework-agnostic, universal routing and navigation engine for TypeScript. It provides a single source of truth for your application's architecture, ensuring type safety and consistent logic across Web, Mobile, and Server environments.
$ npm install @sirou/coreimport { defineRoutes } from "@sirou/core";
export const routes = defineRoutes({
home: { path: "/" },
dashboard: { path: "/dashboard" },
admin: {
path: "/admin/:section",
guards: [isAdmin],
},
profile: {
path: "/user/:id",
params: { id: z.uuid() },
},
});
router.go("profile", { id: user.id });Why Sirou?
Eliminate fragmented routing logic. Treat your routes as a Centralized Schema that ensures consistency across your entire stack.
Zero Runtime Typos .
TypeScript catches typos in route names and params at compile time. Get full type safety across your entire routing system.
Write Once, Run Anywhere .
One single router instance works identically across React, Next.js, Svelte, React Native, and Flutter projects.
Built-in DevTools .
Monitor navigation state, history, and metadata in real-time with an integrated visual developer console.
Integrated Data Loaders .
Fetch data before a route renders. Eliminate loading spinners and content flicker for a premium user experience.
Async Route Protection .
Multi-layer protection (Auth, RBAC) that can block or redirect users before navigation even commits.
Next.js Edge Middleware .
Run your routing guards directly on the edge for zero-latency authorization and hyper-fast redirects.
