Skip to content
arjaybyPublic

About

Elixir/Phoenix backend for collaborative Yjs documents, with PostgreSQL persistence, presence, room permissions, and a JavaScript SDK.

Topics

Resources

Stars

2 stars

Watchers

0 watching

Forks

Repository files navigation

Synixir

Synixir is an Elixir/Phoenix backend for collaborative Yjs documents and shared application state. It syncs changes through Phoenix Channels, uses Yex to work with Yjs on the server, and saves document updates in PostgreSQL.

Connect your own interface with the JavaScript SDK, or try the included playground to edit text, draw, and organize work together.

What can you build?

The playground includes working examples you can use as a starting point:

Use case Included examples
Write together CodeMirror text editor and Tiptap rich-text editor
Plan projects Kanban board and flowchart builder
Draw together Excalidraw whiteboard with shared cursors
Edit structured data Multiplayer form and collaborative table

All examples share room access, presence, and persistence. Each keeps its own content within the room's Yjs document. The playground guide explains the libraries and shared data types.

What's included?

  • Concurrent editing and reconnect support for Yjs text and shared state.
  • Durable saves, storage snapshots, compaction, and recovery after server crashes.
  • Live participant presence and cursors, with local undo in the playground.
  • Accounts, expiring sessions, and owner/editor/viewer room permissions.
  • A JavaScript SDK with TypeScript declarations and save status that confirms database persistence.

Try it locally

Start Docker or OrbStack. You'll need Git, Docker Compose v2, OpenSSL, and Elixir 1.18+ with Erlang/OTP 27+. The pinned versions are in .tool-versions. Docker builds the backend and browser examples; the staging scripts need no Mix dependencies.

For a first installation:

git clone https://github.com/arjayby/synixir.git
cd synixir
elixir scripts/staging.exs init
elixir scripts/staging.exs build
elixir scripts/staging.exs up

Open https://localhost:8443 and accept the local self-signed certificate. Create an account and a room, then open the same room in a second tab. Type in either tab to see changes appear in both. Use the example menu to try a board, drawing, or form in that room.

To collaborate with someone else, have them create an account, then grant their username access through Manage access. Sharing a room URL alone grants no access. Wait for Saved before closing a tab with edits.

Stop with elixir scripts/staging.exs stop; start again with elixir scripts/staging.exs up. Run init only once and retain the private .local/staging configuration with its database volume. See the staging guide for certificate renewal, backups, and upgrades.

Connect your app

Use @synixir/client to connect an authorized room and pass its doc and awareness to your Yjs binding. Use Y.Text for shared text or Y.Map for application state such as settings and board data.

The SDK is available in this repository and is not published to npm. The SDK guide covers installing a local tarball, account access, editor integration, save states, and cleanup.

Documentation

Current status

Local Docker HTTPS staging, operations tools, and backup restoration are implemented. CI builds the release and runs an HTTPS pilot that checks collaboration, app replacement, and database recovery.

  • Runs on one application node, with downtime during upgrades.
  • Unsaved offline edits live only in the open tab. Closing or reloading it loses unconfirmed changes.
  • Public hosting, external alert delivery, and off-machine backup scheduling require separate setup.

License

The backend is licensed under AGPL-3.0-or-later. The JavaScript SDK in packages/client/ and playground examples in examples/collaboration/ are licensed under Apache-2.0. Third-party components keep their own licenses. See the licensing policy for scope, self-hosting, and source-sharing requirements. Paid managed hosting is permitted; self-hosting under the AGPL does not require a license fee.

About

Elixir/Phoenix backend for collaborative Yjs documents, with PostgreSQL persistence, presence, room permissions, and a JavaScript SDK.

Topics

Resources

Stars

2 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages