Maayo (Fulfulde: "river") — offline-first sync between a local device store and any backend.
Maayo is for applications that need to work without a network connection. Local writes go into an IndexedDB outbox immediately and sync to your server whenever connectivity returns. The server side is two HTTP endpoints — implement them on any backend, any database, any language.
| Package | Version | Downloads | Description |
|---|---|---|---|
@maayo/protocol |
TypeScript types — zero runtime deps | ||
@maayo/client |
Core engine: outbox, push/pull, LWW | ||
@maayo/react |
React / Next.js hooks | ||
@maayo/angular |
Angular signals + DI | ||
@maayo/spring |
— | Spring Boot autoconfiguration |
Browser Server (any DB)
───────────────────────────────────── ─────────────────────────
write → _outbox (IndexedDB)
──── POST /sync/mutations ──→ store mutation + timestamp
←─── GET /sync/changes ─── deltas since cursor
apply to local tables ←
update cursor ←
Writes are local-first — they appear in the UI instantly even offline. Push and pull run independently. A device can be offline for days, queue hundreds of writes, and sync cleanly when it reconnects.
npm install @maayo/react @maayo/client dexie// layout.tsx — add 'use client' for Next.js App Router
import { SyncProvider, useCollection } from '@maayo/react';
function App() {
return (
<SyncProvider config={{ baseUrl: 'https://api.example.com', dbName: 'myapp', channels: ['org:abc'] }}>
<StudentList />
</SyncProvider>
);
}
function StudentList() {
const students = useCollection('students');
return students.map(s => <div key={s.id}>{s.name}</div>);
}npm install @maayo/angular @maayo/client dexie// app.config.ts
import { provideSync } from '@maayo/angular';
export const appConfig = {
providers: [provideSync({ baseUrl: 'https://api.example.com', dbName: 'myapp', channels: ['org:abc'] })]
};// component
students = syncCollection('students');
status = injectSyncStatus();// build.gradle.kts
repositories {
maven { url = uri("https://maven.pkg.github.com/elroykanye/maayo") }
}
dependencies {
implementation("dev.maayo:maayo-spring:0.1.1")
}Any backend language works — see the protocol spec.
| Frontend | Support |
|---|---|
| React 18+ | @maayo/react |
| Next.js (App Router / Pages) | @maayo/react + 'use client' |
| Angular 17+ | @maayo/angular |
| Vue / Nuxt | @maayo/client directly (Vue adapter planned) |
| Svelte / vanilla JS | @maayo/client directly |
| Backend | Support |
|---|---|
| Spring Boot | @maayo/spring (GitHub Packages) |
| Node.js / Express / Fastify | Implement 2 endpoints — protocol spec |
| Python / FastAPI / Django | Implement 2 endpoints — protocol spec |
| Go, Rails, Laravel, any | Implement 2 endpoints — protocol spec |
MIT