Files
numolus/config/routes.rb
T
wkhandClaude Opus 5.5 7fce972fdc Live collaboration with Yjs over ActionCable
All editors now work on a server document at the same time instead of
taking turns behind an edit lock.

- The document's content is a sequence of Yjs updates (document_updates);
  DocumentChannel stores and relays them immediately, checks access on
  subscribe and again whenever links or memberships change.
- app/frontend/collab/: the store stays position-based; a binding maps it
  to a Yjs form with stable row/column ids, so a row inserted by one
  person doesn't misplace what another is typing. Remote changes are
  applied only after pending local ones went into Yjs.
- Per-person undo (Y.UndoManager), presence via awareness: the others'
  selections as coloured boxes with names, avatars in the toolbar.
- Existing JSON documents convert on first open, deterministically, so
  two people opening one at once end up with the same Yjs state.
- Editors compact the stored updates after 200 and keep a JSON snapshot
  current for export and duplicating. Edit lock and polling are gone.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-09-28 20:41:02 +02:00

33 lines
1.0 KiB
Ruby

Rails.application.routes.draw do
get "up" => "rails/health#show", as: :rails_health_check
# sign-in / invitation link from the mail: confirm page, then POST signs in
get "auth/verify" => "auth#show", as: :verify_auth
post "auth/verify" => "auth#create"
namespace :api do
post "auth/magic_link" => "auth#magic_link"
post "auth/code" => "auth#code"
delete "auth/session" => "auth#logout"
get "me" => "me#show"
patch "me" => "me#update"
resources :documents, only: %i[index create show update destroy] do
resource :join, only: :create
get "share" => "shares#show"
post "share/links" => "shares#create_link"
delete "share/links/:id" => "shares#revoke_link"
post "share/invitations" => "shares#invite"
patch "share/members/:user_id" => "shares#update_member"
delete "share/members/:user_id" => "shares#remove_member"
end
end
mount LetterOpenerWeb::Engine, at: "/letter_opener" if Rails.env.development?
# the Vue app
get "d/:id" => "spa#show", as: :document_page
root "spa#show"
end