Appwrite cloud functions, Flutter and private GitLab repos

From start to finish

Danielle H
9 min readJun 7, 2024

How to write a cloud function in Dart that uses code from a private GitLab repo?

Appwrite is an awesome Backend-as-a-Service. Most apps require some kind of cloud function — to update an index, perform server-side functions that need secure API keys, etc. And Appwrite even supports cloud functions written in Dart!

My app is written in Flutter, I have models, enums and constants that are used in the mobile app (that creates the data) the desktop app (that reads the data) and the cloud functions (that perform actions on the data). I really don’t want to copy-paste code, it just leads to unmaintainable code that is open to all kinds of bugs.

So a package of common code seems to be the best solution. But cloud functions work in isolated containers. How to give them access to your private package on Gitlab? What can be put in the package? How to configure Appwrite so that your passwords aren’t hardcoded?

So here it is, step by step from start to finish.

Table of contents

--

--

Danielle H
Danielle H

Written by Danielle H

Physicist turned programmer, exploring many languages to build projects from neurobiology tools to abstract videos.