GSoC'17 : ownCloud as a backend for web apps & JavaScript API client Library

gsoc

#1

Hello everyone,

I am Noveen Sachdeva (irc: noveens), 2nd year undergraduate from International Institute of Information Technology, Hyderabad (IIIT-H), India currently pursuing B.Tech. in Computer Science and Engineering(CSE).

I am comfortable with NodeJS, PHP, SQL, JQuery, REST APIs, HTML, CSS, Python, C/C++.
In past I have worked with Progress Software © and implemented a native (both android and iOS) "Project Management" mobile app , an extension to their existing project management web-SaaS application which I implemented using NativeScript. (author at play store is Daksh Anand, my batchmate since I didn't have a google developer account)

As a side project, I implemented the backend of an app we call SprintOJ , which is a fully automated Online-Judge to check codes of admin-uploadable questions written in the user choice's language (We support C, C++, Python, Java). The app is implemented on MEAN stack and again, uses REST APIs as the mode for communication.

I also have developed several other side projects like text-summarizer , lazer-brick game , tetris , bash like shell.

I read the project descriptions at idea page and I found following projects interesting(in preference order):

API Client Library (Mentor: Vincent Petry, @PVince81)
link : link

As per my understanding, I have to develop an API client library which provides various classes/functions in a way that it is's easy for the end-user to use OwnCloud APIs like webDAV and OCS.
I want to make the API client library in NodeJS(JavaScript), since it fairly matches my skillset and I have already developed the backend for a competitive programming Online Judge (SprintOJ) in NodeJS.

New App store (Mentor: Bernhard Posselt, @BernhardPosselt)
link : link

As per my understanding, I have to develop an new App store which can ease app publishing and installation.
The language in which the APIs should be written is NodeJS, and the objective should be providing REST APIs for publishing, unpublishing apps, retrieving apps.

I would love to contribute to OwnCloud during this summer, and have enjoyed every bit contributing to ownCloud during the last month or so. I would like to know further details on the "API Client Library" project.

Here is a link of my OwnCloud Contributions : link

Looking forward for guidance from mentors.
Potential GSoC Aspirant

Noveen Sachdeva
github: https://github.com/noveens


#2

Hi @noveens.

The new app store idea is obsolete as we're developing a marketplace: https://owncloud.com/owncloud-announces-new-marketplace/
I'll remove it from the project ideas list.

For the API client library with Node JS. Back then when I added this entry we didn't have anything from JS I think. Now we have this library: https://github.com/evert/davclient.js
However if you look closely, that library is very low-level (you need to know what a propfind is to list files, etc). So one idea would be to have another higher level library wrap this one and provide a more friendly API like "listFiles(path)" and return pre-parsed response nodes that are easy to use. Something similar to pyocclient: https://github.com/owncloud/pyocclient
Ideal is if that library works both in NodeJS and web browser.


#3

I also forgot to mention that davclient.js is really just for Webdav and files.

For managing users and shares it's a different API format, so covering that would be useful too!


#4

@PVince81 ,

Thanks for the quick reply, I would love to extend the work on davclient.js and make the the work at a higher level so that it's easier to use and add the APIs for users and shares :smiley:

I had one doubt about davclient.js though,
Today, Evert Pot declared that he won't be maintaining davclient.js anymore ( link ), so I was a little confused whether we should enhance davclient.js or start a new project.

I liked the idea of browser based API explorer. It will be a great addition for the developers. I was thinking of using swagger. Any comments or suggestions on the API explorer would be great !

I am currently reading the davclient.js and pyocclient's code-base, to get more familiar and get a better understanding of the project.

Thanks,
Noveen Sachdeva


#5

To summarize:

  • davclient.js needs to stay low-level and require specific Webdav knowledge. It might require some additions when needed.
  • the API client library from this project is ownCloud-specific and higher level and does not require Webdav knowledge to be used. So it is more user-friendly. Also it is not limited to Webdav (files) but also calls the OCS Share API (REST-like) and other required apis to enrich its functionality.

Regarding davclient.js maintenance: so far most of the PRs to davclient.js have been done by myself, I think we can continue that way for now. Since OC is using it extensively it doesn't make sense to write a new one.

Regarding API explorer: we have thought about this before but swagger is not suitable for Webdav API styles. It might be possible to use it for the OCS API formats though but would require more research.


#6

Hi @PVince81 ,

From the above discussion I gathered that the following work needs to be done:


  • Make a node library of owncloud's APIs.

  • The library should include APIs of files, shares, higher-level WebDAV (wrap on top of davclient.js), users.

  • Write proper tests using one of the JS testing frameworks like Jasmine, Mocha, Sinon.

  • I would also like to propose a browser-based API-explorer. For OCS APIs I was thinking of using Swagger (Example embedded) which is used by many big companies as well, and has kind of bcome a standard.

  • Since WebDAV APIs can't be explored using swagger, I was thinking of integrating an AJAX based web-file-browser to display the results of an WebDAV-API call.
    For reference : link

  • The node library should work on the browser as well.

But while researching about the above things, I came up with the following doubts :
Any guidance would be highly helpful :smile:


  • Among so many choices of JS-testing frameworks, which one is the most suitable?
    I personally would prefer Jasmine due to experience.

  • Which all APIs need to be written exactly?
    I was thinking all the APIs taken care of in the pyocclient would be sufficient.

  • "The APIs should work on the browser as well", what exactly does it mean?
    Does it mean the API exolorer only?

@PVince81 @DeepDiver1975,
Am I missing anything?

Thanks in advance :smiley:


#7

I only have experience with Jasmine and Sinon (as a sub-tool for Jasmine)

All APIs from pyocclient would be a good start, yes.

Since you're developing a JS lib, then it would be nice if that library can also be used in the browser, not only node JS. But there are challenges to solve first like cross-domain calls / OAuth. Not sure if it's even possible. But for regular ownCloud apps that run in the same domain, the library could be used for quick access to the APIs on the JS / browser side.


#8

I heard Swagger is not compatible with Webdav as per recent research.

So Swagger is only suitable for the non-Webdav APIs, not sure if it's worth spending time on that.
But of course an API explorer would be nice if it was possible but I don't see it in the scope of this task, maybe just a stretch goal.


#9

Thanks for the prompt reply @PVince81 :smiley:

Swagger can't be used with WebDAV, agreed.

I was suggesting :
Integrating an AJAX based web-file-browser to display the results of an WebDAV-API call.
For reference : link
What do you think about this?

IMHO, for non-WebDAV APIs swagger is perfect.
I think I can manage doing the library part PLUS the API explorer part in one summer
(With guidance from you as a mentor of-course :wink: )


#10

Hey @PVince81 ,

I have made a sample node library with just 2 methods for now.
Also, I have made a minimalist front-end to show the library in action.
I have deployed the sample front-end at : http://noveen.tk:8080/
There is a link of the code at that page itself.

It would be awesome if you could have a look at it! :smiley:

There is a link of a sample swagger documentation of the 2 APIs that I wrote, please do check it out.
Is this the right way to go?

Thanks,
Noveen Sachdeva.


#11

Hello mentors,

I've uploaded the draft of my proposal on the Google Summer of Code's website. I kindly request you to review it and provide your feedback so that I could make the changes you suggest.

Thank you!


#12

Looks fine.

Possible stretch goal: implement a JS "select file" dialog that webapps can reuse.
The dialog itself could simply be using your API to fetch the files to display in the list.

Or make that part of your example app.
I suggest making a simple external text editor webapp that uses JS in browser to .communicate with OC to load/save files. And the dialog itself uses the list function of the API to display the list of files/folders for the picker.


#13

Link to project https://summerofcode.withgoogle.com/archive/2017/projects/5166409181036544/