StanfordSpezi / SpeziTemplateApplication

Template application demonstrating the usage of the Stanford Spezi framework.
https://stanfordspezi.github.io/SpeziTemplateApplication
MIT License
97 stars 19 forks source link

Local Mock Mode & Cloud Storage Independence #28

Open PSchmiedmayer opened 1 year ago

PSchmiedmayer commented 1 year ago

Problem

The current version of the Spezi Template Application requires the Firebase emulator to be up and running to use and try out the template application. This is a significant hurdle for developers to get started, requires a large dependency to be bundled with the template application, and limits our ability to easily use the application for small tests where a full cloud infrastructure might not be needed.

Solution

The template application should either include a local mock mode or completely remove the dependency on Firebase in its default configuration. The mock mode should be the default setup when the application is run, and communicating with Firebase in the debug mode should be controlled by a feature flag.

If we decide that the Firebase module should be completely removed, we should add a DocC article on connecting the template application to a cloud provider and use Firebase as an example or provide a fork of the template application that demonstrates a variant of the application using Firebase.

Code of Conduct

PSchmiedmayer commented 1 year ago

Discussion wth @vishnuravi & Oliver: Maintaining a fork is a bit challenging. The entire application in the fork is the easiest for developers, it would be challenging for us to maintain. We should investigate how much the diff would be.

From a user's perspective a fork would be easier to be used.

Supereg commented 8 months ago

To add some more context, by now we incorporated a feature flag to disable firebase completely. If so, it completely disables the Account module. We could resolve this issue by additionally configuring the account module with the MockUserIdPasswordAccoutnService (which is used within our previews) to have a Mock for most of the functionality the template app supports. Apart from that, storage of HealthKit Data and Questionnaire data would need to be mocked (as we already do with the MockWebService?).

PSchmiedmayer commented 8 months ago

Yes, mocking the storage of HealthKit Data and Questionnaires can be done with the MockWebService. I could see a future where the web service actually mocks persistence and allows one to use it as a full local replacement to mock behaviour but that would require some additional work in that package which might actually be kind of interesting 🚀