[go: up one dir, main page]

DEV Community

Alok Sahay
Alok Sahay

Posted on

Decentralized Firebase Remote Config

This is a submission for the The Pinata Challenge

What I Built

I built a decentralized version of the popular Firebase Remote Config. You can use RemoteConfig to define parameters in your app and update their values in the cloud, allowing you to modify the appearance and behavior of your app without distributing an app update.

The landing screen shows your current Project (Pinata) and the number of configurations saved.
Image description

The detail configuration screen shows your current configuration and also lets you copy the signed URL that your client application will use to point to the configuration.
Image description

The app developer can set certain parameters like API endpoint, app version, API version etc. They can also set certain custom tags and a switch for hot-fixing and turning features on/off the go. You can use this to make a feature live for example without any updates.
Image description

Easily compare the edits from your previous configurations. Like what features were changed, any broken endpoints etc. Old config is shown in blue.
Image description

Demo

Link to Demo:

IPFS:

Google Drive:

My Code

Github

More Details

The Configurator is built in Swift using Files SDK.
Here are some of the APIs used in the project:

https://docs.pinata.cloud/api-reference/endpoint/list-files 
https://docs.pinata.cloud/api-reference/endpoint/upload-a-file
https://docs.pinata.cloud/api-reference/endpoint/get-signed-url
https://docs.pinata.cloud/api-reference/endpoint/add-swap
Enter fullscreen mode Exit fullscreen mode

Here's a rough flow for the project:

Dashboard app:

  1. Generate DB and upload to Files, DB is kept private and a signed URL is generated to fetch DB.
  2. When a configuration is added, the DB contents will change, and so will the CID. We perform a hot swap for the CIDs so the DB is always pointed by the first instance.
  3. The signed URL for the DB is passed to the client app, where a config instance is fetched that always points to the latest config. The SDK manages all configuration tasks so the user doesnt have to.
  4. An instance of configuration is stored locally on device and it is refreshed every 30 seconds (variable in the future).

Using the parameters of the remote config instance, a developer can future proof updates for their app.

This is a solo submission.

Top comments (0)