Still using REST or GraphQL? 😅

realtime, universal state as a service

1// usage in React
2const [{ count }, setState] = useLiveState({
3  id: "global-counter", // uuid()
4  defaultValue: { count: 1 }
5})
6
7<button onClick={() => setState({ count: count + 1 })}>
8  Increment
9</button>
10
11<button onClick={() => setState({ count: 1 })}>
12  Reset
13</button>

Example

1

Open a second browser window and click 3 times to see the magic 🪄

How it works 🦾

livestate.io is a ephemeral in-memory key:value online data store, which holds the state in a JSON like structure. Every state object is identified by an id (uuid). When you change your state on the client side, the patch (https://tools.ietf.org/html/rfc6902) is pushed to the server and broadcasted to other clients, which have subscribed to the same id.

What can you build with it 🎉

Its main purpose are small realtime applications, shared state, like a simple chat, signalling server for webRTC or a live planning-poker application.

I'll create some example Apps in the near future ;)

Its Fast and reliable 😎

The architecture of livestate.io is very reliable, as it is based on elixir and phoenix, and runs on the Beam with "awesome performance".

Security 🔐

Right now, as this is just a Proof of Concept there is no security at all. Everyone can change the state by id. However, there are plans to implement an access model and permissions system which would also require an auth layer.

Roadmap ⏳

  • Auth & Security
  • Schema & Validation
  • Webhooks
  • Persistence
  • Observability
  • Time-Travel

Contribute 🦺

You are welcome to contribute smart ideas. livestate is based on:

  • Elixir
  • Phoenix
  • Javascript
  • React

Sponsoring & Commercial use 💰

If you feel, that you have a cool use case, and would like to sponsor this Project and to place your company logo here as long as it is still affordable, send me an E-Mail

Credits 🙏

ElixirPhoenixFrameworkGigalixirVercel

  • Elixir & Phoenix are building the backend
  • I am very thankful that I can run it on Gigalixir
  • This webpage is build with Next.js and is hosted by vercel

This PoC is a good example, how different technologies can & should work together. Thanks for visiting.