Powerful Schemas
Defaults, identity keys, indexes, computed properties, transforms, and property mapping. Bring your own validation with Zod or AJV.
Schema guide
A fast, front-end-first data toolkit with schemas, live queries, optimistic mutations, and swappable storage plugins. No lock-in, no rewrite.
npm install @routier/core @routier/datastore @routier/memory-pluginLive demo
useQuery call sorts, pages, and subscribes, so the page stays current with no cache to invalidate and no refetch to wire up. Try restocking a row, turning on traffic, or switching frameworks: both read the same store. import { useState } from "react";import { useQuery } from "@routier/react";import { store, type Product } from "./inventory";export function ProductGrid() { const [page, setPage] = useState(1); const [pageSize, setPageSize] = useState(6); const rows = useQuery<Product[]>( onResult => store.products .sort(p => p.name) .skip((page - 1) * pageSize) .take(pageSize) .subscribe() .toArray(onResult), [page, pageSize], );What you get
Swappable storage
import { MemoryPlugin } from "@routier/memory-plugin";class InventoryStore extends DataStore { products = this.collection(productSchema).proxy().create(); constructor() { super(new MemoryPlugin("inventory")); }}Why Routier
Keep your existing datastore. Add structure with schemas and defaults, speed with indexes and caching, and better ergonomics with live queries and optimistic updates.
Move from IndexedDB to SQLite or adopt OPFS by changing the plugin. Your app code remains unchanged.
Use Zod or AJV for validation. Routier handles transformation and persistence.
Designed for the browser and local-first workflows, while remaining adaptable to backend runtimes.
Next steps
Install the packages, define a schema, and run your first live query.
Quick StartRun and edit real examples in your browser.
PlaygroundSee where Routier helps and where it does not.
Why Routier?Schemas, collections, queries, and change tracking.
ConceptsHooks that keep components in sync with your data.
React integrationLocal-first apps, syncing, history tracking, and more.
Guidesnpm install @routier/core @routier/datastore @routier/memory-plugin