Skip to content

Rhino Grasshopper's RESTful interface for Google Firebase

License

Notifications You must be signed in to change notification settings

frisonl/firehopper

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

41 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

firehopper

Platforms License Join the chat at https://gitter.im/hodgoong/firehopper

firehopper_logo Rhino Grasshopper's RESTful interface for Google Firebase

Firehopper is a Grasshopper add-in that interacts with Google Firebase in RESTful ways. User can simply request a PUT to store JSON style data in Google Firebase, PATCH to modify, POST to incrementally save data, DELETE to delete, and reqeust GET to fetch the data. This component will be updated further to support different functionality supported by Google Firebase.

How to use

firehopper_components

Setup

Create Google Firebase account for free

Visit http://firebase.google.com to create an account and to create new project.

Retrieve DB URL and API Key

After creating the account and the project, you can get the following information from 'Project Overview' section in the Firebase console. We need 'apiKey' and 'databaseURL' values. firehopper_firebase_setup

Download Firehopper

Download firehopper.gha in the 'Release' tab in this github repo or at food4rhino(http://www.food4rhino.com/app/firehopper) and save under the Grasshopper library folder.

Data

firehopper Key-Value Pair Generator

firehopper_key-value pair generator

The key-value pair generator combines two sets of strings into JSON style string format. The component will throw an error when two lists contain different amount of string elements inside. firehopper_key-value pair generator example

HTTP

firehopper PUT

firehopper_PUT_component

The PUT component triggers PUT request to Firebase to store the JSON string. This component requires 'apiKey' and 'databaseURL' information retrieved from the 'Setup' section in this page. Basic usage of the PUT component is illustrated on below images: firehopper_PUT example

After triggering the PUT component, the component will send the JSON string to corresponding Firebase database using the API key and Database URL. The result of above example is shown below: firehopper_PUT example_result

firehopper PUT with Key-Value Generator

The PUT component can be used with the firehopper Key-Value Generator as well. firehopper_PUT example

The result of above example is shown below: firehopper_PUT example_result

firehopper GET

firehopper_GET_component

The GET component triggers GET request to Firebase to fetch the JSON string. This component requires 'apiKey' and 'databaseURL' information retrieved from the 'Setup' section in this page. Basic usage of the GET component is illustrated on below images: firehopper_PUT example

Query using ghJSON

JSON string retrieved from firehopper GET component can be further queried with ghJSON(https://mathrioshka.ru/ghjson/) as below example: firehopper_GET_component

firehopper POST

firehopper_GET_component

Will be updated soon.

firehopper PATCH

firehopper_GET_component

Will be updated soon.

firehopper DELETE

firehopper_GET_component

Will be updated soon.

Usage Example with Geometry Parameter

firehopper_GET_component

Development Environment:

  • Microsoft Visual Studio Community 2017 Version 15.5.0
  • Rhino Version 5 SR14 64-bit
  • Grasshopper Build 0.9.0076

Dependancies (run-time version):

  • Grasshopper.dll (v4.0.30319)
  • System.Net.Http.dll (v4.0.30319)

Author

Hojoong Chung https://github.com/hodgoong http://hojoongchung.blogspot.com hojoong.chung(at)gmail.com

firehopper © 2018 Hojoong Chung

About

Rhino Grasshopper's RESTful interface for Google Firebase

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • C# 100.0%