{"id":42166171,"url":"https://github.com/rgdevme/fireborm","last_synced_at":"2026-01-26T21:03:59.219Z","repository":{"id":246983780,"uuid":"824204373","full_name":"rgdevme/fireborm","owner":"rgdevme","description":"A Firebase ORM-like wrapper, inspired by packages like sequelize and mongoose","archived":false,"fork":false,"pushed_at":"2025-09-05T21:26:15.000Z","size":298,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-10-11T00:54:11.123Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"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/rgdevme.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,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2024-07-04T15:20:00.000Z","updated_at":"2025-09-05T21:26:17.000Z","dependencies_parsed_at":"2024-07-06T02:56:30.648Z","dependency_job_id":"d14c3e7d-bd53-4417-8267-e79f45cbf71a","html_url":"https://github.com/rgdevme/fireborm","commit_stats":null,"previous_names":["rgdevme/fireborm"],"tags_count":22,"template":false,"template_full_name":null,"purl":"pkg:github/rgdevme/fireborm","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rgdevme%2Ffireborm","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rgdevme%2Ffireborm/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rgdevme%2Ffireborm/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rgdevme%2Ffireborm/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/rgdevme","download_url":"https://codeload.github.com/rgdevme/fireborm/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rgdevme%2Ffireborm/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28788095,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-26T21:02:48.137Z","status":"ssl_error","status_checked_at":"2026-01-26T21:01:13.039Z","response_time":59,"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":[],"created_at":"2026-01-26T21:03:51.802Z","updated_at":"2026-01-26T21:03:59.203Z","avatar_url":"https://github.com/rgdevme.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# FireBorm\n\nA Firebase ORM-like wrapper, inspired by packages like sequelize and mongoose.\n\n## Why?\n\nUsing the firebase sdk to fetch data from Firestore and transform it to the model we use on the apps can sometimes be verbose.\n\nThis package solves this issue using an approach inspired in sequelize or mongoose.\n\n# Usage\n\nInitializing fireborm also handles the firebase initialization, as well as emulators initialization.\n\n```ts\n// ./index.ts\n\nimport { FireBorm } from 'fireborm'\n\n// Firebase config file\nimport { firebaseConfig } from '../../firebase-config'\n\n// Initialize Fireborm singleton\nconst fireborm = new Fireborm(config, settings)\n```\n\n## Stores\n\nStores correspond to Collections. The store class provides end-to-end type hinting without much hassle.\n\nDeclare a store by calling `fireborm.createStore()` and providing the arguments.\n\n```ts\n// ./store.ts\n\nexport const MyStore = fireborm.createStore\u003c\n\tDocumentSchema, // Shape of the document in Firebase\n\tModelSchema, // Shape of the transformed document, used in the app\n\tCreationSchema, // Shape of the minimum required data for creation\n\tDefaultSchema // Shape of the default object data\n\u003e({\n\tpath: 'path-without-spaces',\n\tplural: 'Plural name',\n\tsingular: 'Singular name',\n\tdefaultData: {\n\t\t// as DefaultSchema, or DocumentSchema if omited\n\t\tid: crypto.randomUUID(),\n\t\tname: '',\n\t\tcreatedAt: new Date()\n\t},\n\ttoModel: document =\u003e ({\n\t\t// Transforms DocumentSchema to ModelSchema\n\t\t...document.data(),\n\t\tid: document.id\n\t}),\n\ttoDocument: ({ id, ...model }) =\u003e {\n\t\t// Transforms ModelSchema to DocumentSchema\n\t\treturn model\n\t}\n})\n```\n\nThen use the store in any file like:\n\n```ts\n// ./component.tsx\n\nstore.count({ onChange: count =\u003e setCount(count) })\n\nuseEffect(() =\u003e {\n\tstore.subscribeMany({ onChange: res =\u003e setData(res) })\n}, [store, getQuery])\n```\n\n## Storages\n\nEach Storage corresponds to a collection.\n\nYou declare each storage by calling `fireborm.initializeStorage()` and providing the arguments.\n\nMore information about the arguments, and the class returned will be added soon.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frgdevme%2Ffireborm","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Frgdevme%2Ffireborm","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frgdevme%2Ffireborm/lists"}