{"id":25935353,"url":"https://github.com/orbis25/fire-repo","last_synced_at":"2025-08-21T07:07:26.780Z","repository":{"id":45326025,"uuid":"421675754","full_name":"Orbis25/fire-repo","owner":"Orbis25","description":"Library that contains a repository pattern in firebase and any helpers","archived":false,"fork":false,"pushed_at":"2022-10-29T03:47:54.000Z","size":108,"stargazers_count":6,"open_issues_count":0,"forks_count":1,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-03-04T01:34:11.691Z","etag":null,"topics":["backend","clean-architecture","firebase","firebase-database","firestore","google","helpers","javascript","js","repository-pattern","ts","typescript"],"latest_commit_sha":null,"homepage":"","language":"TypeScript","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/Orbis25.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}},"created_at":"2021-10-27T04:26:45.000Z","updated_at":"2023-05-22T12:05:35.000Z","dependencies_parsed_at":"2022-08-23T16:20:18.470Z","dependency_job_id":null,"html_url":"https://github.com/Orbis25/fire-repo","commit_stats":null,"previous_names":[],"tags_count":2,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Orbis25%2Ffire-repo","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Orbis25%2Ffire-repo/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Orbis25%2Ffire-repo/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Orbis25%2Ffire-repo/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Orbis25","download_url":"https://codeload.github.com/Orbis25/fire-repo/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":241768410,"owners_count":20017117,"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":["backend","clean-architecture","firebase","firebase-database","firestore","google","helpers","javascript","js","repository-pattern","ts","typescript"],"created_at":"2025-03-04T01:34:18.249Z","updated_at":"2025-03-04T01:34:19.004Z","avatar_url":"https://github.com/Orbis25.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# FIRE-REPO 🔥\n\nThis library is an implementation of the firebase repository pattern and some helpers to facilitate the work of developers using firebase. - (ts projects only)\n\n[![Main actions](https://github.com/Orbis25/fire-repo/actions/workflows/main.yml/badge.svg)](https://github.com/Orbis25/fire-repo/actions/workflows/main.yml)\n\n`npm i fire-repo`\n\n## Table of Contents\n\n- [FIRE-REPO 🔥](#fire-repo-)\n  - [Table of Contents](#table-of-contents)\n  - [Installation](#installation)\n  - [Libraries](#libraries)\n  - [Project structure](#project-structure)\n  - [Use](#use)\n    - [Methods](#methods)\n    - [Helpers](#helpers)\n  - [Contribution](#contribution)\n    - [Branches](#branches)\n    - [Report an issuer](#report-an-issuer)\n\n## Installation\n\nOnly you need download the code and install the dependencies running the command `npm install`.\n\n## Libraries\n\nThe used libraries are:\n\n- [Firebase](https://www.npmjs.com/package/firebase/v/9.5.0)\n- [uuid](https://www.npmjs.com/package/uuid/v/8.3.2)\n- [Jest](https://www.npmjs.com/package/jest/v/27.4.2)\n- [jest-junit](https://github.com/palmerj3/jest-junit)\n\n## Project structure\n\n- 📁 `.github` : Contains the github actions configurations.\n- 📁 `example` : Contains the example of usage from library.\n\n  - ts `configuration.ts` : Example of configuration.\n  - ts `index.ts` : Example of usage.\n\n- 📁 `helpers` : Contains the helpers of library.\n\n  - ts `fire-file.helper.ts` : Helper to work with firebase files.\n  - ts `fire-mapping.helper.ts` : Helper to mapping the firebase data.\n  - ts `index.ts` : Export the helpers.\n\n- 📁 `models` : Contains the models of library\n\n  - ts `base.model.ts` : Base model.\n\n- 📁 `repositories` : Contains the repositories of library\n  - 📁 `implementations`: Contains the implementations of repositories.\n  - 📁 `interfaces` : Contains the interfaces of library.\n    - ts `index.ts` : Export the interfaces.\n    - ts `read.interface.ts` : Interface to read data.\n    - ts `write.interface.ts` : Interface to write data.\n  - 📁 `types`: Contains the types of library.\n    - ts `filter.type.ts`: Type to filter data.\n    - ts `index.ts`: Export the types.\n- 📁 `test`\n  - 📁 `helpers`: Contains the test of helpers.\n  - 📁 `repositories`: Contains the test of repositories\n\n## Use\n\nFor use the library in you project you need install the fire-repo library running the command `npm i fire-repo` and import the library in your project.\n\n```ts\nimport { FireRepository } from \"fire-repo\";\nimport { BaseModel } from \"fire-repo\";\n```\n\nCreate your model extending the base model.\n\n```ts\nclass User extends BaseModel {\n  name: string;\n  email: string;\n}\n```\n\nCreate your service class for work with the repository and manage the entity and data.\n\n```ts\nclass UserService extends FireRepository\u003cUser\u003e {\n  constructor() {\n    /**\n     * @param {initializeApp} firebaseConfiguration firebase configuration\n     * @param {string} collection firebase collection \"/test\"\n     */\n    super(firebaseConfiguration, collection);\n  }\n}\n```\n\n### Methods\n\n- `add`: Create a new entity.\n- `update`: Update an entity.\n- `deleteEntity`: Delete an entity.\n- `remove`: Applied the soft delete a entity.\n- `getAll`: Get all entities.\n- `getOne`: Get One entity.\n- `getDocId`: Get the document id.\n- `getCollection`: Get the collection.\n\n### Helpers\n\n- `fileUpload`: Upload a file to firebase storage.\n- `removeFile`: Remove a file from firebase storage.\n- `toEntityArray`: Convert an array of firebase data to an array of entities.\n- `getFormateadFirebaseData`: Format the retrieved data from firebase. (Date - timestamp)\n\n## Contribution\n\nIf you want to contribute to the library you can create a branch in the repository and send a pull request. Remember create great unit tests and documentation updates.\n\n### Branches\n\nRemember usage this structure:\n\n- `feature/[name]`\n- `fix/[name]`\n- `bug/[name]`\n\n### Report an issuer\n\nIf you have an issue or a problem with the library you can report it in the [issues](https://github.com/Orbis25/fire-repo/issues)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Forbis25%2Ffire-repo","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Forbis25%2Ffire-repo","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Forbis25%2Ffire-repo/lists"}