Is it possible to dowload a file from my app, edit it locally and then the changes are automatically uploaded

Yes, it is possible!

If you integrate with Office 365 (Microsoft Graph API), you can create a Sharepoint environment to upload and edit files through the API.

In Appfarm you can access the files through a Web Request and then store the URL to the file in a Data Source. Opening the URL will take you to Office Online and any changes will be updated automatically in Sharepoint.

Hope that helps!