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
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.
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.