{"id":17125494,"url":"https://github.com/ijzerenhein/firestorter","last_synced_at":"2025-05-15T06:04:29.752Z","repository":{"id":26584027,"uuid":"109278152","full_name":"IjzerenHein/firestorter","owner":"IjzerenHein","description":"Use Google Firestore in React with zero effort, using MobX 🤘","archived":false,"fork":false,"pushed_at":"2025-02-07T10:39:58.000Z","size":10701,"stargazers_count":383,"open_issues_count":23,"forks_count":50,"subscribers_count":12,"default_branch":"main","last_synced_at":"2025-05-15T06:03:45.573Z","etag":null,"topics":["firestore-collection","firestore-mobx","firestore-models","firestore-react","firestoreter","mox-firestore","react-firestore"],"latest_commit_sha":null,"homepage":"https://ijzerenhein.github.io/firestorter","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/IjzerenHein.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":".github/FUNDING.yml","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},"funding":{"github":"IjzerenHein"}},"created_at":"2017-11-02T14:49:27.000Z","updated_at":"2025-03-01T17:36:18.000Z","dependencies_parsed_at":"2024-01-05T20:58:10.686Z","dependency_job_id":"4c66f276-5a39-4bef-a6c7-15aa8d110526","html_url":"https://github.com/IjzerenHein/firestorter","commit_stats":{"total_commits":443,"total_committers":9,"mean_commits":49.22222222222222,"dds":0.02257336343115124,"last_synced_commit":"e4d8e28ee256968050a9f43ebd0afd7ae007b859"},"previous_names":["ijzerenhein/react-firestore-mobx"],"tags_count":59,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/IjzerenHein%2Ffirestorter","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/IjzerenHein%2Ffirestorter/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/IjzerenHein%2Ffirestorter/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/IjzerenHein%2Ffirestorter/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/IjzerenHein","download_url":"https://codeload.github.com/IjzerenHein/firestorter/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":254283339,"owners_count":22045140,"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":["firestore-collection","firestore-mobx","firestore-models","firestore-react","firestoreter","mox-firestore","react-firestore"],"created_at":"2024-10-14T18:45:01.642Z","updated_at":"2025-05-15T06:04:29.726Z","avatar_url":"https://github.com/IjzerenHein.png","language":"TypeScript","funding_links":["https://github.com/sponsors/IjzerenHein","https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick\u0026hosted_button_id=C7KAZKHW6MXYL"],"categories":[],"sub_categories":[],"readme":"\u003c!-- prettier-ignore --\u003e\n\u003ch1 align=\"center\"\u003e\n  \u003cimg src=\"./docs/_media/logo.jpg\" /\u003e\u003cbr\u003e\n  Firestorter\n\u003c/h1\u003e\n\n\u003cspan class=\"badge-npmversion\"\u003e\u003ca href=\"https://www.npmjs.com/package/firestorter\" title=\"View this project on NPM\"\u003e\u003cimg src=\"https://img.shields.io/npm/v/firestorter.svg\" alt=\"NPM version\" /\u003e\u003c/a\u003e\u003c/span\u003e\n![Build Status](https://github.com/IjzerenHein/firestorter/workflows/build/badge.svg)\n[![codecov](https://codecov.io/gh/IjzerenHein/firestorter/branch/main/graph/badge.svg)](https://codecov.io/gh/IjzerenHein/firestorter)\n[![MIT licensed](https://img.shields.io/badge/license-MIT-blue.svg)](https://raw.githubusercontent.com/IjzerenHein/firestorter/main/LICENSE.txt)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Release Notes](https://release-notes.com/badges/v1.svg)](https://release-notes.com/@IjzerenHein/Firestorter)\n[![Donate](https://img.shields.io/badge/Donate-PayPal-green.svg)](https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick\u0026hosted_button_id=C7KAZKHW6MXYL)\n\n\u003e Use Google Firestore in React with zero effort, using MobX 🤘\n\n* 🎶 Simple, easy to use API, get up \u0026 running in minutes\n* 🚀 Fast, only fetches and re-renders data when needed\n* 🤘 No clutter, no complex stores/providers/actions/reducers, just go\n\nThe latest version is compatible with the **Firebase v9 API**.\n\n```sh\nyarn add firestorter\n```\n\n**1. Initialize**\n\n```js\nimport { initializeApp } from 'firebase/app';\nimport { getFirestore } from 'firebase/firestore';\nimport { initFirestorter } from 'firestorter';\nimport makeWebContext from 'firestorter/web';\n\n// Initialize firebase app\nconst app = initializeApp({ ... });\nconst firestore = getFirestore(app);\n\n// Initialize `firestorter`\ninitFirestorter(makeWebContext({ firestore }));\n```\n\u003e See here on how to use with [react-native](https://ijzerenhein.github.io/firestorter/#/./guides/Installation.md?id=usage-with-react-native), [compat mode](https://ijzerenhein.github.io/firestorter/#/./guides/Installation.md?id=usage-with-compat-mode) and [older firebase SDKs](https://ijzerenhein.github.io/firestorter/#/./guides/Installation.md?id=usage-with-older-javascript-sdks-lt-v8).\n\n**2. Create a `Collection` or `Document`**\n\n```js\nimport { Collection, Document } from 'firestorter';\n\nconst todos = new Collection('todos');\nconst user = new Document('users/8273872***');\n```\n\n**3. Wrap your Components with mobx's `observer` pattern**\n```jsx\nimport * as React from 'react';\nimport { observer } from 'mobx-react';\n\nconst Todos = observer(() =\u003e {\n  return \u003cdiv\u003e\n    {todos.docs.map((doc) =\u003e (\n      \u003cTodoItem\n        key={doc.id}\n        doc={doc} /\u003e\n    ))}\n  \u003c/div\u003e;\n});\n\nconst TodoItem = observer(({doc}) =\u003e {\n  const { finished, text } = doc.data;\n  return \u003cdiv\u003e\n    \u003cinput type='checkbox' checked={finished} /\u003e\n    \u003cinput type='text' value={text} /\u003e\n  \u003c/div\u003e;\n});\n```\n\n**That's it.** Your Components will now render your firestore data\nand re-render when data in the back-end changes.\n\n## How it works\n\nFirestorter makes integrating Firestore real-time data into React easy as pie. It does this by providing a simple API for accessing Collection and Document data, whilst taking away the burden of managing snapshot listeners, data-caching and efficiently updating your React components.\n\nIt does this by intelligently tracking whether a Collection or Document should be listening for real-time updates (`onSnapshot` events) or not. Whenever a Component renders a Collection or Document, firestorter enables real-time updates on that resource. And whenever a Component stops using the resource _(e.g., component was unmounted)_, it stops listening for snapshot updates. This behavior really shines when multiple components are rendering collection/document data and it becomes more difficult to determine whether snapshot updates should be enabled or not.\n\n## Features\n\n- [Add, update \u0026 delete documents](https://ijzerenhein.github.io/firestorter/#/./guides/AddUpdateDelete.md)\n- [Super efficient Component re-rendering](https://ijzerenhein.github.io/firestorter/#/./guides/FetchingData.md?id=automatic-fetching)\n- [Declaratively link document/collection paths to document data](https://ijzerenhein.github.io/firestorter/#/./guides/SourcesPathsAndReferences.md?id=reactive-path-functions)\n- [Geo query support](https://ijzerenhein.github.io/firestorter/#/./guides/GeoQueries.md)\n- [Easily create aggregate collections from multiple queries](https://ijzerenhein.github.io/firestorter/#/./guides/AggregateCollections.md)\n- [Runtime schema validation](https://ijzerenhein.github.io/firestorter/#/./guides/SchemaValidation.md) \u0026 [Type Generics](https://ijzerenhein.github.io/firestorter/#/./guides/Generics.md)\n- [Manual fetching mode for use with Unit-tests/Async-functions](https://ijzerenhein.github.io/firestorter/#/./guides/FetchModes.md)\n- [React-native support](https://ijzerenhein.github.io/firestorter/#/./guides/Installation.md?id=usage-with-react-native)\n- [TypeScript- \u0026 Flow typings](https://ijzerenhein.github.io/firestorter/#/./guides/Generics.md)\n- Works with Vue.js\n\n\nWant to learn more, head over to the [docs](https://ijzerenhein.github.io/firestorter) 🤘\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fijzerenhein%2Ffirestorter","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fijzerenhein%2Ffirestorter","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fijzerenhein%2Ffirestorter/lists"}