Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save ViditChitkara/91c093b86ed07711d2db40b070eb1a0b to your computer and use it in GitHub Desktop.
Save ViditChitkara/91c093b86ed07711d2db40b070eb1a0b to your computer and use it in GitHub Desktop.

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 that users collabortively work on the same map with live changes reflecting on their respective browsers.

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.

  • Basic connection logic in connection.rb

  • Used the action-cable-testing gem to write tests for actioncable and related features.

  • A few test fixture fixes.

Pull Request: publiclab/mapknitter#805

A few add-ons

The above PR didn't cater for addition and deletion of an image. Added that in this pull request.

Pull Request: publiclab/mapknitter#957

A working prototype of the product

gsoc-gif-1 gsoc-gif-2


Mentors

  • Jeffrey Warren
  • Aman jain
  • Sidharth
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment