{"id":19688176,"url":"https://github.com/behrad-kzm/firefast","last_synced_at":"2025-07-02T17:03:13.099Z","repository":{"id":47285108,"uuid":"340975653","full_name":"behrad-kzm/FireFast","owner":"behrad-kzm","description":"A powerful library over Firebase with Codable support and super easy function","archived":false,"fork":false,"pushed_at":"2021-10-21T10:27:26.000Z","size":38467,"stargazers_count":6,"open_issues_count":0,"forks_count":1,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-04-14T13:21:39.298Z","etag":null,"topics":["firebase","firefast","firestore","serverless"],"latest_commit_sha":null,"homepage":"","language":"Swift","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/behrad-kzm.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2021-02-21T18:39:30.000Z","updated_at":"2022-08-24T06:18:22.000Z","dependencies_parsed_at":"2022-08-20T20:20:38.399Z","dependency_job_id":null,"html_url":"https://github.com/behrad-kzm/FireFast","commit_stats":null,"previous_names":[],"tags_count":34,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/behrad-kzm%2FFireFast","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/behrad-kzm%2FFireFast/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/behrad-kzm%2FFireFast/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/behrad-kzm%2FFireFast/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/behrad-kzm","download_url":"https://codeload.github.com/behrad-kzm/FireFast/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":251465161,"owners_count":21593836,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["firebase","firefast","firestore","serverless"],"created_at":"2024-11-11T18:37:12.001Z","updated_at":"2025-04-29T08:34:26.002Z","avatar_url":"https://github.com/behrad-kzm.png","language":"Swift","funding_links":[],"categories":[],"sub_categories":[],"readme":"# FireFast\n\n[![CI Status](https://img.shields.io/travis/behrad-kzm/FireFast.svg?style=flat)](https://travis-ci.org/behrad-kzm/FireFast)\n[![Version](https://img.shields.io/cocoapods/v/FireFast.svg?style=flat)](https://cocoapods.org/pods/FireFast)\n[![License](https://img.shields.io/cocoapods/l/FireFast.svg?style=flat)](https://cocoapods.org/pods/FireFast)\n[![Platform](https://img.shields.io/cocoapods/p/FireFast.svg?style=flat)](https://cocoapods.org/pods/FireFast)\n\n\u003cimg src=\"https://github.com/behrad-kzm/FireFast/blob/main/FireFastAppIcon.png\"\u003e\n\n## Example\n\nTo run the example project, clone the repo, and run `pod install` from the Example directory first.\n\n### Authentications\n\nThere are couple of functions in `FireFast.UseCaseProvider.makeAuthUseCases()`, you can use to authenticate users with the Firebase:\n\n ```ruby\n    public protocol AuthUseCasesProtocol {\n  \n        func getPasswordSignInMethods() -\u003e PasswordAuthProtocol\n        func getPhoneNumberSignInMethods() -\u003e PhoneAuthProtocol\n        func getSignInMethod(forType: SignInMethodType) -\u003e CommonAuthProtocol\n\n        func getUser() -\u003e AuthorizationResponseModel?\n        func signOut() throws\n}\n```\nset delegates inside the AppDelegate so everything will be handled by the FireFast:\n\n```ruby\nclass AppDelegate: UIResponder, UIApplicationDelegate {\n  var window: UIWindow?\n  func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?) -\u003e Bool {\n    FireFast.UseCaseProvider.application(application: application, didFinishLaunchingWithOptions: launchOptions)\n    return true\n  }\n  \n  func application(_ app: UIApplication, open url: URL, options: [UIApplication.OpenURLOptionsKey : Any] = [:]) -\u003e Bool {\n    return FireFast.UseCaseProvider.application(application: app, open: url, options: options)\n  }\n}\n\n```\n\nThere is a complete example in this repo so you can download the project and check it, BUT if your busy or lazy like me, check this:\n```ruby\n    let authenticator = FireFast.UseCaseProvider.makeAuthUseCases()\n    \n    //Sign-in with email and  \n    authenticator.getPasswordSignInMethods().signInWith(email: email, password: password) { [unowned self](loginInfo) -\u003e (Void) in\n      print(\"success\")\n    } onError: { [unowned self](error) -\u003e (Void) in\n      print(\"\\(error.localizedDescription)\")\n    }\n\n    authenticator.getSignInMethod(forType: .apple).presentSignIn(on: self) { [unowned self](loginInfo) -\u003e (Void) in\n      print(\"success \\(loginInfo.email), \\(loginInfo.name)\")\n    } onError: { [unowned self](error) -\u003e (Void) in\n      print(\"\\(error.localizedDescription)\")\n    }\n```\n##### Sign-In Configurations\n\nYou don't need to write codes for each sign-in methods but you must do some configurations in the project to work fine.\nbefore continue enable each sign-in method from the firebase console then follow these steps:\n\n- For Google sign-in you need to download 'GoogleService-Info.plist' from the Firebase console and create a url scheme in your project configurations [More](https://firebase.google.com/docs/auth/ios/google-signin#2_implement_google_sign-in).\n- For Apple sign-in you need to add a capability of Apple sign to your project [More](https://medium.com/@priya_talreja/sign-in-with-apple-using-swift-5cd8695a46b6)\n- For Facebook sign-in you need to go to the Developers.Facebook.com and create an app then fill required informations [More](https://developers.facebook.com/docs/facebook-login/ios).\n  \n### Cloud functions\n\nFireFast support calling Cloud Functions with a super easy use-case inside `FireFast.UseCaseProvider.makeCloudFunctionUseCases()`\nYou can send a dictionary and receive a generic codable. no more extra code!\n\n```ruby\npublic protocol FunctionUseCasesProtocol {\n  \n  func call\u003cT: Codable\u003e(name: String, parameters: [String: Any]?, onSuccess: @escaping (T) -\u003e Void, onError: ((Error) -\u003e Void)?)\n}\n``` \n \n### Firestore\n\nThere is an amazing structure of GenericCollection which accepts a codable inside `FireFast.UseCaseProvider.makeFirestoreUseCases()` and provides complete use-cases for quering firestore, or making an AutoPaginator to paginate a query automatically:\n\n```ruby\npublic struct GenericCollection\u003cT: Codable\u003e {\n     public func paginate() -\u003e AutoPaginator\u003cT\u003e\n     public func get(documentId id: String, onSuccess: @escaping ((T?) -\u003e Void), onError: ((Error) -\u003e Void)?)\n     public func getAll( onSuccess: @escaping (([T]) -\u003e Void), onError: ((Error) -\u003e Void)?)\n     public func find(query: @escaping (CollectionReference) -\u003e Query, onSuccess: @escaping (([T]) -\u003e Void), onError: ((Error) -\u003e Void)?)\n     public func upsert(dictionary: [String: Any], withId id: String? = nil, completionHandler: ((Error?) -\u003e Void)?)\n     public func upsert(document: T, withId id: String? = nil, completionHandler: ((Error?) -\u003e Void)?)\n     public func update(document: T, forDocumentId id: String, completionHandler: ((Error?) -\u003e Void)?)\n     public func update(fields: [String: Any], forDocumentId id: String, completionHandler: ((Error?) -\u003e Void)?)\n     public func delete(fieldNames: [String], fromDocumentWithId id: String, completionHandler: ((Error?) -\u003e Void)?)\n     public func delete(documentId id: String, completionHandler: ((Error?) -\u003e Void)?)\n}\n```\n\n### Cloud Storage\nWorking with cloud storage is pretty fun with the FireFast. you can access to the use cases inside `FireFast.UseCaseProvider.makeCloudFunctionUseCases()`.\nYou can upload, create url of the document or delete it easily:\n```ruby\npublic protocol StorageUseCaseProtocol {\n  \n     func upload(data: Data, path: String, onSuccess: @escaping (UploadInfoModel) -\u003e Void, onError: ((Error) -\u003e Void)?)\n     func makeURL(path: String, onSuccess: @escaping (URL) -\u003e Void, onError: ((Error) -\u003e Void)?)\n     func delete(path: String, completion: ((Error?) -\u003e Void)?)\n}\n```\n\n### Remote Config\nThere are couple of function and a generic one to get data from remote config. all of the are accessible with `FireFast.UseCaseProvider.makeRemoteConfigUseCases()`.\n\n```ruby \npublic protocol RemoteConfigUseCasesProtocol {\n  \n  func get\u003cT: Codable\u003e(key: String, onSuccess: @escaping (T) -\u003e Void, onError: ((Error) -\u003e Void)?)\n  func get(key: String, onSuccess: @escaping (Bool) -\u003e Void, onError: ((Error) -\u003e Void)?)\n  func get(key: String, onSuccess: @escaping (String) -\u003e Void, onError: ((Error) -\u003e Void)?)\n  func get(key: String, onSuccess: @escaping (NSNumber) -\u003e Void, onError: ((Error) -\u003e Void)?)\n  func get(key: String, onSuccess: @escaping (Data) -\u003e Void, onError: ((Error) -\u003e Void)?)\n}\n\n```\n## Note\n\nIf you think this repo need to have new usecase feel free to add an issue or send a pull request.\n\n## Installation\n\nFireFast is available through [CocoaPods](https://cocoapods.org). To install\nit, simply add the following line to your Podfile:\n\n```ruby\npod 'FireFast'\n```\n\n## Author\n\nbehrad-kzm, behrad.kzm@gmail.com\n\n## License\n\nFireFast is available under the MIT license. See the LICENSE file for more info.\n\n\u003cimg src=\"https://github.com/behrad-kzm/BEKDesing/blob/master/Images/BEKHeader.png\"\u003e\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbehrad-kzm%2Ffirefast","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fbehrad-kzm%2Ffirefast","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbehrad-kzm%2Ffirefast/lists"}