chat-e2ee icon indicating copy to clipboard operation
chat-e2ee copied to clipboard

Create a JS playground with @chat-e2ee/service package

Open muke1908 opened this issue 2 years ago • 9 comments

Create a fiddle using @chat-e2ee/service package to demonstrate basic functionalities. use @chat-e2ee/[email protected]

https://github.com/muke1908/chat-e2ee/tree/master/service

muke1908 avatar May 09 '23 08:05 muke1908

Hi @muke1908 .... can I take up this?

rohan-naik07 avatar Dec 28 '23 08:12 rohan-naik07

@rohan-naik07 Sure, go ahead.

muke1908 avatar Dec 28 '23 08:12 muke1908

fiddle means online code editor right that exposes all the APIs of the sdk ...like two code editors which represent 2 users and we can create a dummy channel between them?

rohan-naik07 avatar Dec 28 '23 10:12 rohan-naik07

@rohan-naik07 yes, working demo of the exposed APIs on the SDK.

muke1908 avatar Dec 28 '23 10:12 muke1908

So basically I will proceed with a new react app called e2ee-playground.

  • this frontend will have 2 open code editors which expose all the apis of the SDK.
  • person can run the code in the editors on the cloud runtime (eg- aws lamdba) and render the logs of each editor below the each editor respectively

rohan-naik07 avatar Dec 29 '23 06:12 rohan-naik07

I think you can just keep it vanilla-js, react-app is unnecessary imo. You can use codesandbox for writing code. Instead of 2 editor, we can simulate 2 users using iframe - user1 is main window, user2 embedded in an iframe.

Here is an example: https://codesandbox.io/p/sandbox/gracious-pine-6jhqwt

muke1908 avatar Dec 29 '23 09:12 muke1908

So its just creating two html pages in the sandbox which simulate two users and embed the second user in first user's window. the two users can send messages to each user using common channel.

rohan-naik07 avatar Dec 29 '23 09:12 rohan-naik07

Yes. I didn't understand what you meant by "common channel" but they both will have their own chatInstance

muke1908 avatar Dec 29 '23 10:12 muke1908