{"id":13727310,"url":"https://github.com/wovalle/fireorm","last_synced_at":"2025-05-15T12:05:51.475Z","repository":{"id":34239737,"uuid":"164746388","full_name":"wovalle/fireorm","owner":"wovalle","description":"ORM for firestore 🔥","archived":false,"fork":false,"pushed_at":"2024-07-12T22:26:32.000Z","size":2542,"stargazers_count":566,"open_issues_count":64,"forks_count":78,"subscribers_count":19,"default_branch":"master","last_synced_at":"2025-04-15T05:28:31.563Z","etag":null,"topics":["firebase","firebase-firestore","firestore","google-firebase","orm-framework","typescript","typescript-orm","willy-im"],"latest_commit_sha":null,"homepage":"https://fireorm.js.org","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/wovalle.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":"2019-01-08T22:50:14.000Z","updated_at":"2025-04-07T14:41:38.000Z","dependencies_parsed_at":"2024-04-24T10:29:01.915Z","dependency_job_id":"65186341-b112-49a9-ade5-f5bae17fcace","html_url":"https://github.com/wovalle/fireorm","commit_stats":{"total_commits":406,"total_committers":33,"mean_commits":"12.303030303030303","dds":"0.47536945812807885","last_synced_commit":"7305cbbe7c32f12d9e932abf3ed5c79f06891373"},"previous_names":[],"tags_count":45,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/wovalle%2Ffireorm","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/wovalle%2Ffireorm/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/wovalle%2Ffireorm/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/wovalle%2Ffireorm/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/wovalle","download_url":"https://codeload.github.com/wovalle/fireorm/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":254337613,"owners_count":22054253,"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","firebase-firestore","firestore","google-firebase","orm-framework","typescript","typescript-orm","willy-im"],"created_at":"2024-08-03T01:03:49.268Z","updated_at":"2025-05-15T12:05:46.465Z","avatar_url":"https://github.com/wovalle.png","language":"TypeScript","funding_links":[],"categories":["TypeScript"],"sub_categories":[],"readme":"# fireorm🔥\n\n[![NPM Version](https://img.shields.io/npm/v/fireorm.svg?style=flat)](https://www.npmjs.com/package/fireorm)\n[![Build Status](https://travis-ci.com/wovalle/fireorm.svg?token=KsyisFHzgCusk2sapuJe\u0026branch=master)](https://travis-ci.com/wovalle/fireorm)\n[![Typescript lang](https://img.shields.io/badge/Language-Typescript-Blue.svg)](https://www.typescriptlang.org)\n[![All Contributors](https://img.shields.io/badge/all_contributors-7-orange.svg?style=flat-square)](#contributors)\n[![License](https://img.shields.io/npm/l/fireorm.svg?style=flat)](https://www.npmjs.com/package/fireorm)\n\nFireorm is a tiny wrapper on top of firebase-admin that makes life easier when dealing with a Firestore database. Fireorm tries to ease the development of apps that rely on Firestore at the database layer by abstracting the access layer providing a familiar repository pattern. It basically helps us not worry about Firestore details and focus on what matters: adding cool new features!\n\nYou can read more about the motivations and features of fireorm [on its introductory post](https://medium.com/p/ba7734644684). Also, the [API documentation](https://wovalle.github.io/fireorm) is available.\n\n\u003e :warning: Due to personal and professional reasons, I am unable to continue active development and support for this project.\n\u003e\n\u003eHowever, I want to assure you that the project will remain available for use and that I will still check pull requests if needed. I encourage the community to continue to use and contribute to this project, and I hope that it will continue to be a valuable resource for developers.\n\n\n\n\n## Usage\n\n1.  Install the npm package:\n\n```bash\nyarn add fireorm reflect-metadata #or npm install fireorm reflect-metadata\n\n# note: the reflect-metadata shim is required\n```\n\n2. [Initialize](https://firebase.google.com/docs/firestore/quickstart#initialize) your Firestore application:\n\n```typescript\nimport * as admin from 'firebase-admin';\nimport * as fireorm from 'fireorm';\n\nconst serviceAccount = require('../firestore.creds.json');\n\nadmin.initializeApp({\n  credential: admin.credential.cert(serviceAccount),\n  databaseURL: `https://${serviceAccount.project_id}.firebaseio.com`,\n});\n\nconst firestore = admin.firestore();\nfireorm.initialize(firestore);\n```\n\n3.  Create your Firestore models:\n\n```typescript\nimport { Collection } from 'fireorm';\n\n@Collection()\nclass Todo {\n  id: string;\n  text: string;\n  done: Boolean;\n}\n```\n\n4.  Do cool stuff with fireorm!\n\n```typescript\nimport { Collection, getRepository } from 'fireorm';\n\n@Collection()\nclass Todo {\n  id: string;\n  text: string;\n  done: Boolean;\n}\n\nconst todoRepository = getRepository(Todo);\n\nconst todo = new Todo();\ntodo.text = \"Check fireorm's Github Repository\";\ntodo.done = false;\n\nconst todoDocument = await todoRepository.create(todo); // Create todo\nconst mySuperTodoDocument = await todoRepository.findById(todoDocument.id); // Read todo\nawait todoRepository.update(mySuperTodoDocument); // Update todo\nawait todoRepository.delete(mySuperTodoDocument.id); // Delete todo\n```\n\n### Firebase Complex Data Types\n\nFirestore has support for [complex data types](https://firebase.google.com/docs/firestore/manage-data/data-types) such as GeoPoint and Reference. Full handling of complex data types is [being handled in this issue](https://github.com/wovalle/fireorm/issues/58). Temporarily, fireorm will export [Class Transformer's @Type](https://github.com/typestack/class-transformer#working-with-nested-objects) decorator. It receives a lamda where you return the type you want to cast to. [See GeoPoint Example](https://github.com/wovalle/fireorm/blob/d8f79090b7006675f2cb5014bb5ca7a9dfbfa8c1/src/BaseFirestoreRepository.spec.ts#L471-L476).\n\n#### Limitations\n\nIf you want to cast GeoPoints to your custom class, it must have `latitude: number` and `longitude: number` as public class fields. Hopefully this won't be a limitation in v1.\n\n## Development\n\n### Initial Setup\n\n1.  Clone the project from github:\n\n```bash\ngit clone git@github.com:wovalle/fireorm.git\n```\n\n2.  Install the dependencies:\n\n```bash\nyarn # npm install\n```\n\n### Testing\n\nFireorm has two types of tests:\n\n- Unit tests: `yarn test # or npm test`\n- Integration tests: `yarn test:integration # or npm test:integration`\n\nTo be able to run the integration tests you need to [create a Firebase service account](https://firebase.google.com/docs/admin/setup#initialize_the_sdk) and declare some [environment variables](https://github.com/wovalle/fireorm/blob/master/test/setup.ts#L5-L13).\n\nTest files must follow the naming convention `*.test.ts` and use [jest](https://jestjs.io/) as the test runner.\n\n### Committing\n\nThis repo uses [Conventional Commits](https://www.conventionalcommits.org/) as the commit messages convention.\n\n### Release a new version\n\nThis repo uses [Semantic Release](https://github.com/semantic-release/semantic-release) to automatically release new versions as soon as they land on master.\n\nCommits must follow [Angular's Git Commit Guidelines](https://github.com/angular/angular.js/blob/master/DEVELOPERS.md#-git-commit-guidelines).\n\nSupported commit types (taken from [here](https://github.com/angular/angular.js/blob/master/DEVELOPERS.md#type)):\n\n- **feat:** A new feature\n- **fix:** A bug fix\n- **docs:** Documentation only changes\n- **style:** Changes that do not affect the meaning of the code (white-space, formatting, missing semi-colons, etc)\n- **refactor:** A code change that neither fixes a bug nor adds a feature\n- **perf:** A code change that improves performance\n- **test:** Adding missing or correcting existing tests\n- **chore:** Changes to the build process or auxiliary tools and libraries such as documentation generation\n\n\u003cdetails\u003e\n  \u003csummary\u003eManual Release\u003c/summary\u003e\n  If, by any reason, a manual release must be done, these are the instructions:\n\n- To release a new version to npm, first we have to create a new tag:\n\n```bash\nnpm version [ major | minor | patch ] -m \"Relasing version\"\ngit push --follow-tags\n```\n\n- Then we can publish the package to npm registry:\n\n```bash\nnpm publish\n```\n\n- To deploy the documentation:\n\n```bash\nyarn deploy:doc # or npm deploy:doc\n```\n\n\u003c/details\u003e\n\n### Documentation\n\n- Fireorm uses [typedoc](https://typedoc.org/) to automatically build the API documentation, to generate it:\n\n```bash\nyarn build:doc # or npm build:doc\n```\n\nDocumentation is automatically deployed on each commit to master and is hosted in [Github Pages](https://pages.github.com/) in this [link](https://wovalle.github.io/fireorm).\n\n## Contributing\n\nHave a bug or a feature request? Please search [the issues](https://github.com/wovalle/fireorm/issues) to prevent duplication. If you couldn't find what you were looking for, [proceed to open a new one](https://github.com/wovalle/fireorm/issues/new). Pull requests are welcome!\n\n## Contributors\n\nThanks goes to these wonderful people ([emoji key](https://allcontributors.org/docs/en/emoji-key)):\n\n\u003c!-- ALL-CONTRIBUTORS-LIST:START - Do not remove or modify this section --\u003e\n\u003c!-- prettier-ignore-start --\u003e\n\u003c!-- markdownlint-disable --\u003e\n\u003ctable\u003e\n  \u003ctr\u003e\n    \u003ctd align=\"center\"\u003e\u003ca href=\"http://twitter.com/wovalle\"\u003e\u003cimg src=\"https://avatars0.githubusercontent.com/u/7854116?v=4?s=100\" width=\"100px;\" alt=\"\"/\u003e\u003cbr /\u003e\u003csub\u003e\u003cb\u003eWilly Ovalle\u003c/b\u003e\u003c/sub\u003e\u003c/a\u003e\u003cbr /\u003e\u003ca href=\"https://github.com/wovalle/fireorm/commits?author=wovalle\" title=\"Code\"\u003e💻\u003c/a\u003e \u003ca href=\"https://github.com/wovalle/fireorm/commits?author=wovalle\" title=\"Documentation\"\u003e📖\u003c/a\u003e \u003ca href=\"#example-wovalle\" title=\"Examples\"\u003e💡\u003c/a\u003e \u003ca href=\"#ideas-wovalle\" title=\"Ideas, Planning, \u0026 Feedback\"\u003e🤔\u003c/a\u003e \u003ca href=\"https://github.com/wovalle/fireorm/pulls?q=is%3Apr+reviewed-by%3Awovalle\" title=\"Reviewed Pull Requests\"\u003e👀\u003c/a\u003e \u003ca href=\"https://github.com/wovalle/fireorm/commits?author=wovalle\" title=\"Tests\"\u003e⚠️\u003c/a\u003e\u003c/td\u003e\n    \u003ctd align=\"center\"\u003e\u003ca href=\"https://github.com/mamodom\"\u003e\u003cimg src=\"https://avatars3.githubusercontent.com/u/5097424?v=4?s=100\" width=\"100px;\" alt=\"\"/\u003e\u003cbr /\u003e\u003csub\u003e\u003cb\u003eMaximo Dominguez\u003c/b\u003e\u003c/sub\u003e\u003c/a\u003e\u003cbr /\u003e\u003ca href=\"#ideas-mamodom\" title=\"Ideas, Planning, \u0026 Feedback\"\u003e🤔\u003c/a\u003e \u003ca href=\"https://github.com/wovalle/fireorm/commits?author=mamodom\" title=\"Code\"\u003e💻\u003c/a\u003e\u003c/td\u003e\n    \u003ctd align=\"center\"\u003e\u003ca href=\"https://github.com/jonesnc\"\u003e\u003cimg src=\"https://avatars0.githubusercontent.com/u/1293145?v=4?s=100\" width=\"100px;\" alt=\"\"/\u003e\u003cbr /\u003e\u003csub\u003e\u003cb\u003eNathan Jones\u003c/b\u003e\u003c/sub\u003e\u003c/a\u003e\u003cbr /\u003e\u003ca href=\"https://github.com/wovalle/fireorm/commits?author=jonesnc\" title=\"Code\"\u003e💻\u003c/a\u003e\u003c/td\u003e\n    \u003ctd align=\"center\"\u003e\u003ca href=\"https://github.com/skalashnyk\"\u003e\u003cimg src=\"https://avatars3.githubusercontent.com/u/18640514?v=4?s=100\" width=\"100px;\" alt=\"\"/\u003e\u003cbr /\u003e\u003csub\u003e\u003cb\u003eSergii Kalashnyk\u003c/b\u003e\u003c/sub\u003e\u003c/a\u003e\u003cbr /\u003e\u003ca href=\"https://github.com/wovalle/fireorm/commits?author=skalashnyk\" title=\"Code\"\u003e💻\u003c/a\u003e\u003c/td\u003e\n    \u003ctd align=\"center\"\u003e\u003ca href=\"http://skneko.moe/\"\u003e\u003cimg src=\"https://avatars1.githubusercontent.com/u/13376606?v=4?s=100\" width=\"100px;\" alt=\"\"/\u003e\u003cbr /\u003e\u003csub\u003e\u003cb\u003eSaltyKawaiiNeko\u003c/b\u003e\u003c/sub\u003e\u003c/a\u003e\u003cbr /\u003e\u003ca href=\"https://github.com/wovalle/fireorm/commits?author=skneko\" title=\"Code\"\u003e💻\u003c/a\u003e \u003ca href=\"#ideas-skneko\" title=\"Ideas, Planning, \u0026 Feedback\"\u003e🤔\u003c/a\u003e\u003c/td\u003e\n    \u003ctd align=\"center\"\u003e\u003ca href=\"https://github.com/z-hirschtritt\"\u003e\u003cimg src=\"https://avatars1.githubusercontent.com/u/35265735?v=4?s=100\" width=\"100px;\" alt=\"\"/\u003e\u003cbr /\u003e\u003csub\u003e\u003cb\u003ez-hirschtritt\u003c/b\u003e\u003c/sub\u003e\u003c/a\u003e\u003cbr /\u003e\u003ca href=\"https://github.com/wovalle/fireorm/commits?author=z-hirschtritt\" title=\"Code\"\u003e💻\u003c/a\u003e \u003ca href=\"#ideas-z-hirschtritt\" title=\"Ideas, Planning, \u0026 Feedback\"\u003e🤔\u003c/a\u003e\u003c/td\u003e\n    \u003ctd align=\"center\"\u003e\u003ca href=\"http://joemck.ie/\"\u003e\u003cimg src=\"https://avatars1.githubusercontent.com/u/4980618?v=4?s=100\" width=\"100px;\" alt=\"\"/\u003e\u003cbr /\u003e\u003csub\u003e\u003cb\u003eJoe McKie\u003c/b\u003e\u003c/sub\u003e\u003c/a\u003e\u003cbr /\u003e\u003ca href=\"https://github.com/wovalle/fireorm/commits?author=joemckie\" title=\"Code\"\u003e💻\u003c/a\u003e \u003ca href=\"#ideas-joemckie\" title=\"Ideas, Planning, \u0026 Feedback\"\u003e🤔\u003c/a\u003e\u003c/td\u003e\n  \u003c/tr\u003e\n  \u003ctr\u003e\n    \u003ctd align=\"center\"\u003e\u003ca href=\"https://www.smddzcy.com/\"\u003e\u003cimg src=\"https://avatars3.githubusercontent.com/u/13895224?v=4?s=100\" width=\"100px;\" alt=\"\"/\u003e\u003cbr /\u003e\u003csub\u003e\u003cb\u003eSamed Düzçay\u003c/b\u003e\u003c/sub\u003e\u003c/a\u003e\u003cbr /\u003e\u003ca href=\"https://github.com/wovalle/fireorm/commits?author=smddzcy\" title=\"Code\"\u003e💻\u003c/a\u003e\u003c/td\u003e\n    \u003ctd align=\"center\"\u003e\u003ca href=\"https://github.com/stefdelec\"\u003e\u003cimg src=\"https://avatars1.githubusercontent.com/u/12082478?v=4?s=100\" width=\"100px;\" alt=\"\"/\u003e\u003cbr /\u003e\u003csub\u003e\u003cb\u003estefdelec\u003c/b\u003e\u003c/sub\u003e\u003c/a\u003e\u003cbr /\u003e\u003ca href=\"https://github.com/wovalle/fireorm/commits?author=stefdelec\" title=\"Code\"\u003e💻\u003c/a\u003e\u003c/td\u003e\n    \u003ctd align=\"center\"\u003e\u003ca href=\"http://www.innvia.com\"\u003e\u003cimg src=\"https://avatars0.githubusercontent.com/u/35846271?v=4?s=100\" width=\"100px;\" alt=\"\"/\u003e\u003cbr /\u003e\u003csub\u003e\u003cb\u003eŁukasz Kuciel\u003c/b\u003e\u003c/sub\u003e\u003c/a\u003e\u003cbr /\u003e\u003ca href=\"https://github.com/wovalle/fireorm/commits?author=LukaszKuciel\" title=\"Code\"\u003e💻\u003c/a\u003e\u003c/td\u003e\n    \u003ctd align=\"center\"\u003e\u003ca href=\"https://github.com/Fame513\"\u003e\u003cimg src=\"https://avatars1.githubusercontent.com/u/2944505?v=4?s=100\" width=\"100px;\" alt=\"\"/\u003e\u003cbr /\u003e\u003csub\u003e\u003cb\u003eYaroslav Nekryach\u003c/b\u003e\u003c/sub\u003e\u003c/a\u003e\u003cbr /\u003e\u003ca href=\"https://github.com/wovalle/fireorm/commits?author=Fame513\" title=\"Code\"\u003e💻\u003c/a\u003e\u003c/td\u003e\n    \u003ctd align=\"center\"\u003e\u003ca href=\"https://www.linkedin.com/in/dmytro-nikitiuk/\"\u003e\u003cimg src=\"https://avatars0.githubusercontent.com/u/40293865?v=4?s=100\" width=\"100px;\" alt=\"\"/\u003e\u003cbr /\u003e\u003csub\u003e\u003cb\u003eDmytro Nikitiuk\u003c/b\u003e\u003c/sub\u003e\u003c/a\u003e\u003cbr /\u003e\u003ca href=\"https://github.com/wovalle/fireorm/commits?author=tomorroN\" title=\"Code\"\u003e💻\u003c/a\u003e\u003c/td\u003e\n    \u003ctd align=\"center\"\u003e\u003ca href=\"https://github.com/JingWangTW\"\u003e\u003cimg src=\"https://avatars0.githubusercontent.com/u/20182367?v=4?s=100\" width=\"100px;\" alt=\"\"/\u003e\u003cbr /\u003e\u003csub\u003e\u003cb\u003eJingWangTW\u003c/b\u003e\u003c/sub\u003e\u003c/a\u003e\u003cbr /\u003e\u003ca href=\"https://github.com/wovalle/fireorm/commits?author=JingWangTW\" title=\"Code\"\u003e💻\u003c/a\u003e\u003c/td\u003e\n    \u003ctd align=\"center\"\u003e\u003ca href=\"https://github.com/rinkstiekema\"\u003e\u003cimg src=\"https://avatars.githubusercontent.com/u/5337711?v=4?s=100\" width=\"100px;\" alt=\"\"/\u003e\u003cbr /\u003e\u003csub\u003e\u003cb\u003eRink Stiekema\u003c/b\u003e\u003c/sub\u003e\u003c/a\u003e\u003cbr /\u003e\u003ca href=\"https://github.com/wovalle/fireorm/commits?author=rinkstiekema\" title=\"Code\"\u003e💻\u003c/a\u003e\u003c/td\u003e\n  \u003c/tr\u003e\n  \u003ctr\u003e\n    \u003ctd align=\"center\"\u003e\u003ca href=\"https://github.com/danieleisenhardt\"\u003e\u003cimg src=\"https://avatars.githubusercontent.com/u/2325519?v=4?s=100\" width=\"100px;\" alt=\"\"/\u003e\u003cbr /\u003e\u003csub\u003e\u003cb\u003eDaniel\u003c/b\u003e\u003c/sub\u003e\u003c/a\u003e\u003cbr /\u003e\u003ca href=\"https://github.com/wovalle/fireorm/commits?author=danieleisenhardt\" title=\"Code\"\u003e💻\u003c/a\u003e\u003c/td\u003e\n    \u003ctd align=\"center\"\u003e\u003ca href=\"https://zabreznik.net\"\u003e\u003cimg src=\"https://avatars.githubusercontent.com/u/1311249?v=4?s=100\" width=\"100px;\" alt=\"\"/\u003e\u003cbr /\u003e\u003csub\u003e\u003cb\u003eMarko Zabreznik\u003c/b\u003e\u003c/sub\u003e\u003c/a\u003e\u003cbr /\u003e\u003ca href=\"https://github.com/wovalle/fireorm/commits?author=MarZab\" title=\"Code\"\u003e💻\u003c/a\u003e\u003c/td\u003e\n    \u003ctd align=\"center\"\u003e\u003ca href=\"http://jomendez.com\"\u003e\u003cimg src=\"https://avatars.githubusercontent.com/u/8228498?v=4?s=100\" width=\"100px;\" alt=\"\"/\u003e\u003cbr /\u003e\u003csub\u003e\u003cb\u003eJose Mendez\u003c/b\u003e\u003c/sub\u003e\u003c/a\u003e\u003cbr /\u003e\u003ca href=\"https://github.com/wovalle/fireorm/commits?author=jomendez\" title=\"Code\"\u003e💻\u003c/a\u003e\u003c/td\u003e\n  \u003c/tr\u003e\n\u003c/table\u003e\n\n\u003c!-- markdownlint-restore --\u003e\n\u003c!-- prettier-ignore-end --\u003e\n\n\u003c!-- ALL-CONTRIBUTORS-LIST:END --\u003e\n\nThis project follows the [all-contributors](https://github.com/all-contributors/all-contributors) specification. Contributions of any kind welcome!\n\n## License\n\nMIT © [Willy Ovalle](https://github.com/wovalle). See [LICENSE](https://github.com/wovalle/fireorm/blob/master/LICENSE) for details.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fwovalle%2Ffireorm","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fwovalle%2Ffireorm","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fwovalle%2Ffireorm/lists"}