Giter Site home page Giter Site logo

sd10 / nora Goto Github PK

View Code? Open in Web Editor NEW
269.0 9.0 26.0 46.16 MB

Nora is a Firebase abstraction layer for FirebaseDatabase and FirebaseStorage

License: MIT License

Swift 90.24% Objective-C 1.82% Ruby 4.16% Shell 3.79%
firebase firebase-database firebasestorage swift3 swift networking database open-source

nora's Introduction

codebeat badge Build Status Swift Xcode MIT Contributions Welcome Open Source Love


Nora is a Firebase abstraction layer for working with FirebaseDatabase and FirebaseStorage.

Stop spending all that time cleaning up your view controllers and trying to write reusable Firebase code.

Let Nora handle that for you. Your time is better spent on what you do best. Writing great Apps!

Simply put, working with Firebase just got whole lot easier.


Installation

CocoaPods Recommended

  pod 'Nora'

Example

Working with FirebaseDatabase

After setting up a target making requests is simple.

let database = DatabaseProvider<Users>()

database.request(.getUser(id: "1")) { result in
  switch result {
  case .success(let response):
    let snapshot = response.snapshot
  case .failure(let error):
    print(error.localizedDescription)
  }
}

Database Response Decoding

Provide a JSON initializer for your custom types and easily convert the database response:

let database = DatabaseProvider<Users>()

database.request(.getUser(id: "1")) { result in
  switch result {
  case .success(let response):
    let user = try? response.mapTo(User.init)
  case .failure(let error):
    print(error.localizedDescription)
  }
}

Working with FirebaseStorage

let storage = StorageProvider<Avatars>()
let avatarData = Data()
var meta = FIRStorageMetadata?

storage.request(.upload(avatarData, meta)) { result in
  switch result {
  case .success(_):
    print("Upload Success!")
  case .failure(let error):
    print(error.localizedDescription)
  }
}

Documentation (In Progress)

DatabaseTarget Documentation

DatabaseProvider Documentation


Get involved

You can contribute to this project in more ways than just code:

  • Improving the README
  • Improving Documentation
  • Bug reporting
  • New feature suggestions
  • Answering questions

We really encourage everyone to get involved in open source.

Your feedback is always welcome and much appreciated!

REGARDLESS, of your level of experience.

You will never be put down for having an opinion. So take a chance, open a pull request, or submit that issue!


Inspiration

This project was inspired and based off the Moya networking abstraction layer in Swift.

Check out their project if you're using traditional networking!


License

Nora is released under an MIT license. See LICENSE.md for more information.

nora's People

Contributors

omaralbeik avatar pawurb avatar psobko avatar readmecritic avatar sd10 avatar tapanprakasht avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

nora's Issues

Update DatabaseQuery API

Update DatabaseQuery API

The queries property of DatabaseTarget is currently an array of DatabaseQuery.
I really never liked this interface and think it would be more user-friendly if it were a linked list.

Add check for empty string path when building the DatabaseRequest

Reasoning:

Currently, you can't use an empty String for the path property of DatabaseTarget in order to default to using the baseReference. This can be easily be fixed by adding a check for an empty string and only calling child(path:) on the baseReference if the String is not empty.

Update for latest version of Firebase

Needs an update to new version of Firebase

  • Resolve naming convention conflicts by adding NR prefix
  • Update to new Firebase API
  • Update Podfile to new FirebaseDatabase & FirebaseStorage versions

Set up TravisCI

TravisCI is not currently set up but the build is working fine

Make as framework?

Hey guys!
It's interesting project, but without supporting installation via Cocoapods or Carthage.
How about let's do this?

Make completion block for providers optional

Reasoning

Users of the API may not want to provide a completion block when updating or removing data.
This should be an easy change by changing the routing of a request if the completion block is not provided. Will update shortly

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.