Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/stanfordspezi/spezifirebase
Google Firebase Spezi Modules
https://github.com/stanfordspezi/spezifirebase
cloud firebase ios spezi stanford swift swiftui xcode
Last synced: about 2 months ago
JSON representation
Google Firebase Spezi Modules
- Host: GitHub
- URL: https://github.com/stanfordspezi/spezifirebase
- Owner: StanfordSpezi
- License: mit
- Created: 2023-02-16T06:35:04.000Z (almost 2 years ago)
- Default Branch: main
- Last Pushed: 2024-10-30T18:15:05.000Z (2 months ago)
- Last Synced: 2024-11-19T12:19:44.762Z (about 2 months ago)
- Topics: cloud, firebase, ios, spezi, stanford, swift, swiftui, xcode
- Language: Swift
- Homepage: https://swiftpackageindex.com/StanfordSpezi/SpeziFirebase/documentation/
- Size: 160 KB
- Stars: 4
- Watchers: 9
- Forks: 2
- Open Issues: 7
-
Metadata Files:
- Readme: README.md
- License: LICENSE.md
- Citation: CITATION.cff
Awesome Lists containing this project
README
# Spezi Firebase
[![Build and Test](https://github.com/StanfordSpezi/SpeziFirebase/actions/workflows/build-and-test.yml/badge.svg)](https://github.com/StanfordSpezi/SpeziFirebase/actions/workflows/build-and-test.yml)
[![codecov](https://codecov.io/gh/StanfordSpezi/SpeziFirebase/branch/main/graph/badge.svg?token=LCRkf3e2lx)](https://codecov.io/gh/StanfordSpezi/SpeziFirebase)
[![DOI](https://zenodo.org/badge/DOI/10.5281/zenodo.7706899.svg)](https://doi.org/10.5281/zenodo.7706899)
[![](https://img.shields.io/endpoint?url=https%3A%2F%2Fswiftpackageindex.com%2Fapi%2Fpackages%2FStanfordSpezi%2FSpeziFirebase%2Fbadge%3Ftype%3Dswift-versions)](https://swiftpackageindex.com/StanfordSpezi/SpeziFirebase)
[![](https://img.shields.io/endpoint?url=https%3A%2F%2Fswiftpackageindex.com%2Fapi%2Fpackages%2FStanfordSpezi%2FSpeziFirebase%2Fbadge%3Ftype%3Dplatforms)](https://swiftpackageindex.com/StanfordSpezi/SpeziFirebase)Integrate Google Firebase services into your Spezi application.
## Overview
This Module allows you to use the [Google Firebase](https://firebase.google.com/) platform as a managed backend for
authentication and data storage in your apps built with the [Spezi framework](https://github.com/StanfordSpezi/Spezi).We currently implement support for Authentication, Storage, and Firestore services.
## Setup
You need to add the Spezi Firebase Swift package to
[your app in Xcode](https://developer.apple.com/documentation/xcode/adding-package-dependencies-to-your-app#) or
[Swift package](https://developer.apple.com/documentation/xcode/creating-a-standalone-swift-package-with-xcode#Add-a-dependency-on-another-Swift-package).> [!IMPORTANT]
> If your application is not yet configured to use Spezi, follow the [Spezi setup article](https://swiftpackageindex.com/stanfordspezi/spezi/documentation/spezi/initial-setup)#
to set up the core Spezi infrastructure.## Examples
The below section walks you through the necessary steps to set up the Spezi Firebase Module for your application.
### 1. Set up your Firebase Account
To connect your app to the Firebase cloud platform, you will need to first create an account at
[firebase.google.com](https://firebase.google.com) then start the process to
[register a new iOS app](https://firebase.google.com/docs/ios/setup).Once your Spezi app is registered with Firebase, place the generated `GoogleService-Info.plist` configuration file
into the root of your Xcode project.
You do not need to add the Firebase SDKs to your app or initialize Firebase in your app,
since the Spezi Firebase Module will handle these tasks for you.You can also install and run the Firebase Local Emulator Suite for local development.
To do this, please follow the [installation instructions](https://firebase.google.com/docs/emulator-suite/install_and_configure).### 2. Add Spezi Firebase as a Dependency
First, you will need to add the SpeziFirebase Swift package to
[your app in Xcode](https://developer.apple.com/documentation/xcode/adding-package-dependencies-to-your-app#) or
[Swift package](https://developer.apple.com/documentation/xcode/creating-a-standalone-swift-package-with-xcode#Add-a-dependency-on-another-Swift-package).### 3. Register the Spezi Firebase Modules
In the example below, we configure our Spezi application to use Firebase Authentication with both email & password login
and Sign in With Apple, and Cloud Firestore for data storage.```swift
import Spezi
import SpeziAccount
import SpeziFirebaseAccount
import SpeziFirebaseStorage
import SpeziFirestore
import SwiftUIclass ExampleDelegate: SpeziAppDelegate {
override var configuration: Configuration {
Configuration {
AccountConfiguration(configuration: [
.requires(\.userId),
.collects(\.name)
])
Firestore()
FirebaseAccountConfiguration[
authenticationMethods: [.emailAndPassword, .signInWithApple]
]
}
}
}
```For more information, please refer to the [API documentation](https://swiftpackageindex.com/StanfordSpezi/SpeziFirebase/documentation).
## The Spezi Template Application
The Spezi Firebase Module comes pre-configured in the [Spezi Template Application](https://github.com/StanfordSpezi/SpeziTemplateApplication),
which is a great way to get started on your Spezi Application.## Contributing
Contributions to this project are welcome. Please make sure to read the [contribution guidelines](https://github.com/StanfordSpezi/.github/blob/main/CONTRIBUTING.md) and the [contributor covenant code of conduct](https://github.com/StanfordSpezi/.github/blob/main/CODE_OF_CONDUCT.md) first.
## License
This project is licensed under the MIT License. See [Licenses](https://github.com/StanfordSpezi/SpeziFirebase/tree/main/LICENSES) for more information.
![Spezi Footer](https://raw.githubusercontent.com/StanfordSpezi/.github/main/assets/FooterLight.png#gh-light-mode-only)
![Spezi Footer](https://raw.githubusercontent.com/StanfordSpezi/.github/main/assets/FooterDark.png#gh-dark-mode-only)