Question regarding servers

Hello!

I'm not sure if this is the right channel, but I'm trying here anyway.

I am currently working on my master's thesis at the University of Oslo. Part of my thesis involves understanding what it is like to develop a self-hosted CommCare system versus your commercial offering (CommCare subscription). In this regard, I have a few questions.

Have I understood correctly that if one wishes to use your open source code, it must be hosted on one's own servers? That is, no infrastructure is included in the open source code?

If one uses your subscription, is it possible to make changes to the codebase in the same way as if one had hosted the code on one's own servers. Or will there be any limitations when using your subscription??

If this isn't the right channel, could you direct me to the right channel, or possibly someone I could get in touch with?

Thanks in advance.

Your assumptions are correct, the open source code and documentation are freely available, but you would need to host it yourself in any Ubuntu 22.04 OS or Docker environment. No access to the back end is available for Dimagi's own servers.

Thank you for clarifying @erobinson

1 Like

Hi @Omarelk

These are great questions, and @erobinson is correct:

  • The source code for CommCare HQ (and CommCare Mobile, and the tooling that Dimagi uses for managing CommCare HQ, etc.) are all available. You are free to deploy that code on your own hardware, or in a cloud hosting environment of your own. Dimagi only hosts their own environments.

  • The code is available on GitHub. You are welcome to fork the codebase and modify it, and you are encouraged to contribute your changes back to the project, regardless of whether you host your own CommCare environment or not. If your changes are merged into the codebase, then they will be available to all environments -- Dimagi's and other third-party-hosted environments.

No access to the code base is available for Dimagi's own servers

To be clear, of course shell access to Dimagi's servers is not open to the Internet. But the servers are running the same code that is publicly available on GitHub. So in that sense, everyone has access to the codebase that is running on Dimagi's own servers. And if you run your own CommCare HQ environment, then you will be running the same code that Dimagi is running on their servers.

I hope that helps,

Norman

4 Likes

Thanks @Norman_Hooper some useful clarification there.

Appreciate the clarification. It's now clear to me that one does not have access to the codebase that runs on Dimagi's own servers. But does this only apply to the back-end code? Say I've developed an application with "drag and drop" through one of your subscriptions. I also want to add a customized function that isn't offered by "drag and drop." Do I have the opportunity to make changes to the front-end code?

Hi, I think the terms back end and front end can be misnomers to some degree.
There's no access to any code served from Dimagi's servers, that includes the Django / Python code base that generates the UI. The only thing you'll have access to is the HTML / JS presented to the browser, and you'll only have transient access after loading a page. Any modifications from the browser will have no effect on the deployed code base on the servers.

The best way to modify the UI / front end is to fork the code and deploy your own server either locally on your dev machine, with an online PaaS provider or in your own on-premises hosting environment. You will then be able to make modifications to the system for debugging and testing. If you want to contribute to the Commcare code base, you can follow the documented process to commit your code to your forked repository and perform a pull request.

@Norman_Hooper please correct anything incorrect above?
Thanks

2 Likes

There is also the Android app as a front-end. You could fork that codebase and still use Dimagi's servers. There are also some ways to integrate with other Android apps too via in-app callouts, depending on the specific needs.

2 Likes

Thank you for the input; this is valuable information!

Does this mean that I can develop an Android application by forking the front-end code via GitHub, while also having the possibility to use your servers? If this is the case, could you answer the following:

  • Will this solution be free?
  • What is the solution if one needs to perform tasks on servers/backend code?
  • Are you aware of anyone who has used this solution but needed to perform tasks on the server/backend code?

Chiming in here as this is interesting:
if you've forked off the android app, you would still need a valid project in order to access/modify your related database(s). the app needs something to apply what it does to!

I did not know this was possible - not that many would even have the capacity to do something with this!

think of this way: The front end comes with a bunch of buttons and whistles that does stuff on the mobile device and makes calls to server to pull and push data back and forth.

this is more of a classic Server-Client application if I understand things correctly except that many operations can happen client side only.

I am also in Oslo, would be happy to chat separately

I just realized I may have misinterpreted this line earlier

Say I've developed an application with "drag and drop" through one of your subscriptions. I also want to add a customized function that isn't offered by "drag and drop."

The form builder in CommCareHQ produces XForm documents which are interpreted by CommCare mobile. There are probably some things possible to do in XForms that you can't express via the form builder GUI (though I'm having trouble thinking of a useful example). If you did need to do this, you can modify the XForm directly (it's an XML-based spec) as described here:

https://dimagi.atlassian.net/wiki/spaces/commcarepublic/pages/2143957308/Form+Builder#Overview

This is a bit of a maintenance burden, however, and parts or all of the form might not be editable in form builder anymore. Definitely not something I'd recommend if it can be avoided.

And @Mazz is correct. You would still need a server, and using Dimagi's servers would still require one of Dimagi's subscription plans.

this is more of a classic Server-Client application if I understand things correctly except that many operations can happen client side only.

That's right. CommCareHQ has a series of APIs that you can use to integrate with it. CommCare Android is a client app that interacts with CommCareHQ via these APIs, primarily the restore API and the submission API. You could build an entirely custom client app using those same endpoints. CommCare Android is also open source, so you can fork it and use that as your client app.

In practice, I think most projects that do customizations do them to supplement (not replace) the standard tooling. For instance, they may use the form submission API to submit data from another system, or us an app callout to connect to a specialized piece of hardware.

More common still is using CommCare and CommCareHQ for data collection and user management and then extracting that data via APIs, exports, or others for analysis in a BI tool.

Thanks for the detailed answers, @Mazz and @Ethan_Soergel.

I'm a bit unsure if I understood it completely correctly. So if I want to build a client app by using CommCare Android, I can use the APIs that CommCareHQ offers. This requires that I have a CommCareHQ project (either a project I run on my own servers or via Dimagi's servers, which requires a subscription). Is that correct?

@Mazz, I'd be happy to have a chat about this separately