FreederTeam / Freeder

An easy-to-use free feed reader
Other
5 stars 1 forks source link

API #88

Open Phyks opened 9 years ago

Phyks commented 9 years ago

Expose a true API to be used to control Freeder instance remotely ?

  1. What do you think about it ? Do we want it ?
  2. Using a true API could help refactor the code, and we should decide it right now, before implementing advanced features. We could build the template as a pure webapp, querying the API (à la Angular.JS) and avoid having PHP code doing some output, JS code doing some other output and so on.

In particular, this has to be discussed before implementing the solutions to issues #86, issues related to offline mode #66, to modal boxes #73, #36 and some other such as continuous loading (infinite scroll).

For instance, I particularly dislike the actual refresh page which is quite a hacky piece of sh*t for the output. Should be way better with a JS script doing an AJAX call and polling IMO.

eliemichel commented 9 years ago

I really think that having a full JS webapp + an API would be a good idea. But it would require a large bunch of refactoring too…

tmos commented 9 years ago

I reaaaaaly love the full JS app idea, and, what a coincidence, I love angular too :D It could be a nice way to reboost the project, and open it wider (allowing to create more than one interface for freeder :cli, native app, brainfuck, etc.).

For me, this is a full :+1: , and I'm not affraid from the refactor part : this is, I think, firstly a fun/cuting edge project, so we have to enjoy this liberty :)

Note that I'm totaly overbooked at this time, so I'll not be able to help you for feew weeks… :(

Phyks commented 9 years ago

Ok, no problem. Let's do it then !

However, I propose to do it in a test-driven way, writing tests and expected results first. Here is a pad to write necessary features : http://tools.exppad.com/pad/p/freederAPI

Niols commented 9 years ago

Test-driven ? You mean, "making Niols a slave" ?

Phyks commented 9 years ago

Nope, these ones are easy to write =P

"making Niols a slave" is for the tests for the actual functions =)

tmos commented 9 years ago

Angular JS is a test-driven lib :) You can see a bunch of links on my shaarli : http://hub.tomcanac.com/liens/?searchtags=angularjs

eliemichel commented 9 years ago

Yeah, I saw that lot of tutorials about AngularJS include testing questions.

On 23/10/2014 18:46, Tom.C. wrote:

Angular JS is a test-driven lib :) You can see a bunch of links on my shaarli : http://hub.tomcanac.com/liens/?searchtags=angularjs

— Reply to this email directly or view it on GitHub https://github.com/FreederTeam/Freeder/issues/88#issuecomment-60269550.

tmos commented 9 years ago

This is a really powerfull and modern library, making JS writing a pleasure (yep, this is possible). The learning curve is pretty weird, with a lot of waves, but I think it is a good bet.

Phyks commented 9 years ago

Ok. I've never played with Angular but I do really want to, so I think Freeder is a perfect use case.

I propose :

  1. We refactor the backend code, just to sanitize everything and include unit tests. || In parallel, we write base ideas of what the API should look like.
  2. We dev this test-driven =)
tmos commented 9 years ago

Yep, the good part is that will "force" to have a nice API documentation, and will separate fully the interface from the backend :)

Phyks commented 9 years ago

:+1:

marienfressinaud commented 9 years ago

Great idea :) I wanted to do the same for FreshRSS but it's too late now ^^

It may be interesting to use an existing API (TTRSS, Google Reader, Owncloud News?) to be compatible with other apps? At least, it can be a good start!

tmos commented 9 years ago

Yep, trying to keep compatibility with other apps may be a good idea.

This website seems a nice start for building a standard api : http://www.restapitutorial.com/

Phyks commented 9 years ago

@marienfressinaud :+1:

I will try to do a little summary of the existing APIs for this kind of project (TTRS, Google Reader and Owncloud News), to have a better overview of the common basis we can use.

EDIT : Comment was in French :/

eliemichel commented 9 years ago

I added a RFF draft to the wiki: REST API It is highly unfinished.

@Phyks Do you have information (or links) about other APIs?

Phyks commented 9 years ago

@eliemichel nope, I did not have much time to have a look at TTRS, GR, or Owncloud for now =(

Phyks commented 9 years ago

Working on it, draft here: https://gist.github.com/Phyks/c143f719737e5557c4c2