Image for post
Image for post

Backups are really useless most of the time… until something goes wrong and you really need one.

This article will help provide some easy to apply recipes to back up your Firebase project, in a single Github Action workflow.

To implement this workflow you will be needing

  1. Firebase token for CI/CD deployment.
  2. Service account that can access your Firebase project and storage buckets.

We will be making a snapshot backup that is being replaced for each run and another accumulative one that is adding every new backup into an historical archive.

Make sure that your GCP project has a “backups bucket”. It should be listed in your Google Cloud Platform Console, but not in the Firebase console…


Image for post
Image for post

A tutorial that will get you started with automated publishing of Dart packages to the pub.dev package repository, in less than 3 minutes.

In a couple of minutes from now, you will have a Github Action workflow that does all the heavy lifting of publishing your dart package or Flutter plugin to pub.dev for you.

Let’s get started.

Get your credentials

First you need to get and setup your credentials for publishing the package. Make sure that you publish your first version manually from the command line so that your package gets listed and you become the owner of that listing.

After that, find your credentials.json file either in ~/.pub-cache or ~/<your flutter root>/.pub-cache/

$ cat ~/.pub-cache/credentials.json 
{
“accessToken”:”<access-token>”,
”refreshToken”:”<refresh-token>”,
”tokenEndpoint”:”https://accounts.google.com/o/oauth2/token",
"scopes":["openid","https://www.googleapis.com/auth/userinfo.email"],
"expiration":1570721159347
}

Copy your…


Image for post
Image for post

So, it’s about time we deal with this topic. It’s been a while since the first time I wrote about data aggregation with Firebase and since I feel that the topic is not very well explored, I figured that I’ll try to to explain a way of updating a Cloud Firestore document in real time with aggregated values from thousands of distributed inputs per second.

The scenario

Imagine that you’re having a game where thousands of players are producing inputs to the game state simultaneously. Let’s say we’re counting votes on five popular contestants. We want to be able to easily present a real time score-board without being concerned about scaling issues.


This Firebase kindling will describe a simple recipe for creating a user profile document and upload a profile picture upon new account creation with Firebase authentication.

If you have been working with Firebase before, you might have found yourself creating a “user” object to complement the information that we retrieve from Firebase authentication. If you are new to Firebase, you are likely to find this article useful in a very near future.

Preconditions

You will need to install the NPM package dependency for your cloud functions. We'll be using the MD5 hash function for fetching gravatar images.

~/awesomeproject $ cd functions 
~/awesomeproject/functions $ npm i --save crypto-js

Before you go any further, you need to know that your project must be on a “non-free price plan”…


This is a straight forward article on how to get started with running scheduled tasks with #Firebase. There is actually no built in support for you to set up timers or schedules similar to a cron job. But that does not mean that you can’t get scheduling into your Firebase project

Klik di sini untuk baca artikel ini dalam bahasa Indonesia

You can leverage integration with Google App Engine, which has a very easy to manage task scheduler and Python is a good choice of language since it’s easy to write very compact yet powerful applications.

In this example we’ll be sending push notifications from Google App Engine’s scheduler to a HTTPS Cloud Function endpoint. And, oh… did I mention that we’ll accomplish this in less than 40 lines of code, including configuration files!!!

Image for post
Image for post

Tik tok let’s go

Google App Engine

Make sure that you know the basics behind Google App Engine and how…


In Cloud Firestore, you can only update a single document about once per second, which might be too low for some high-traffic applications.

This is the opening line for a concept called “distributed counters” in the Cloud Firestore documentation, which goes on to explain a fairly complicated random distribution of shard counters to reduce the probability of collisions upon document write. But “reduce the probability” are the words to pay attention to.

So, what’s the problem here? What happens if you ignore the warnings and decide to try your luck?

Let’s find out.

This example will use Firebase cloud functions to simulate aggressively simultaneous actors to our highly popular (and also fictive) movie review application.

Just do it

First we’ll make a naive example of just boldly going…


Disclaimer: hyperbolic statements and over ambitious time estimations might occur. Real time to implement may vary. Awesomeness is guaranteed!

Let me just head you in the right direction first, to watch David East’s awesome video on how to serve an Express app with cloud functions… and actually, that can be the end of the story. You can stop reading after watching that if you want. But in the article that follows below the video, I’ll showcase a real example on how I took a Node/Express app and ported it to Firebase with minimal configuration changes (and no changes at all to the actual app).

The project

As anyone who has studied at university, you know that you should start with…


Image for post
Image for post

Automate automation. It’s a thing. I will show you.

This is one of those sequels that actually outdo the original piece, similarly to The Empire Strikes Back, Godfather II and Dawn of the living dead. But please read the original article for context and foundation.

As we looked at how to set up automatic Android builds and unit testing with Gitlab CI in the mentioned article above, this article will be explaining how we at Oddbit are running automated tests with Firebase Test Lab and continuous integration.

Firebase Test Lab

Unless you didn’t already know it, Firebase allows you to run automated robo-tests or instrumented tests of your APK on physical devices…


Image for post
Image for post

In this article I’ll try to explain how we, at Oddbit, are developing for Android with Continuous Integration to build, test and package deliverables for our clients.

At the end of the article, you will find a complete Gitlab CI configuration script that is ready to be used, straight out of the box.

Gitlab

Gitlab is definitely not getting a proportional amount of credits that they deserve. At least not in my circles and part of the world. But I do my fair share of praising whenever I get the chance.

GitHub is great for the open source community. But Gitlab is a one-stop-shop solution for a developer team like ours. …


Image for post
Image for post

In this article we’ll look at how to develop a Slack app (bot, slash-command or just incoming webhooks) completely without a server backend.

By following the example in this article you will be using Slack slash-commands and incoming webhook to implement a simple game that we can call ping pong (not to be confused with the sport that incidentally has the same name).

Each of these sections can be studied separately if you are already familiar with one or more of the others.

  1. Implementing the OAuth flow
  2. Consuming a slash command
  3. Consuming button actions

If you’re not planning to distribute your app, then the OAuth section is optional. And the complete code for this project is available on Github

Prerequisites

You will need to…

Dennis Alund

Google Developer Expert for Firebase, nerd and passionate problem solver | Founder of Kumpul coworking space in Bali

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store