Skip to content

RoutierReactive data for any datastore

A fast, front-end-first data toolkit with schemas, live queries, optimistic mutations, and swappable storage plugins. No lock-in, no rewrite.

Routier

What is Routier? ​

Routier is a fast, front-end-first data toolkit that augments any datastore with schemas, collections, live queries, optimistic mutations, replication, caching, and more, without locking you into a specific ORM or backend.

Modern apps inevitably build a data abstraction layer: defaults, business rules, computed fields, and adapters for whatever datastore you start with. That works until you hit performance ceilings, need local-first, or want to adopt a different storage primitive. Routier gives you a datastore-agnostic layer you control: keep your domain model and data API intact, and swap the storage plugin beneath it.

Quick Example ​

Try it live

Open the live playground to use the demo immediately, or view and edit its source in CodeSandbox.

ts
import { DataStore } from "@routier/datastore";
import { s } from "@routier/core/schema";
import { MemoryPlugin } from "@routier/memory-plugin";

const userSchema = s
  .define("users", {
    id: s.string().key().identity(),
    email: s.string().distinct(),
    name: s.string(),
    createdAt: s.date().default(() => new Date()),
  })
  .compile();

class Ctx extends DataStore {
  users = this.collection(userSchema).proxy().create();
  constructor() {
    super(new MemoryPlugin("app"));
  }
}

const ctx = new Ctx();
await ctx.users.addAsync({ name: "Ada", email: "[email protected]" });
await ctx.saveChangesAsync();

How Routier Fits Your Stack ​

  • Enhance, don't replace. Keep your existing datastore. Add structure (schemas, defaults, serialization), speed (indexes, caching), and better ergonomics (live queries, optimistic updates).
  • Swap without rewrites. Move from IndexedDB to SQLite or adopt OPFS by changing the plugin. Your app code remains unchanged.
  • Type checking by choice. Use Zod or AJV for validation. Routier handles transformation and persistence.
  • Client-first, backend-capable. Routier is designed for the browser and local-first workflows, while remaining adaptable to backend runtimes.

Next Steps ​

I want to…Start here
Install and build my first appInstallation β†’ Quick Start
Decide whether Routier fitsWhy Routier?
Understand the core ideasConcepts
Use Routier with ReactReact Integration
Explore real patternsGuides

Released under the MIT License.