This repository contains the Spezi Template Application. It demonstrates using the Spezi framework template and builds on top of the Stanford Biodesign Digital Health Template Application.
Note
Do you want to try out the Spezi Template Application? You can download it to your iOS device using TestFlight!
The Spezi Template Application uses a modularized structure using the Spezi modules enabled by the Swift Package Manager.
The application uses HL7 FHIR and the Spezi FHIR
module to provide a common standard to encode data gathered by the application as defined in the Spezi Standard
found in the application.
You can learn more about the Spezi standards-based software architecture in the Spezi documentation.
You can build and run the application using Xcode by opening up the TemplateApplication.xcodeproj.
You can start using the application without any additional installations if you use the --disableFirebase
feature flag, enabled by default when opening the Xcode project. The login and account setup is skipped in this configuration.
The application also provides a Firebase Firestore-based data upload and Firebase Authentication login & sign-up. It is required to have the Firebase Emulator Suite to be up and running to use these features to build and test the application locally. Please follow the installation instructions.
You do not have to make any modifications to the Firebase configuration, login into the firebase
CLI using your Google account, or create a project in Firebase to run, build, and test the application!
Startup the Firebase Emulator Suite using
$ firebase emulators:start
After the emulators have started up, you can run the application in your simulator to build, test, and run the application and see the results show up in Firebase.
The application also includes the following feature flags that can be configured in the scheme editor in Xcode and selecting the TemplateApplication scheme, the Run configuration, and to switch to the Arguments tab to add, enable, disable, or remove the following arguments passed on launch:
--skipOnboarding
: Skips the onboarding flow to enable easier development of features in the application and to allow UI tests to skip the onboarding flow.--showOnboarding
: Always show the onboarding when the application is launched. Makes it easy to modify and test the onboarding flow without the need to manually remove the application or reset the simulator.--disableFirebase
: Disables the Firebase interactions, including the login/sign-up step and the Firebase Firestore upload.--useFirebaseEmulator
: Defines if the application should connect to the local Firebase emulator. Always set to true when using the iOS simulator.
The onboarding contains different steps. It uses the Spezi Onboarding module to display different onboarding-related views like the information about the application, a consent screen, and a screen to display a HealthKit consent view.
The scheduler part of the application provides the functionality to schedule a recurring task and bind it to an action, e.g., displaying a questionnaire.
It uses the Spezi Scheduler and Spezi Questionnaire modules to schedule the tasks as defined in the TemplateApplicationScheduler
.
The Contacts part of the application provides the functionality to display contact information in your application. It uses the Spezi Contacts module to use the contact-related views provided by Spezi.
The mock upload view allows a developer to get an overview of the data synchronization between the application and a cloud storage provider.
It is shown in the application when the --disableFirebase
configuration flag is active.
It uses the Spezi Mock Web Service module to enable this functionality.
The Spezi Template application includes continuous integration (CI) and continuous delivery (CD) setup.
- Automatically build and test the application on every pull request before deploying it. If your organization doesn't have a self-hosted macOS runner modeled after the setup in the StanfordBDHG ContinuousIntegration setup, you will need to remove the
runsonlabels
arguments in thebuild-and-test.yml
file to ensure that the build runs on the default macOS runners provided by GitHub. - An automated setup to deploy the application to TestFlight every time there is a new commit on the repository's main branch.
- Ensure a coherent code style by checking the conformance to the SwiftLint rules defined in
.swiftlint.yml
on every pull request and commit. - Ensure conformance to the REUSE Specification to property license the application and all related code.
Please refer to the Stanford Biodesign Digital Health Template Application and the ContinuousDelivery Example by Paul Schmiedmayer for more background about the CI and CD setup for the Spezi Template Application.
Contributions to this project are welcome. Please make sure to read the contribution guidelines and the contributor covenant code of conduct first.
This project is based on ContinuousDelivery Example by Paul Schmiedmayer and the Stanford Biodesign Digital Health Template Application provided using the MIT license.
This project is licensed under the MIT License. See Licenses for more information.