NikolaySuslov / lcs-reflector

Standalone message reflector server for LiveCoding.space and Krestianstvo SDK 4
https://www.krestianstvo.org
MIT License
6 stars 4 forks source link

use cases #1

Open lazydino opened 6 years ago

lazydino commented 6 years ago

Is the purpose of the project to provide a VWF reflector for web applications hosted in other domains and servers capability to access the reflector? How to test the project? Can you give me some use cases of using the stand alone reflector?

NikolaySuslov commented 6 years ago

Hello Reggie, Thanks for the question. Yes, that reflector for VWF web applications hosted in other domains and servers. You could find an example of using it in the latest version of https://LiveCoding.space https://github.com/NikolaySuslov/livecodingspace, where main web app uses micro client-router and single page application architecture. Here are install instructions

lazydino commented 6 years ago

Thanks Nikolay, I will certainly go though the repository and find out more about the architecture. If the reflector project is meant to be running independently, could I just take a minimum VWF duck demo and run it against an instance at time.livecoding.space or my own server? What is the minimum steps involved? If I already have a VWF server running duck demo. What are the efforts to make that duck demo using the separated reflector? Do I still need a client side routing piece like page.js component to do this? Is there a way to get duck demo working with the vwf app server at https://github.com/NikolaySuslov/livecodingspace ? It doesn't seem to work just copying duck directory under the /public sub directory?

NikolaySuslov commented 6 years ago

Hello Reggie,

could I just take a minimum VWF duck demo and run it against an instance at time.livecoding.space or my own server? What is the minimum steps involved?

No, you will also need to modify VWF.js, where during connection to Reflector server, information about application (aka loadInfo or saveInfo) is taken from the client, then is sent to Reflector. In the original VWF, that information is taken from the server filesystem by the Reflector itself (client sends only the name of application).

Is there a way to get duck demo working with the vwf app server at https://github.com/NikolaySuslov/livecodingspace ?

LiveCoding.space VWF application does not contain the original VWF ThreeJS components and drivers, so unfortunately the duck demo from vwf app will not work by default. It should be modified to the new VWF&A-Frame components. For example, if you Sign Up/Sign In to https://livecoding.space, you could click Clone any world proto and then click Edit that proto (in the list of your worlds) to look the source code and edit just in web browser.

It doesn't seem to work just copying duck directory under the /public sub directory?

Yes, because in LiveCoding.space all worlds (protos, states, components) are stored on clients (not on server) using GunDB distributed storage system. /public directory on app server which contains /defaults/worlds and /defaults/proxy is used only for bootstrapping that storage.

Best regards, Nikolai

lazydino commented 6 years ago

I had downloaded livecodingspace probably a few months ago. Looks like you removed all the VWF AFrame applications and serve them via GunDB in the later commits.... Any tip on initialize the home page with preexisting applications like what you did for livecoding.space? ( The VWF Aframe applications displayed near the end of the page ) Need to populate gundb server with the entries?

Is there a way to do authoring test from localhost? Can't seem to find the 'start' button of an empty world on localhost? It seems noticeable slow to launch my own world first time over livecoding.space. Is it because of gundb try to do something on my local storage? Something to do with the older chrome browser (version 60) I run in Ubuntu? What about collaborative authoring? Can I do that with the codebase, or the deployment over livecoding.space?

NikolaySuslov commented 6 years ago

Hello Reggie, Thanks for the questions.

I had downloaded livecodingspace probably a few months ago. Looks like you removed all the VWF AFrame applications and serve them via GunDB in the later commits....

Yes, the LCS v0.2 (current master branch at https://github.com/NikolaySuslov/livecodingspace) serves all applications trough GunDB storage. So, in that repository you could find public/defaults/worlds folder, which is used only once in Setup process, while initialising LCS application server and populate the defaults onto GunDB storage.

Any tip on initialize the home page with preexisting applications like what you did for livecoding.space? ( The VWF Aframe applications displayed near the end of the page ) Need to populate gundb server with the entries?

Yes, you could follow these installation instructions for your own server or localhost: https://krestianstvo.org/books/doc/sdk3/#/install

It seems noticeable slow to launch my own world first time over livecoding.space. Is it because of gundb try to do something on my local storage?

Yes, it gets the latest modificated data from GunDB peers, and store it on local storage.

Something to do with the older chrome browser (version 60) I run in Ubuntu?

There is code based on ES6 modules, async/await, WebCrypto in Gun SEA. So, it is recommended to use the latest version of Chrome or Firefox, if possible. May be there are could be some workarounds using polyfills and chrome:flags, but I have not tested that.

What about collaborative authoring? Can I do that with the codebase, or the deployment over livecoding.space?

For now collaborative authoring is happening only in running World instances. The owner of the World proto or state, from which the world was instantiated, could save the modifications, but any other user could only clone it. Editing of a World Prototype codebase in text from Web GUI is available only for the owner now. Yes, there are plans to add the feature of sharing the rights.

Best regards, Nikolai

lazydino commented 6 years ago

Nickolay,

Thanks for the detailed instructions. I think my problem is on invoking localhost:3007/setup. I was able to clone the repos in a different machine and run /setup to config public key, and access the four buttons. It only allow me to go through the process only once? After that, I won't be able to get anything from the /setup url? Trying incognito and cache clear aren't working to get back the setup screen. Is there a way to reset the gundb cache so I can monitor and restart the process of first user signing up again?

NikolaySuslov commented 6 years ago

Hello Reggie,

It only allow me to go through the process only once?

No, as much as you want/need. But, /setup url will be avalible only for system user, if you Sign IN with it.

Trying incognito and cache clear aren't working to get back the setup screen. Is there a way to reset the gundb cache so I can monitor and restart the process of first user signing up again?

For reseting gundb cache you need to clear all instances of GunDB (on server and browsers):

  1. Stop GunDB server and delete radata folder
  2. In browser you have opened localhost:3007 clear local storage with localStorage.clear();, reload page
  3. Start again GunDB server and reload page
lazydino commented 6 years ago

Thanks for the help. The codebase seems to have a little problem running under windows 10. I don't have issue running on linux, but here is what Chrome debugger reports when I try to 'Load defaults Proxy'. Something to do with handling windows path? image