{"id":18788107,"url":"https://github.com/thdk/firestorable","last_synced_at":"2026-05-06T13:39:24.059Z","repository":{"id":34301167,"uuid":"176103832","full_name":"thdk/firestorable","owner":"thdk","description":"Easily keep your react app state in sync with firebase firestore database using mobx","archived":false,"fork":false,"pushed_at":"2023-03-04T05:21:22.000Z","size":3981,"stargazers_count":2,"open_issues_count":18,"forks_count":0,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-01-29T17:05:30.895Z","etag":null,"topics":["firebase","firestore","firestore-database","mobx","mobx-react","react","typescript"],"latest_commit_sha":null,"homepage":"https://www.npmjs.com/package/firestorable","language":"TypeScript","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/thdk.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE.txt","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2019-03-17T13:18:41.000Z","updated_at":"2021-12-17T07:49:28.000Z","dependencies_parsed_at":"2024-11-07T20:58:01.713Z","dependency_job_id":"b180bddf-c113-4077-bca4-0681defc736f","html_url":"https://github.com/thdk/firestorable","commit_stats":{"total_commits":128,"total_committers":3,"mean_commits":"42.666666666666664","dds":0.0703125,"last_synced_commit":"986b6d5f4a06fce698b0d19d5c5e6d6a3353e258"},"previous_names":[],"tags_count":49,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/thdk%2Ffirestorable","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/thdk%2Ffirestorable/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/thdk%2Ffirestorable/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/thdk%2Ffirestorable/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/thdk","download_url":"https://codeload.github.com/thdk/firestorable/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":239708991,"owners_count":19684165,"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","firestore","firestore-database","mobx","mobx-react","react","typescript"],"created_at":"2024-11-07T20:57:34.319Z","updated_at":"2025-10-19T17:56:55.712Z","avatar_url":"https://github.com/thdk.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Firestorable\r\n\r\nA strong typed observable wrapper using mobx for firebase firestore database.\r\n\r\n![Cloud Build](https://storage.googleapis.com/includr-badges/builds/firestorable/branches/master.svg)\r\n[![Coverage Status](https://coveralls.io/repos/github/thdk/firestorable/badge.svg?branch=master)](https://coveralls.io/github/thdk/firestorable?branch=master)\r\n\r\n## Installation\r\n\r\n```\r\nnpm install firestorable\r\n```\r\n\r\n## Firestorable - example applications\r\n\r\nThere is a separate github repo with example applications to demonstrate how to use firestorable with react and mobx.\r\n\r\n[**example applications**](https://github.com/thdk/firestorable-examples)\r\n\r\n## How to use: basic example\r\n\r\nCreate an instance of a firestorable collection:\r\n```js\r\nconst db = firebase.firestore();\r\n\r\n// create a type or interface that matches the data in the firestore collection\r\ninterface IRegistration {\r\n    time: number;\r\n    description: string;\r\n}\r\n\r\n// use the interface as generic type when creating the firestorable collection\r\nconst registrationCollection = new Collection\u003cIRegistration\u003e(\r\n  db,\r\n  \"registrations\", // name of your firestore collection\r\n);\r\n```\r\n\r\nAnd use that instance in a mobx observable react component:\r\n\r\n```jsx\r\nconst RegistrationsList = observer(() =\u003e\r\n      \u003cdiv className=\"registrations-list\"\u003e\r\n        {\r\n            // Each item in the docs property of the create Collection has a strong typed (IRegistration) data property representing the document data from the firestore 'registrations' collection.\r\n            registrationCollection.docs\r\n                .map(doc =\u003e \u003cdiv key={doc.id}\u003e\r\n                    \u003cdiv\u003eTime: {doc.data.time}\u003c/div\u003e\r\n                    \u003cdiv\u003eDescription: {doc.data.description}\u003c/div\u003e\r\n                \u003c/div\u003e)\r\n        }\r\n      \u003c/div\u003e\r\n  );\r\n});\r\n```\r\n\r\nThis RegistrationsList component will now rerender whenever changes occur in the 'registrations' collection of your firestore database.\r\n\r\n## Contributing\r\n\r\nThese instructions will get you a copy of the project for development and testing purposes.\r\n\r\n### Prerequisites\r\n\r\n#### node\r\n\r\nI assume you already have node with npm installed.\r\n\r\n#### firebase-tools\r\nYou need to have `firebase-tools` installed globally to run the firebase emulator:\r\n\r\n```sh\r\nnpm i -g firebase-tools\r\n```\r\n\r\n#### java\r\n\r\n[java](https://openjdk.java.net/install/) is required to run the tests with a firestore emulator.\r\n\r\n**Install java on linux (debian, ubuntu)**\r\n\r\n```sh\r\nsudo apt-get install openjdk-8-jre\r\n```\r\n\r\n\r\n\r\n### Installing\r\n\r\n1. Clone this repo\r\n```sh\r\ngit clone https://github.com/thdk/firestorable.git\r\n```\r\n\r\n2. Step into the new repo directory\r\n\r\n```sh\r\ncd firestorable\r\n```\r\n\r\n3. Install dependencies\r\n\r\n```sh\r\nnpm install\r\n```\r\n\r\n4. Build\r\n```sh\r\nnpm run build\r\n```\r\n\r\n### Testing\r\nBefore running the tests, you need to start to firestore emulator:\r\n```sh\r\n npm run emulator\r\n```\r\nKeep the emulator running in one terminal window and run tests in another terminal:\r\n\r\n```sh\r\n npm run test\r\n```\r\n\r\nNote: after running `npm run test` you can run `npm run coverage` to view the code coverage of the last ran tests.\r\n\r\nNote: By default emulator will use port 8080. If you need to use another port, then you have to set the port number in firebase.json.\r\n\r\nTo make sure the tests run using the port set in firebase.json, run your tests a below:\r\n\r\n```sh\r\nfirebase emulators:exec --only firestore jest\r\n```\r\n\r\nAbove command will start the emulator, run 'jest', and stop the emulator after the tests.\r\n\r\n## Built With\r\n\r\n* [mobx](https://mobx.js.org/) - Simple, scalable state management\r\n* [typescript](https://www.typescriptlang.org/) - Javascript that scales\r\n* [jest](https://jestjs.io/) - Javascript testing framework\r\n* [firebase](https://firebase.google.com/) - App development platform\r\n* [npm](https://www.npmjs.com/) - Package manager\r\n* [google cloud build](https://cloud.google.com/cloud-build/) - Build, test, and deploy on googles serverless CI/CD platform\r\n\r\n## Authors\r\n\r\n* **Thomas Dekiere** - *Initial work* - [thdk](https://github.com/thdk)\r\n\r\n## License\r\n\r\nThis project is licensed under the MIT License - see the [LICENSE.txt](LICENSE.txt) file for details\r\n\r\n\r\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fthdk%2Ffirestorable","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fthdk%2Ffirestorable","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fthdk%2Ffirestorable/lists"}