Monday 22 August 2016

GSOC 2016 final blog post



Git Backend
This project was aimed to create a git like backend for Turtle JS and Sugar Journal which will support git functions like versioning and forking.
Project Proposal :Proposal
Final Progress: We have nearly met all the goals that we described/explained in the project proposal. A Git Backend Api was created which was used in TurtleJS(web activity) and Turtle Art(python activity) as examples. Server integration was also given in the case of TurtleJS. Enough progress have been made with the project to progress in the future, the idea of a Git Backend was explored and the future part is to integrate the backed api code to all other sugar activities.


Git Repositories i worked on this summer:
1. Git Backend Code : Git Backend
2. Turtle JS with git backend : Turtle JS(with Git Backend)
3. Turtle Art with git backend :  Turtle Art(Git Backend)


Turtle JS
Turtle JS is originally maintained at TurtleblocksJS, changes i made to the code are:
1. Converted the TurtleblocksJS app to a flask application.
2. Added the git backend functionalities to the web activity.(Explained in the repo)

Before:


After:


In the bottom image multiple new git buttons such as pull, clone, add , status, diff, etc are added.



Turtle Art
TurtleArt is originally maintained at TurtleArt, the changes i made to it are:
1. Added the git backend functionalities to the activity(Check repo for detailed description).

Before:



After:







In the above image various git buttons are added. The buttons in both the Python activity and the web activity are meant to produce the same results even though they have very different UI's.

Documentation: Documentation





Friday 12 August 2016

Progress till Now

Nearly 10 days are left for the pens down in this Google Summer Of Code Project and the Git Backend project has taken its final shape and is near completion.
Tasks Completed so far:
1. Git functions created in Turtle JS
2. Git functions added in Turtle Art

Tasks Left:
1. Implementing Git Push(Having issues with authentication, going to use ssh keys), as soon as this bug will be solved different users can work on similar Turtle projects in across both the web version and the python version.
2. Adding different images for different buttons
3. Documentation

Repo for Turtle JS : https://github.com/vikramahuja1001/TurtleJS_backend
Repo for TurtleArt: https://github.com/vikramahuja1001/TurtleArt_Backend

So for the github part of this project, i.e., saving the repos remotely currently a repo is made in github named TurtleCodes which will contain all the turtle codes (ta and tb). The user will be directly able to make changes to that repo once the admin of that repo has approved his request or added his ssh key. Also a option is given to fork the repo to make things work locally.

Attaching the videos of both the projects:
Turtle Art:
Turtle JS:


Friday 1 July 2016

Mid sem Eval

So this week i mainly worked on two functions inside the Turtle JS environment. I implemented the diff and the revert to a commit function. The diff function of each the activity has to be specific for itself, for eg: in TurtleJS the diff function should return the difference in the commits in terms of blocks changed, i.e., number of blocks added and removed, their connections and their values. So the task was to make the diff output as easy to understand as possible. To make it possible a diff parser had to implemented, in this parser the diff output is given.
Eg: of a diff output created by dulwich porcelain.diff_tree function A test diff output
The parser takes into account the given jsons of two commits. At present the diff output is shown of two consecutive commits.

For the second task i.e., creating the revert to a commit function, the diff output was used in this case also. The UI of this has not been implemented yet, but the final UI will be in the form of a slider bar which will have all the commit messages and the on click on a certain commit message the page pushes that commit to the server.

Monday 20 June 2016

Progress so far

This week I started with the integration of the backend code in TurtleJS(Test Web app) using Flask. In order to try Flask a test app is written which mimics the functionality of what the backend in TurtleJS is going to achieve. So this app just portrays the communication of the JS and the backend python code.

Test App

In order to test the integration between the dulwich python code and the Ajax a test application is written using Flask frameworks. It uses the python functions which were programmed earlier using Duwich library. Link : Backend Dulwich Functions. These functions are complete and can be directly loaded into TurtleJS


The Test App to test the Flask app with functions and AJAX

Console Log of the Test App

Console log of the Test App


Terminal log of the Test Flask App showing Logs and Diffs



Turtle JS Integration:
Currently there is an issue with TurtleJS not recognising the $.ajax in Jquery. The buttons of the functions have been added(Image is same that of Help) and on click the call different functions, but since there is an issue with the AJAX call, it is not able to connect to the web server.

EDIT 1: I decided to ditch the idea of using Jquery, now i am using XmlHttpRequest() to make calls to the server and the functions in Turtle JS are working now.


EDIT 2: Functions like init, commit, save, add, diff, commit history, load a repo are working. A video is included to show its working.


Edit 3: Load from Repo now asks for a Git file input, will not work with normal text files.
Link to the Github Repo: https://github.com/vikramahuja1001/TurtleJS_backend
It contains the 2 folders, one for the main TurtleJS app named as backend_app and the other one is the test_app.