Skip to content

flexstoresync/flexstore-self-host

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

FlexStore Self-Host

Run your own FlexStore sync server with Docker — one multi-tenant image, sync API only (no dashboard).

  • Send X-Api-Key, X-Tenant-Id, and X-Device-Id on every /sync/* request
  • Auto-provision: unknown credentials are created on first request (unless external management is enabled)
  • Optional SSE pub/sub for fast cross-device sync
  • Works with @flexstore/react and @flexstore/core

Images: stanleykariuki/flexstoreserver · stanleykariuki/flexstorerealtime

Docs: Request headers · Postman collections


Choose a stack

Folder Containers Use when
simple/ flexstore + postgres Polling only
with-pubsub-service/ flexstore + realtime + postgres SSE sync hints
cd simple   # or with-pubsub-service/
cp .env.example .env
docker compose up -d
curl -s http://localhost:8088/healthz

Try with Postman

Import from postman/:

  • todos — single todos resource
  • schoolschools, faculty, teachers, students, support_tickets with nested pulls

Set variables apiKey, tenantId, deviceId to any strings — the server provisions them on first call.


React SDK

const config = {
  baseUrl: "http://localhost:8088",
  pubsubUrl: "http://localhost:8090", // omit for simple stack
  apiKey: "my-app-key",
  tenantId: "workspace-acme",
  resources: [{ name: "todos", attributes: { title: "string", done: "boolean" } }],
};

tenantId and device id are sent as headers only — not in JSON bodies.


External management (optional)

When OFS_EXTERNAL_MANAGEMENT=true, credentials are validated by your URL before provision. See docs/21-external-management.md.


License

MIT — see LICENSE.

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors