https://github.com/stefanprokopdev/firebless
Firebless allows you to create repositories from Firestore collections
https://github.com/stefanprokopdev/firebless
backend database firebase firestore javascript nodejs repository
Last synced: 5 months ago
JSON representation
Firebless allows you to create repositories from Firestore collections
- Host: GitHub
- URL: https://github.com/stefanprokopdev/firebless
- Owner: stefanprokopdev
- License: mit
- Created: 2020-02-02T16:09:28.000Z (over 6 years ago)
- Default Branch: master
- Last Pushed: 2021-07-26T14:57:58.000Z (almost 5 years ago)
- Last Synced: 2025-10-26T11:24:40.908Z (8 months ago)
- Topics: backend, database, firebase, firestore, javascript, nodejs, repository
- Language: TypeScript
- Size: 255 KB
- Stars: 2
- Watchers: 1
- Forks: 0
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Firebless
[](https://travis-ci.com/stefan-prokop-cz/firebless)
[](https://www.npmjs.com/package/firebless)
[](https://codeclimate.com/github/stefan-prokop-cz/firebless)
[](https://codeclimate.com/github/stefan-prokop-cz/firebless)
[](https://snyk.io/test/github/stefan-prokop-cz/firebless?targetFile=package.json)
[](https://github.com/stefan-prokop-cz/firebless/blob/master/LICENSE)
Firebless allows you to create repositories from [Firestore](https://cloud.google.com/firestore/) collections. It providing basic methods such as `detail`, `list`, `create`, `update`, `delete` and more.
## Install
```
npm i firebless
```
## Basic usage
```typescript
import { defaultFirestoreRepository, initFirestore } from 'firebless';
const db = initFirestore({/* todo */}); // or use custom instance
interface User {
id?: string;
name: string;
}
const userRepository = defaultFirestoreRepository.bind(db.collection('users'));
// userRepository.detailById('123')
// userRepository.list({ name: 'Test' })
// ...
```
## Custom repository
```typescript
import { defaultFirestoreRepository, initFirestore } from 'firebless';
const db = initFirestore({/* todo */}); // or use custom instance
interface User {
id?: string;
name: string;
}
const userRepository = (defaultRepo => {
const list = () => {
// custom logic
return defaultRepo.list({}, defaultRepo.getCollection().orderBy('name', 'asc'));
};
return {
...defaultRepo,
list,
};
})(defaultFirestoreRepository.bind(db.collection('users')));
```
## Examples
- [Create](./CreateExample.md)
- [List](./ListExample.md)
- [Detail](./DetailExample.md)
- [Update](./UpdateExample.md)
- [Delete](./DeleteExample.md)
- [Bulk](./BulkExample.md)
- [API documentation](https://stefan-prokop-cz.github.io/firebless/)
## Debug
You need to set the `NODE_DEBUG` variable to the `firebless`.
## Testing
```
npm t
npm run test:coverage
```
## License
This project is licensed under [MIT](./LICENSE).