Public Lab Research note

Sign up with

By signing up, you agree to the Code of Conduct, which applies to all online and in-person spaces managed by the Public Lab community and non-profit. You also agree to our Privacy Policy.

As an open source community, we believe in open licensing of content so that other members of the community can leverage your work legally -- with attribution, of course. By joining the Public Lab site, you agree to release the content you post here under a Creative Commons Attribution Sharealike license, and the hardware designs you post under the CERN Open Hardware License 1.1 (full text). This has the added benefit that others must share their improvements in turn with you.

GSoC 2019 (Synchronous Image Placement)

Aim

To make a synchronous image placement feature (in https://github.com/publiclab/mapknitter) just like google docs. The aim was to make the users collaboratively work on the same map with live changes reflecting on their respective browsers.

Mentor Support

All my mentors Jeff, Aman, Siddharth were very helpful during the entire summer of code period. In the earlier phases I needed a lot of ideas and brainstorming sessions to get my project going. The mentors were always there when I needed any help. Also, this project would not have been possible without @alaxallves 's help. Not only his rails 5 pr but he also helped me with many bug fixes, new ideas, the foreman gem concept and tons of other things as well!! I enjoyed the team work we did to make this project a success. Still some bits and pieces left in this feature although the deployable part is already merged into development branch which soon be released on unstable and finally on production. Can't wait to see that.

Project

Integration of Action Cable and addition of concurrent_editing_channel

My project was dependent on rails 5 or above, so I started building a PR on top of the rails 5 pull request. My first step was to integrate rail's actioncable configuration. Most of the code had to be in a single pull request. Also, created a few channels at the backend (given by actioncable) to handle all the business logic and a few channels at the javascript side to catch and throw events from each browser.

The pr involved the following steps which most probably sums up the entire project:-

Used rails' action-cable to create a concurrent_editing_channel.rb which has all the backend logic regarding the channel's connection with various users and broadcasts the various image related changes on this very channel. A basic action setup cable has also been done with files like cable.js, app/assets/javascripts/channels/concurrent_editing.js, etc. These are responsible for handling the broadcasts on the browser.

A few changes in Map.js file to update the map on each user's browser as it receives the updated data.

A working prototype of the product

Parts still to be worked:-

Although the part already merged into development branch is deployable but still we need to give user permissions on map like when to turn the live-editing on and so on. Secondly, we need to show the last edit is done by which user (we'll probably do that with the image revisions).

Documentation and support:-

The most important thing I felt while coding this project was the documentation, since, a lot of additional code was added to the codebase so to explain the action cable flow (a bit complex) with the help of comments and a readme. We can work to improve the language in that readme.