{"id":18002852,"url":"https://github.com/samueljseay/firebase-repository","last_synced_at":"2026-04-28T11:03:24.750Z","repository":{"id":150249358,"uuid":"100997604","full_name":"samueljseay/firebase-repository","owner":"samueljseay","description":"Experimental Firebase DB wrapper","archived":false,"fork":false,"pushed_at":"2017-08-29T22:52:00.000Z","size":2829,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"master","last_synced_at":"2025-04-04T09:15:22.234Z","etag":null,"topics":["firebase","firebase-database","firebase-db","javascript"],"latest_commit_sha":null,"homepage":null,"language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/samueljseay.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"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":"2017-08-21T22:26:23.000Z","updated_at":"2019-01-06T16:10:27.000Z","dependencies_parsed_at":"2023-08-27T20:47:25.057Z","dependency_job_id":null,"html_url":"https://github.com/samueljseay/firebase-repository","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/samueljseay/firebase-repository","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/samueljseay%2Ffirebase-repository","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/samueljseay%2Ffirebase-repository/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/samueljseay%2Ffirebase-repository/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/samueljseay%2Ffirebase-repository/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/samueljseay","download_url":"https://codeload.github.com/samueljseay/firebase-repository/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/samueljseay%2Ffirebase-repository/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":32377599,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-28T09:24:15.638Z","status":"ssl_error","status_checked_at":"2026-04-28T09:24:15.071Z","response_time":56,"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":["firebase","firebase-database","firebase-db","javascript"],"created_at":"2024-10-29T23:24:13.660Z","updated_at":"2026-04-28T11:03:24.715Z","avatar_url":"https://github.com/samueljseay.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Firebase Repository Experiment\n\n## Description\n\nThe aim of this experiment is to explore how I'd create a set of API's for a reusable set of Firebase models across projects, and also support features like soft-delete, simple relationship look ups and integrate\nthe features of things like Querybase to allow more complicated queries.\n\nAn API like that of Elixir's Ecto is attractive as it deals with some of the issues and coupling that Active Record suffers from.\n\n## API\n\n```javascript\nconst firebase = require('firebase')\nconst config = require('./config')\nconst Model = require('../src/model')\nconst Repository = require('../src/repository')\n\nfirebase.initializeApp(config)\n\nconst Fish = new Model({\n  paths: {\n    all: 'fish',\n    byID: 'fish/{id}'\n  },\n  softDelete: true,\n  schema: {\n    name: {\n      defaultValue: 'unknown'\n    },\n    length: {\n      defaultValue: 'unknown'\n    },\n    color: {\n      defaultValue: 'unknown'\n    }\n  }\n})\n\nconst ExampleRepo = new Repository(firebase.database())\n\nExampleRepo.onChildAdded(Fish.all(), (fish) =\u003e {\n  console.log(fish)\n})\n\nExampleRepo.onValue(Fish.byID({ id: '-KsIerpk2pBVdsGgkXWq' }), (fish) =\u003e {\n  console.log('*** fish by id ***')\n  console.log(fish)\n})\n\n// Red Cod will be created with a default value of 'unknown' for the length property\nExampleRepo.push(Fish, { name: 'Red Cod', color: 'red' }).then(() =\u003e {\n  console.log('done')\n})\n```\n\n## TODO\n\n1. Define an API for custom querying of models (could/should we support Querybase?)\n2. What else do schemas do? provide ways to support more rich data types? How does validation look?\n3. Use babel\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsamueljseay%2Ffirebase-repository","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsamueljseay%2Ffirebase-repository","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsamueljseay%2Ffirebase-repository/lists"}