{"id":29924948,"url":"https://github.com/musichin/fireko","last_synced_at":"2026-05-06T17:34:40.143Z","repository":{"id":37939434,"uuid":"272263347","full_name":"musichin/fireko","owner":"musichin","description":"Firestore Kotlin Data Convertor","archived":false,"fork":false,"pushed_at":"2023-01-20T00:16:05.000Z","size":201,"stargazers_count":2,"open_issues_count":5,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-08-21T16:04:06.648Z","etag":null,"topics":["android","firebase","firestore","kotlin","kotlin-android","kotlin-library"],"latest_commit_sha":null,"homepage":"","language":"Kotlin","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/musichin.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":"2020-06-14T18:47:17.000Z","updated_at":"2021-09-14T12:01:02.000Z","dependencies_parsed_at":"2023-01-20T23:15:46.989Z","dependency_job_id":null,"html_url":"https://github.com/musichin/fireko","commit_stats":null,"previous_names":[],"tags_count":14,"template":false,"template_full_name":null,"purl":"pkg:github/musichin/fireko","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/musichin%2Ffireko","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/musichin%2Ffireko/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/musichin%2Ffireko/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/musichin%2Ffireko/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/musichin","download_url":"https://codeload.github.com/musichin/fireko/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/musichin%2Ffireko/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":32704544,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-06T08:33:17.875Z","status":"ssl_error","status_checked_at":"2026-05-06T08:33:17.221Z","response_time":117,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.6:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"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":["android","firebase","firestore","kotlin","kotlin-android","kotlin-library"],"created_at":"2025-08-02T11:10:20.585Z","updated_at":"2026-05-06T17:34:40.120Z","avatar_url":"https://github.com/musichin.png","language":"Kotlin","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Firestore Kotlin Data Convertor\n[![Kotlin](https://img.shields.io/badge/Kotlin-1.5.30-blue.svg)](http://kotlinlang.org)\n[![CI](https://github.com/musichin/fireko/actions/workflows/ci.yml/badge.svg)](https://github.com/musichin/fireko/actions/workflows/ci.yml)\n\nFireko does generate functions to convert `DocumentSnapshot` to your (data) classes. What you have to do is to annotate it with `Fireko` and the rest is done automatically.\n\nAdvantages over using [DocumentSnapshot::toObject](https://firebase.google.com/docs/reference/android/com/google/firebase/firestore/DocumentSnapshot#toObject(java.lang.Class%3CT%3E)):\n* Empty constructor is not required\n* No reflections\n* More types\n\n## Usage\n```kotlin\n@Fireko\ndata class User(\n    @DocumentId val id: String,\n    val firstName: String, \n    val lastName: String,\n    @ServerTimestamp val createdAt: Instant? = null,\n    @Embedded val address: Address,\n    val position: LatLng,\n)\n\n@Fireko\ndata class Address(\n    val street: String,\n    val city: String,\n    @PropertyName(\"zip_code\") val zipCode: String,\n    val country: String,\n)\n\n@FirekoAdapter(LatLngAdapter::class)\ndata class LatLng(val lat: Double, val lng: Double)\n\nobject LatLngAdapter {\n    @FirekoAdapter.Read\n    fun read(value: GeoPoint): LatLng = value.run { LatLng(latitude, longitude) }\n\n    @FirekoAdapter.Write\n    fun write(value: LatLng): GeoPoint = value.run { GeoPoint(lat, lng) }\n}\n\n\n// query user\nFirebaseFirestore.getInstance()\n    .collection(\"users\")\n    .document(\"user1\")\n    .addSnapshotListener { snapshot, _ -\u003e\n        val user = snapshot?.toUser() // toUser is generated\n        // ...\n    }\n\n// store user\nFirebaseFirestore.getInstance()\n    .collection(\"users\")\n    .document(\"user1\")\n    .set(user.toMap()) // toMap is generated\n    .addOnCompleteListener { \n        // ...\n    }\n```\n\n## Additional supported types:\n* `java.time.*`\n* `org.threeten.bp.*`\n* `java.net.URI`\n* `java.net.URL`\n* `android.net.Uri`\n* `java.util.Currency`\n* `android.icu.util.Currency`\n\n## Binaries\n```groovy\nrepositories {\n    mavenCentral()\n}\n\ndependencies {\n    def fireko_version = 'x.y.z'\n    compileOnly \"de.musichin.fireko:fireko:$fireko_version\"\n    kapt \"de.musichin.fireko:fireko-codegen:$fireko_version\"\n}\n```\n\n## Contributing\nContributors are more than welcome. Just upload a PR with a description of your changes.\n\n## Issues or feature requests?\nFile github issues for anything that is unexpectedly broken.\n\n## License\n\n    MIT License\n\n    Copyright (c) 2020 Anton Musichin\n\n    Permission is hereby granted, free of charge, to any person obtaining a copy\n    of this software and associated documentation files (the \"Software\"), to deal\n    in the Software without restriction, including without limitation the rights\n    to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n    copies of the Software, and to permit persons to whom the Software is\n    furnished to do so, subject to the following conditions:\n\n    The above copyright notice and this permission notice shall be included in all\n    copies or substantial portions of the Software.\n\n    THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n    IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n    FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n    AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n    LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n    OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n    SOFTWARE.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmusichin%2Ffireko","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmusichin%2Ffireko","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmusichin%2Ffireko/lists"}