feat: expose CRUD, onboarding, pubsub via web

This commit is contained in:
2026-04-22 16:32:41 +02:00
parent 9807331da4
commit 9389c32244
33 changed files with 1536 additions and 7 deletions
@@ -0,0 +1,21 @@
defmodule Localiser.Web.Channels.ParticlesChannel do
use Phoenix.Channel
@impl true
def join("particles:" <> tag_id, _params, socket) do
Phoenix.PubSub.subscribe(Localiser.PubSub, "particles:#{tag_id}")
{:ok, assign(socket, :tag_id, tag_id)}
end
@impl true
def handle_info({:particles_updated, payload}, socket) do
push(socket, "particles_updated", %{
tag_id: payload.tag_id,
estimate: payload.estimate,
particles: payload.particles
})
{:noreply, socket}
end
def handle_info(_msg, socket), do: {:noreply, socket}
end