sikher / gurbanidb

An API for the Sikh Scriptures using the Laravel PHP framework
https://api.sikher.com
18 stars 4 forks source link

API may need to be redesigned somewhat to allow for lighter searches #7

Open irvanjitsingh opened 9 years ago

irvanjitsingh commented 9 years ago

In practical use, if an application uses the API as the primary data source, even with caching there is still a large amount of data being returned for most queries with Gurbani in them. There should be an option to only return specific fields. As an example, when displaying a given shabad, the only relevant fields that need to be queried are the text values for the gurmukhi, translation, and transliteration for each pangti. This can add up to a lot of wasted bandwidth and processing power.

jasdeepkhalsa commented 9 years ago

This is a good idea. I think one convention is to have a fields query parameter like:

http://api.sikher.com/search/ਮਮਲ?fields=id,text,translation[text],transliteration[text]

Facebook uses a similar convention:

https://graph.facebook.com/bgolub?fields=id,name,picture
jasdeepkhalsa commented 9 years ago

This app and API is badly in need of re-design anyway. I want to re-develop the code base in Node.js which is more portable - can be easily turned into a Desktop app if needed

irvanjitsingh commented 9 years ago

I agree that it needs to be rewritten. As for which languages/frameworks to use I think that decision should be based first and foremost on what would make the best web service for gurbani that can be accessed from any platform, and then how easily it can be migrated. Haven't delved much into node yet so can't comment on that.

jasdeepkhalsa commented 8 years ago

Just as an update to this: we will be using DreamFactory going forward to create and manage our API as it is already super customizable and a mature API middleware. It also has the added bonus of being written in PHP, and specifically Laravel, which our existing API was based upon

bogas04 commented 8 years ago

I'm willing to contribute to NodeJS port, but obviously will need your guidance