All Projects β†’ wovalle β†’ Fireorm

wovalle / Fireorm

Licence: mit
ORM for firestore πŸ”₯

Programming Languages

typescript
32286 projects

Labels

Projects that are alternatives of or similar to Fireorm

SwiftUIRealtimeShoppingCart
SwiftUI Collaborative Shopping Cart with Firestore Database
Stars: ✭ 34 (-89.57%)
Mutual labels:  firestore
rowy
Open-source Airtable-like experience for your database (Firestore) with GCP's scalability. Build any automation or cloud functions for your product. ⚑️✨
Stars: ✭ 2,676 (+720.86%)
Mutual labels:  firestore
Firesql
Query Firestore using SQL syntax
Stars: ✭ 304 (-6.75%)
Mutual labels:  firestore
Facebook-Messenger
This is a Facebook Messenger clone.You can comminicate to other at realtime.Used ReactJS, Material UI, Firebase, Firestore Database
Stars: ✭ 18 (-94.48%)
Mutual labels:  firestore
fireman
Tame your Firebase databases
Stars: ✭ 36 (-88.96%)
Mutual labels:  firestore
React Admin Firebase
A firebase data provider for the react-admin framework
Stars: ✭ 269 (-17.48%)
Mutual labels:  firestore
oneroof
Learn about firebase crud operation authentication, animation
Stars: ✭ 15 (-95.4%)
Mutual labels:  firestore
Our E School
A mobile app created using Flutter Framework for School management.
Stars: ✭ 315 (-3.37%)
Mutual labels:  firestore
firecode
VS Code Firestore Rules Extension
Stars: ✭ 35 (-89.26%)
Mutual labels:  firestore
Vuefire
πŸ”₯ Firebase bindings for Vue.js & Vuex
Stars: ✭ 3,234 (+892.02%)
Mutual labels:  firestore
gatsby-firebase-starter
πŸ”₯ Starter Project / Boilerplate for Authentication and creating Dynamic pages from collections with Firebase and Gatsby.js.
Stars: ✭ 61 (-81.29%)
Mutual labels:  firestore
expect-firestore
API client and Jasmine matchers for the Firestore Rules API
Stars: ✭ 22 (-93.25%)
Mutual labels:  firestore
Node Firestore Import Export
Firestore data import and export
Stars: ✭ 271 (-16.87%)
Mutual labels:  firestore
restaurant
πŸ• Simple Pizza Restaurant POS
Stars: ✭ 29 (-91.1%)
Mutual labels:  firestore
Firestore Backup Restore
NPM package for backup and restore Firebase Firestore
Stars: ✭ 307 (-5.83%)
Mutual labels:  firestore
fire-fuse
Powerful typing utilities for firestore.
Stars: ✭ 18 (-94.48%)
Mutual labels:  firestore
Pring
Cloud Firestore model framework for iOS - Google
Stars: ✭ 260 (-20.25%)
Mutual labels:  firestore
Sapphiredb
SapphireDb Server, a self-hosted, easy to use realtime database for Asp.Net Core and EF Core
Stars: ✭ 326 (+0%)
Mutual labels:  firestore
Flutter programs
Experiments with Mobile
Stars: ✭ 308 (-5.52%)
Mutual labels:  firestore
Squanchy Android
Open source Android app for your conferences
Stars: ✭ 294 (-9.82%)
Mutual labels:  firestore

fireormπŸ”₯

NPM Version Build Status Typescript lang All Contributors License Gitter chat

Fireorm 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 and familiar repository pattern. It basically helps us not worrying about Firestore details and focusing in what matters: adding cool new features!

You can read more about the motivations and features of fireorm on its introductory post. Also, the API documentation is available.

Usage

  1. Install the npm package:
yarn add fireorm reflect-metadata #or npm install fireorm reflect-metadata

# note: reflect-metadata shim is required
  1. Initialize your firestore application:
import * as admin from 'firebase-admin';
import * as fireorm from 'fireorm';

const serviceAccount = require('../firestore.creds.json');

admin.initializeApp({
  credential: admin.credential.cert(serviceAccount),
  databaseURL: `https://${serviceAccount.project_id}.firebaseio.com`,
});

const firestore = admin.firestore();
fireorm.initialize(firestore);
  1. Create your firestore models!
import { Collection } from 'fireorm';

@Collection()
class Todo {
  id: string;
  text: string;
  done: Boolean;
}
  1. Do cool stuff with fireorm!
import { Collection, getRepository } from 'fireorm';

@Collection()
class Todo {
  id: string;
  text: string;
  done: Boolean;
}

const todoRepository = getRepository(Todo);

const todo = new Todo();
todo.text = "Check fireorm's Github Repository";
todo.done = false;

const todoDocument = await todoRepository.create(todo); // Create todo
const mySuperTodoDocument = await todoRepository.findById(todoDocument.id); // Read todo
await todoRepository.update(mySuperTodoDocument); // Update todo
await todoRepository.delete(mySuperTodoDocument.id); // Delete todo

Firebase Complex Data Types

Firestore has support for complex data types such as GeoPoint and Reference. Full handling of complex data types is being handled in this issue. Temporarily, Fireorm will export Class Transformer's @Type decorator. It receives a lamda where you have to return the type you want to cast to. See GeoPoint Example.

Limitations

If 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.

Development

Initial Setup

  1. Clone the project from github:
git clone [email protected]:wovalle/fireorm.git
  1. Install the dependencies.
yarn # npm install

Testing

Fireorm has two types of tests:

  • Unit tests: yarn test # or npm test
  • Integration tests: yarn test:integration # or npm test:integration

To be able to run the integration tests you'll need to create a firebase service account and declare some environment variables.

Test files must follow the naming convention *.test.ts and use jest as the test runner.

Committing

This repo uses Conventional Commits as the commit messages convention.

Release a new version

This repo uses Sematic Release to automatically release new versions as soon as they land on master.

Commits must follow Angular's Git Commit Guidelines.

Supported commit types (taken from here):

  • feat: A new feature
  • fix: A bug fix
  • docs: Documentation only changes
  • style: Changes that do not affect the meaning of the code (white-space, formatting, missing semi-colons, etc)
  • refactor: A code change that neither fixes a bug nor adds a feature
  • perf: A code change that improves performance
  • test: Adding missing or correcting existing tests
  • chore: Changes to the build process or auxiliary tools and libraries such as documentation generation
Manual Release If, by any reason, a manual release must be done, these are the instructions:
  • To release a new version to npm, first we have to create a new tag:
npm version [ major | minor | patch ] -m "Relasing version"
git push --follow-tags
  • Then we can publish the package to npm registry:
npm publish
  • To deploy the documentation
yarn deploy:doc # or npm deploy:doc

Documentation

  • Fireorm uses typedoc to automatically build the API documentation, to generate it:
yarn build:doc # or npm build:doc

Documentation is automatically deployed on each commit to master and is hosted in Github Pages in this link.

Contributing

Have a bug or a feature request? Please search the issues to prevent duplication. If you couldn't find what you were looking for, proceed to open a new one. Pull requests are welcome!

Contributors

Thanks goes to these wonderful people (emoji key):


Willy Ovalle

πŸ’» πŸ“– πŸ’‘ πŸ€” πŸ‘€ ⚠️

Maximo Dominguez

πŸ€” πŸ’»

Nathan Jones

πŸ’»

Sergii Kalashnyk

πŸ’»

SaltyKawaiiNeko

πŸ’» πŸ€”

z-hirschtritt

πŸ’» πŸ€”

Joe McKie

πŸ’» πŸ€”

Samed Düzçay

πŸ’»

stefdelec

πŸ’»

Łukasz Kuciel

πŸ’»

Yaroslav Nekryach

πŸ’»

Dmytro Nikitiuk

πŸ’»

JingWangTW

πŸ’»

Rink Stiekema

πŸ’»

This project follows the all-contributors specification. Contributions of any kind welcome!

License

MIT Β© Willy Ovalle. See LICENSE for details.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].