How to develop an app: Get started with the Nextcloud tutorials

Originally published at: How to develop an app: Get started with the Nextcloud tutorials - Nextcloud

From amateur to expert developer, our tutorials will show you to develop an app for Nextcloud, as well as how to reproduce bugs and do basic troubleshooting.

At Nextcloud, we focus on open source app development and are committed to providing our community all the tools they need to transform their ideas into real Nextcloud apps.

Why Nextcloud Apps?

Jump start 🚀

Get all the basics to build your app: authentication, file handling & sharing, access control, mobile & desktop clients, and more.

Open source đź’™

As all of the code at Nextcloud is open source, you can draw inspiration from the code of other apps.

Strong community 👩‍💻

Be part of the awesome open-source community that is welcoming and encouraging.

Big audience 🌍

With between 200k-300k Nextcloud servers on the web, the most downloaded apps are installed on over 100k servers and have millions of users!

Free promotion 📢

If you create an app, extension or integration, Nextcloud will help you promote it. We are happy to work with you!

Business opportunity 🙌

If you build an app, script, extension or tool as a business endeavor, we will be happy to support your effort. We love our ecosystem and want you to benefit from it!

Read on to discover our new Nextcloud App development tutorials, including setting up your environment, developing your actual app, testing, and troubleshooting.

1. Setting up a development environment

Dive right in by setting up your environment, locally or in GitHub Codespaces.

If you prefer to work locally, we offer tutorials for Ubuntu, Mac, and Windows. Depending on your operating system, this will take between half an hour to a few hours to set up.

You can also use this video explaining how to set up your development environment on a Mac operating system:

Do you prefer to work in GitHub? This tutorial offers a great solution for workshops or if you just quickly want to dip your toes in Nextcloud development.

With this development environment, you can follow the “Hello World” app development tutorial and the “ToGif” ExApp development tutorial.

2. How to develop an app: Your first app, a dashboard widget, and integration with Smart Picker

Now you’re ready to start developing your app! At Nextcloud, you will find tutorials to:

Once done, you can start on the next tutorial: Developing a dashboard widget with Vue.js. With a widget you can make your app really come alive on the Nextcloud dashboard.

And you don’t need any Javascript knowledge to make it happen.

Do you want to go a bit further? Integrate your with an external provider with Smart Picker to create integrations and interactions with my different Nextcloud apps.

This includes Nextcloud Text, Nextcloud Talk, Nextcloud Notes, Nextcloud Deck, Nextcloud Collectives, and Nextcloud Mail.

3. The next level: How to develop an app with a navigation bar and database and add automated testing

With the next tutorial, you will learn how to develop a basic but complete app that can take notes. Based on that example, you can create your own app with a navigation bar and database.

Make sure you have the right setup before getting started

For this tutorial you should have a development environment created through the Nextcloud Docker setup. This is the only Nextcloud instance that you need for this tutorial as everything will happen in this instance.

 

After you’ve set up your own app, you can learn how to add automated tests with GitHub Actions, a continuous integration and continuous delivery (CI/CD) platform to automate your development workflow.

With GitHub Actions, app developers like you don’t have to deploy a test environment for all the different Nextcloud, PHP and database system versions.

After the tutorial you will know how to:

  • Use GitHub Actions to set up a specific Nextcloud test environment
  • Configure which tests to run
  • Implement tests
  • See if the tests have run successfully

4. How to develop an app in other programming languages

The previously mentioned tutorials show you how to develop Nextcloud apps using PHP, but some developers do not want to use PHP for various reasons.

That’s why we have developed an API that allows developers to write Nextcloud apps in any desired programming language. We call these “ExApps” (short for “external apps”).

With ExApps, you can integrate complex computational functions, such as machine learning, to be deployed on external hardware. With Nextcloud Hub 10, we worked on the AppAPI to make it even more robust and ready for a big variety of apps.

In our tutorial, you will learn how to develop an ExApp in Python, but similar principles can be applied to any other programming language as well.

Extra: Basic troubleshooting techniques, reproducing bugs, and testing

Is your app not functioning as expected? Do you not know why the code is not working properly? Then it’s time for some basic troubleshooting tips, including:

  • How to restart your Nextcloud instance
  • How to access the browser console
  • How to get the nextcloud.log file

Of course, it’s better to prevent than to cure. That’s why you can launch different versions of Nextcloud to reproduce bugs, test pull requests (PRs), or test user experience (UX) changes.

How to develop an app for Nextcloud

See all of our developer tutorials, featured apps, and more!

Learn more

Hello,

Great write up to onboard new developers.

Disclaimer: I am a pro develop, I only have an app (the search page) and I am daily user of Nextcloud. These opinions are my own.

My 2 cents:

I still miss some documentation on the futur of the platform (in the sense of what is correct to use and what will disappear in a near future) especially around the front-end libraries and exposed contracts.

I have already shown my disagreement with what I was able to get as answers here about how Nextcloud exposes functionalities to Application. Example: accessing restricted APIs (e.g. admin), the app dev is supposed to handle the fact that Nextcloud API might require a fresher token to perform the app and implement the password form before performing the call again… (see Application development front-end feature access (API, UI...)).

As an app developer, I should be able to perform the call, if the platform requires something from the user, I shouldn’t be on the path (especially with password).

I also see a lack of transparency around numbers of my deployed apps:

  1. how many installs, rough size estimates (yes some instance might not give the info). I can only rely on the downloads of my bundle from github (~3500) but that does not mean a lot.
  2. ratings in the store… I have 4 ratings at 5 stars, but my app rating is 3 (?). Why are all ratings without comment hidden from me?

Another struggling point is the release. When I had to setup the CI, I couldn’t find a working example. I tried looking at existing open source apps but there was always something not correct. I ended up doing a lot of trial and error that should have been simpler. And I still have things not working properly :slight_smile:

Don’t take this wrongly. I like Nextcloud, I use it everyday and love to see it grow!

–
Magnus

IMO it’s impossible to predict the future and it’s unrealistic to try to set any expectations on it, but I only joined relatively recently and I’m not aware of any such documentation myself, so I don’t know how useful (or not) it was. At least there are still upgrade guides published in the documentation to warn everyone when something is deprecated or removed.

Currently, five reviews are required to display an average, but we agree that showing 3 stars as the default is not ideal either. There is a proposal to change it to something more sensible, but it does require reworking the internal rating system to some extent.

In case you haven’t seen it, there are various workflow templates available for any app to use, including appstore-build-publish.yml. While they do still require a bit of configuration (e.g. adding secrets), they should work out-of-the-box without much trouble.

Regarding the future, I mean some documentation describing where the Nextcloud team is aiming now for future integrations, what is planned to be trashed, the way that is expected to be used to perform some operations…

This is nothing related to future guessing, it’s Product Management. I am specifically asking this for interfaces (or contracts). Especially when the target is outside of the core developer team meetings.

Nothing says it should be written in stone. Only dumb people never change their mind.

Some App developer, like me, are doing this on their free time and would like to reduce impacts (time) of changes of interfaces with Nextcloud to the minimum. Already some version increases can be time consuming. So knowing incoming changes upfront can help when making implementation choices.

Last but not least, as an App developer, I should not have to implement core functionalities like password prompts.

Hey! I’ve found that the URLs https://cloud.nextcloud.com/s/iyNGp8ryWxc7Efa?dir=/1%20Setting%20up%20a%20development%20environment and https://cloud.nextcloud.com/s/iyNGp8ryWxc7Efa?dir=/1a%20Set%20up%20a%20quick%20development%20environment%20with%20GitHub%20Codespaces are not accessible. Probably the public shares are no more active.

The share links are correct; they just happen to be down right now due to an issue with the server. The team is aware of it and will fix it as soon as possible. Sorry for the inconvenience.

2 Likes

This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.