functions-samples
flutterfire
Our great sponsors
functions-samples | flutterfire | |
---|---|---|
66 | 53 | |
11,957 | 8,367 | |
0.4% | 1.6% | |
6.8 | 9.6 | |
7 days ago | 7 days ago | |
JavaScript | Dart | |
Apache License 2.0 | BSD 3-clause "New" or "Revised" License |
Stars - the number of stars that a project has on GitHub. Growth - month over month growth in stars.
Activity is a relative number indicating how actively a project is being developed. Recent commits have higher weight than older ones.
For example, an activity of 9.0 indicates that a project is amongst the top 10% of the most actively developed projects that we are tracking.
functions-samples
-
Setting up an auto-email micro function for Firebase RTDB
const functions = require("firebase-functions"); // // Create and deploy your first functions // // https://firebase.google.com/docs/functions/get-started // // exports.helloWorld = functions.https.onRequest((request, response) => { // functions.logger.info("Hello logs!", {structuredData: true}); // response.send("Hello from Firebase!"); // });
-
Moving my Android app to Google cloud
Cloud Functions for Firebase - Pros: Aligns to my app which uses Firebase; Cons: have to use Typescript which I have no experience with
-
In One Minute : Firebase
Cloud Functions for Firebase
-
What are Firebase Extensions? How can they speed up your app development?
Cloud Functions are a serverless solution that allows you to run backend code in response to HTTPS requests or even more β‘ powerfully, in response to events triggered by other Firebase products.
-
I made a website that puts your face on your pet, using Cloud Vision and ML. The results are absurd as they are ridiculous
Have a go at petswitch.com if you wish... I made the original Petswitch almost ten years ago, and it's had mild success since then, including CNET writing an article about it and it receiving the prestigious honour of 'most useless website' in week 41 of 2018, as determined by theuselesswebindex.com. Aside from the obvious question of why I even made this, it was getting pretty creaky β I originally built it with PHP and ImageMagick, with the facial features being manually selected via jQuery UI. So I decided to rebuild the whole thing with a full face-to-pet ML pipeline, on static hosting. To get the human face features, the app renders the upload to a temporary img element. This is a handy way to orient the image correctly via the browser, and saves having to deal with EXIF data. It's then resized, rendered to a canvas element, converted to a base64 string, then sent via fetch to Google's Cloud Vision API, which returns landmark coordinates of the face. I use these coordinates to correct any tilt on the face, mask the eyes and mouth via a mask image, then store each masked element as an additional canvas. Detecting pet faces was trickier. Google, Amazon and Microsoft all offer object detection APIs via transfer learning, and the approach is largely the same: you supply a series of images with bounding boxes around the objects you want to detect, either added via a web interface or uploaded via their API. You train a model online from these supplied images, then the service will return the estimated coordinates of any detected objects in an uploaded image. I found a dataset of both cats and dogs that had been labelled with landmarks on their faces, then wrote a script to convert the landmarks into bounding boxes around their eyes and nose, the dimensions based on a simple formula around the distance between the eyes in each image. All in all it's been trained on about 17,000 images of cats and dogs, and the accuracy seems to be pretty good. I was pleased to discover it actually works pretty well on other pets too. I've also added some friendly pets to the Petswitch family for those that don't have a pet on hand. I decided not to use a framework for this, it's written from scratch using a series of ES6 modules β although I did use Konva to handle the manual selection of facial features if the API can't detect a face. I used ParcelJS as my task runner, and my detection APIs are hosted on Firebase Cloud Functions. Let me know if you have any questions, although I can offer no good explanation for why I created this monstrosity...
-
How do I allow my express REST server to handle multiple concurrent requests (200-500) at the same time?
I would also consider using a serverless entry point for hook ingestion (eg Firebase Functions). That would make the hook and queue process very fast and light. It would auto scale and leave your app infrastructure largely untouched
-
Sending Emails with Firebase
Cloud Functions allow you to access Firebase events directly in your application. This way, you can easily integrate with the Firebase platform and accomplish a wide range of tasks.
-
Google Pay with Firebase extension and Adyen
Cloud Firestore is a NoSQL database part of the Firebase platform: it is designed to support complex JSON-based data structure, advanced querying and multiple languages (NodeJS, Python and Java SDKs). Firestore really stands out when used together with Cloud Functions that allow executing server-side code in response to events like changes in the database or other types of notifications.
-
Build a React App with Firebase Serverless Functions
import React, { useState } from "react"; import { useOktaAuth } from "@okta/okta-react"; import { initializeApp } from "firebase/app"; import { getAuth, signInWithCustomToken, signOut } from "firebase/auth"; import { getFunctions, httpsCallable, connectFunctionsEmulator, } from "firebase/functions"; function Home() { const [reportCardData, setReportCardData] = useState(); const [selectedSemester, setSelectedSemester] = useState("Spring 2022"); const { oktaAuth, authState } = useOktaAuth(); const login = async () => oktaAuth.signInWithRedirect(); const logout = async () => { signOut(auth); oktaAuth.signOut("/"); }; const { REACT_APP_FIREBASE_APIKEY, REACT_APP_FIREBASE_AUTHDOMAIN, REACT_APP_FIREBASE_PROJECTID, REACT_APP_FIREBASE_STORAGEBUCKET, REACT_APP_FIREBASE_MESSAGINGSENDERID, REACT_APP_FIREBASE_APPID, REACT_APP_ENV, } = process.env; const firebaseConfig = { apiKey: REACT_APP_FIREBASE_APIKEY, authDomain: REACT_APP_FIREBASE_AUTHDOMAIN, projectId: REACT_APP_FIREBASE_PROJECTID, storageBucket: REACT_APP_FIREBASE_STORAGEBUCKET, messagingSenderId: REACT_APP_FIREBASE_MESSAGINGSENDERID, appId: REACT_APP_FIREBASE_APPID, }; const app = initializeApp(firebaseConfig); const functions = getFunctions(app); const auth = getAuth(); if (REACT_APP_ENV === "development") { connectFunctionsEmulator(functions, "localhost", 5001); } const getGrades = async () => { const getGradesCall = httpsCallable(functions, "getGrades"); const resp = await getGradesCall({ name: selectedSemester.split(" ")[0], year: selectedSemester.split(" ")[1], }); setReportCardData(resp.data); }; const exchangeOktaTokenForFirebaseToken = async () => { const exchangeToken = httpsCallable( functions, "exchangeOktaTokenForFirebaseToken" ); const resp = await exchangeToken({ accessToken: authState.accessToken.accessToken }); await signInWithCustomToken(auth, resp.data.firebaseToken); }; if (authState?.isAuthenticated) { exchangeOktaTokenForFirebaseToken(); } return (
-
{auth?.currentUser && (
Logout
button>
)}
{!auth?.currentUser && (
Login
button>
)}
li>
ul>
nav>
{!auth?.currentUser && (
In order to use this application you must be logged into your Okta account p>
Please select a semester to get your report card h1>
{ setSelectedSemester(e.target.value); }} > Fall 2021option> Spring 2021option> Fall 2022option> Spring 2022option> select> div> Get Grades button> div> div> {reportCardData && ( <> Name: b> {reportCardData.name} p> School: b> {reportCardData.school} p> Semester: b> {reportCardData.semester} -{" "} {reportCardData.year} p> Course th> Score th> Letter Grade th> tr> thead> {reportCardData.grades.map((grade, i) => { return ( {grade.course}td> {grade.score}td> {grade.letterGrade}td> tr> ); })} tbody> table> )} div> )} A Small demo using Oktaa> to Secure an{" "} Firebase hosted application{" "} a>{" "} with a serverless{" "} functiona> p> By Nik Fishera> p> footer> main> div> ); } export default Home;
-
{auth?.currentUser && (
Logout
button>
)}
{!auth?.currentUser && (
Login
button>
)}
li>
ul>
nav>
{!auth?.currentUser && (
-
Decifer β generate transcripts with ease
Firebase Cloud Functions lets you run backend code in a severless architecture.
flutterfire
- Handling Firebase Notifications in Flutter: Practical Tips
-
Access Riverpod providers from Isolate
Sure, sure. You are special and ahead of Flutterfire issues: https://github.com/firebase/flutterfire/issues/10353
-
How Fleeting Notes Migrated 1000+ Users from Firebase to Supabase (Stripe, Firebase, Supabase)
The lack of full native Dart support, slow build times, sketchy workarounds, and no desktop support led me searching for another solution. After many hours of research, I was faced with the choice between two frameworks: Appwrite and Supabase. Both were great frameworks and both fit my use case perfectly. But, I decided to move forward with Supabase because of their philosophy of β not reinventing the wheelβ.
-
Optimize Flutter iOS Build using ccache
For the moment, the pre-compiled SDK doesn't work with the latest flutter firebase libraries: https://github.com/firebase/flutterfire/issues/9761 So it takes an hour to build my project in GitHub action. I can't live with it!
-
How to manage your Flutter monorepos
You could write your own bash script or CLI to help manage these tasks. However, this costs you some time. In order to deal with these tasks more quickly, you can use community tools, like Melos, Very Good CLI, or Sidekick. In this article, we are going to use Melos. Melos is also used by repositories like FlutterFire, AWS Amplify (Flutter), Flame, and Plus Plugins.
- FlutterFire with Google Sign In not working for iOS
-
Flutter builds are way faster with M1 machines: A comparison of VMs
In the comparison, we focus more on the Sharezone app because Sharezone is a real production app with +300,000 registered users. It uses a bunch of dependencies, like many of the Firebase packages and several other ones (Sharezone is open source β you can find all the dependencies here). Therefore, you will see very realistic build times.
- Speed Log : the app to send parcel within persons.
-
Create a feedback form with Flutter and Firebase
Flutter Fire is the name given to the plugins that integrate Firebase within a Flutter app. There are basically two ways to integrate Firebase into a Flutter app: integration via configuration files, which is done in the native parts of the app, or a newer automated and faster mechanism that was created recently. In this tutorial we are going to use the latter, to do so you have at your disposal an exhaustive explanation in the official documentation, where basically they ask you to install Firebase CLI on your system, and then enable FlutterFire CLI.
-
By FAR my biggest pain with developing flutter is xcode build errors related to my firebase dependencies.
Either https://github.com/flutter/flutter/issues/new or https://github.com/FirebaseExtended/flutterfire/issues/new/choose
What are some alternatives?
getx - Open screens/snackbars/dialogs/bottomSheets without context, manage states and inject dependencies easily with Get.
BMI-Calculator-flutter-app
flutter_map - A versatile mapping package for Flutter. Simple and easy to learn, yet completely customizable and configurable, it's the best choice for mapping in your Flutter app.
grpc-dart - The Dart language implementation of gRPC.
melos - π A tool for managing Dart projects with multiple packages. With IntelliJ and Vscode IDE support. Supports automated versioning, changelogs & publishing via Conventional Commits.
dio - A powerful HTTP package for Dart/Flutter, which supports Global settings, Interceptors, FormData, Aborting and canceling a request, Files uploading and downloading, Requests timeout, Custom adapters, etc. [Moved to: https://github.com/cfug/dio]
flutter-examples - This repository contains the Syncfusion Flutter UI widgets examples and the guide to use them.
sdk - The Dart SDK, including the VM, dart2js, core libraries, and more.
Flutter - Flutter makes it easy and fast to build beautiful apps for mobile and beyond
firebase-js-sdk - Firebase Javascript SDK
dio - A powerful HTTP client for Dart and Flutter, which supports global settings, Interceptors, FormData, aborting and canceling a request, files uploading and downloading, requests timeout, custom adapters, etc.
nakama-flutter - Dart / Flutter client for Nakama server.