Giter Club home page Giter Club logo

ridesharing-firebase's Introduction

Firebase Cloud Functions for HyperTrack Ridesharing sample app

This repository contains Firebase Cloud Functions that create and complete trips and manage orders for Ridesharing apps for iOS and Android.

Requirements

Firebase Cloud Functions require a paid account to make outbound API calls. This includes API calls to HyperTrack APIs. We recommend using the Blaze plan. It gives a lot of bandwidth for free, which is more then enough to internally test the app.

Add to your project

  1. Clone the repo.
git clone https://github.com/hypertrack/ridesharing-firebase.git
cd ridesharing-firebase
  1. Install Firebase tools CLI
npm install -g firebase-tools
  1. Login to your account and choose your project
firebase login
firebase use --add

Select the project from dropdown menu. You can use any alias for the project.

  1. Install function dependencies
cd functions ; npm install ; cd ..
  1. Configure functions with HyperTrack API Keys

Copy AccountId and SecretKey from HyperTrack's dashboard setup page. Paste them in /functions/index.js file into placeholders on line 9. Keep the : separator between them.

  1. Deploy functions into your Firebase Ridesharing project
firebase deploy --only functions
  1. Setup webhooks from HyperTrack to Cloud Functions
  • Open the Functions > Dashboard tab in your Firebase project
  • Copy the trigger URL for onTripUpdate function Functions Dashboard
  • Go to HyperTrack's dashboard setup page and add this URL as a webhook URL.
  • Go back to Firebase and open the Logs tab. Search for onTripUpdate function's log with SubscriptionConfirmation message. Open the SubscribeURL in browser (XML file will appear). The webhook activation can take a few minutes. Refresh the dashboard's setup page to make sure, that activation was successful. Functions Logs
  1. Your Cloud Functions backend is now ready to interface with HyperTrack APIs.

Documentation

For detailed documentation of the APIs, customizations and what all you can build using HyperTrack, please visit the official docs.

Frequently Asked Questions

No project active

No project active. Run with --project <projectId> or define an alias by
running firebase use --add

This error while deploying functions means that you need to select the project first. Run firebase use --add and select your project from dropdown menu, then add any alias to the project.

Error parsing triggers: Cannot find module 'moment'

This error can happen when your didn't run npm install from the functions directory. Run cd functions ; npm install ; cd .. from the projects directory or execute the commands one by one:

cd functions
npm install
cd ..

Contribute

Feel free to clone, use, and contribute back via pull requests. We'd love to see your pull requests - send them in! Please use the issues tracker to raise bug reports and feature requests.

We are excited to see what live location feature you build in your app using this project. Do ping us at [email protected] once you build one, and we would love to feature your app on our blog!

Support

Join our Slack community for instant responses. You can also email us at [email protected].

ridesharing-firebase's People

Contributors

tulushev avatar

Watchers

James Cloos avatar

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.