This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// index.js for Firebase Functions | |
// SMS is triggered when an alert object is added to the alert queue path | |
const functions = require('firebase-functions'); | |
const admin = require('firebase-admin'); | |
const twilio = require('twilio'); | |
admin.initializeApp(functions.config().firebase); | |
const db = admin.database(); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Code to write Google API Oauth tokens to Firebase database | |
const FUNCTIONS_CLIENT_ID = functions.config().googleapi.client_id; | |
const FUNCTIONS_SECRET_KEY = functions.config().googleapi.client_secret; | |
const FUNCTIONS_REDIRECT = '{YOUR_FUNCTIONS_SUBDOMAIN}.cloudfunctions.net/OauthCallback'; | |
// TODO: use firebase functions:config:set to configure your Google API client ID and secret | |
// Also update FUNCTIONS_REDIRECT | |
const googleAuth = require('google-auth-library'); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Trigger function copies new data in FB database to Google Sheet | |
const FUNCTIONS_CLIENT_ID = functions.config().googleapi.client_id; | |
const FUNCTIONS_SECRET_KEY = functions.config().googleapi.client_secret; | |
const FUNCTIONS_REDIRECT = '{YOUR_FUNCTIONS_SUBDOMAIN}.cloudfunctions.net/OauthCallback'; | |
// TODO: use firebase functions:config:set to configure your Google API client ID and secret | |
// Also update FUNCTIONS_REDIRECT | |
const googleAuth = require('google-auth-library'); | |
const google = require('googleapis'); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const express = require('express'); | |
const app = express(); | |
const functions = require('firebase-functions'); | |
const cors = require('cors')({ origin: true }); | |
app.use(cors); | |
// upload account image | |
const API_LINK_BASE_URL = 'http://storage.googleapis.com'; | |
const PROJECT_ID = ;// {YOUR_PROJECT_ID, USUALLY A SINGLE WORD}; | |
const BUCKET_ID = ;// {YOUR_BUCKET_ID, E.G. PROJECT_ID.appspot.com}; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// for backend, see https://gist.github.com/elon-gs/d6adae8b77d7c90cb76b591fef10d24a | |
import React, { Component } from 'react'; | |
import ImageUploader from 'react-images-upload'; | |
import axios from 'axios'; | |
let uploading = false; | |
export default class UploaderComponent extends Component { | |
state = { |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.