So i have a pretty easy to understand use-case:
- MongoDB and Redis
- Kubernetes (multiple nodes)
I am trying you to understand what i am trying to do:
- I am using Prosemirror
- Editor is being used by a team of 6 people to send messages to clients in timeline (just like facebook timeline). This message area is not synced.
- I need templates to be made so its easier to send messages. When sending message, you can select predefined templates and send instantly.
- Templates are needed to be made in collaboration by everyone in team
- When you create a template, you can use it in in timeline section(again which is not realtime collaborative)
- Collaboration is happening only when you are making a template. I guess this makes sense now.
- yjs document needs to be preserved in Redis so that any machine (node of kubernetes) can work on same document.
Now i am telling about my pain points
- I have SocketIO working already in front end, and i can see a websocket provider (y-websocket) in yjs github which i don’t want to use, neither it is feasible in my usecase as socket-io supports alternatives(of ws like long polling), so i need SocketIO connector
- I need my connector to save changes in redis or mongo, so if someone wants to use template while it is being modified from someone else they can have the document at least.
- I need document in Prosemirror format so i can append(or replace) the message box with new content when someone clicks on a certain template.
What i did so far
By looking at how y-websocket connector is working, i have tried the following things.
- i am trying to make my own connector based on socket-io (sharing the code in comment, so far)
- I am trying to implement the similar logic on server side (sharing the code in comment, so far)
WHAT I AM NOT GETTING
- How the hell connector works. And i am not getting any clue of it even.
- How can i implement multiple instances synced using redis or whatever i can use.