State of app development?

I’ve started having a look at developing a Nextcloud app but the programming style makes it looks like it’s from the 90s with services/mapper/entity/queryBuilder, etc, very heavy OOP with ton of duplication when you want to add any service or controller, and lots of magical behaviour. You basically never know when something is going to work or not. Just keep trying and maybe your service will be magically auto-detected at some point.

Then I’ve tried asking for help on the dev forum but got no answer and I’ve noticed that there are only a few posts, many with no answers. In general searching online for a solution to a problem leads nowhere.

So app development in Nextcloud is neither very appealing (old school and heavy OOP), nor well supported. I’m wondering is it still something that Nextcloud is interested in? Or is it somewhat being deprecated in a favour of a new, perhaps more modern, solution?

3 Likes

Feel free to share the issues you were running into. This might help others to start with app development :wink: Beside the developer documentation the official apps are always worth a look.

I don’t know yet what is wrong with OOP but your suggestions are welcome. If you have specific ideas for the AppFramework please create a enhancement issue over here: https://github.com/nextcloud/server/issues

Just asking: Why not addressing this more pro-actively on a track of your own or with others at the next dev conf of NC at Berlin next year?
:nerd_face:

That’s as good point - I’m planning to attend a Nextcloud conf at some point so I’ll bring up the issue then.

In the meantime I’m considering creating a web app for Joplin as a Nextcloud app, and while the Nextcloud project seems very active, the “app” part not so much.

I’m not having a sense that there’s a big community of developers around this, or even if the “app” part will be around 5 years from now, or if it will redesigned to something else.

The current app framework seems heavy with a high learning curve, while it feels like a lighter wrapper around Nextcloud core would be more welcome, but maybe I just don’t understand it.

Anyway I guess I’m trying to assess if it makes sense to invest (a lot) of time in Nextcloud app development or if I should look for alternative solutions.

2 Likes

They also do hackathons throughout the year. However starters should have some helping hand without or before attending such an event. You can try using IRC to ask them about your problem or hinting to your questions here, since the forum is rarely used by developers.

@jospoortvliet: You have an idea how to improve the support for developers? Should we keep this category in this forum or redirect directly to IRC (forum has the advantage that others benefit as well from their questions/answers).

2 Likes

Yes it would be good to clarify where it’s possible to get help. Is that IRC then? One would assume the forum is the right place (since it’s linked to in various places) but currently it’s not useful to post here since no-one answer.

Yep IRC channel is dead as well. I spent quite a bit of time there, over two days, asking the same question and got no answer. All that time I only saw one other question, which was also left unanswered.

So in conclusion:

  • Forum is dead
  • IRC channel is dead
  • Documentation is incomplete or inexistent for certain features

That doesn’t make it easy to build anything for Nextcloud. There’s not much to do about the inexistent dev community I guess, but maybe the documentation could at least be completed.

There’s a lot of guessing work at the moment as each doc page only superficially describes each topic, and seems to assume the reader already knows a lot about the inner working of Nextcloud.

That’s me when building stuff for Nextcloud:

6 Likes

I tried joining IRC via the webchat and got annoyed by the complicated registration. This should really be made easier. I think many people are not familiar with IRC anymore. Maybe try Rocketchat?

1 Like

There are contributor weeks and hackathons such as: Time for the next contributor week in Berlin!

Aside from this face-to-face meeting, there should be a way to get support online. @jospoortvliet

Nice to know there are hackatons about 800Km away… It’s just too far to travel.
(Besides this is spare time effort, not an occupational thing).

As observed before: Forum seems unhelpful. Documentation… well if it could be called that. it is just a list of options to choose from. Some pages do have examples where the name of the app is myapp, yourapp, “something_else” all in the same example page… and that only for all references to an app name. if the other references are of equal value then is that documentation?..

I am still looking into trying to revive files_opds, and at first to only tackle the settings portion. Also on other places there is a hint to look at existing code… I tried the about 30 apps i installed, there are about 30 different methods to describe appinfo and data related to enable settings. I think every description method from version 1.0 to now is shown in possibly some (partial) updated form.

I tried to apply a current method borrowed from the “activity” plugin and got the settings pages to disappear so it is obviously there is more magic needed. Problem is how, what, where.
Finding stuff is non-trivial either, searching the forum on “app.php” delivers all hits for app and/or php (and those are a lot) and not just app.php “app.php” is no different.
Also not helpful: The activity plugin clearly doesn’t follow the documented methods, it seems ahead of it a few versions.
Please either create a “template” plugin where all items that are needed are mentioned and identifiable… and maybe write something around it WHY some items need to be set and WHEN. In that case existing listing of methods and values might actually be useful.
This template should be kept up to date with current standards. IMHO it should be created from V13, or V15 and then also ported to new versions. Then maybe some of the plugins created in the past can actually get ressurected?.
Lots of plugins from the past are abandonned by their authors often citing issues around the fast paced upgrades to the API… i guess their biggest problem was not only the fast pace, but also lack of usable documentation.

2 Likes

in case you are still receiving a notification about my reply I’d be interested to learn what you would have expected instead. are there any specific other frameworks where we should draw more inspiration from?

2 Likes

I agree wholeheartedly with original poster.
One thing that may should worry NextCloud developers is the lack of youtube step-by-step videos that explain how to develop apps for NexCloud. That should ring warning bells.
And what’s with the really heavy emphasis on very hard to follow OOP ? Trying to debug something is extremely difficult.

Could you please give me a few examples?

What is painful and how would you imagine that it could work otherwise?

I’ve been in the ecosystem too long to see it from your point of view.

Thanks :pray:

1 Like

@ChristophWurst :
I recently revisited the documentation… At least there is a consistent example (afaict) so progress there… it hardly touches the subjects of my use case but there is a basic one.
I again look into reviving the files_opds plugin. And again run into trouble.

  • missing: clear description on how to setup database tables from scratch only updates are documented… and need to be guessed from reading between the lines.
  • the right way to implement personal settings…, admin settings…
  • appinfo/app.php?
  • a good description (complete…?) about the appinfo/routing.php
  • Hooks… when why, what are available.
  • What are the requirements for DB access routines.
  • missing info on “creating an API…” and its security.
  • How to extend something like f.e. a Files to add an access protocol.

I want to append a few points to the list. I have the impression that the general architecture of the server/core is well-thought. The problem is that these concepts are not always communicated.

Example: The principles of Entity and Mapper are documented in the docs (:+1:). When it comes to joined queries, the documentation gets thin. As someone fluent with SQL, such combined requests are a way to optimize the queries.
How this should best be represented as Entity objects is not documented (:-1:). I know, this might be non-trivial as there might be cyclic dependencies that are hard to resolve in terms of objects. I found the hint here in the forum (thanks @ChristophWurst) that the DB should be considered more as a data repository. I suspect, I understand what is intended, now.

I am pretty sure, there are similar issues in the docs at multiple locations and on multiple levels. The current docs can be seen as a reference for experienced developers but it falls short for relatively new users.

Another big issue is that the API reference is present (:+1:), but many methods have at most minimal behavior documentation (:-1:). Example: Is \OCP\Files\Folder::delete() recursive? What can trigger a NotPermittedException during \OCP\Files\Folder::newFile()? One can guess much from the name and also from peeking into the source code. This is a time-consuming task as you need to dig deep into the source code of the core.

The latter is especially important when it comes to testing the app’s code. You must mock the environment and interfaces that are used by the code in unit tests. For internal classes, this should be clear. However, if there is a certain uncertainty with external classes, that might turn these tests brittle, worthless, or even wrong.

1 Like