๐ฅFirebase Integration
Adding user Data to the Firebase Database
Last updated
Adding user Data to the Firebase Database
Last updated
Firebase is a popular choice for Authentication and Data Storage. To get started with Firebase refer to the doc here Firebase Integration.
Databutton offers built-in storage within its workspace, supported by Databutton's own SDK. This storage is ideal for small-scale production apps and quick testing purposes. Read more here
Set up the Firestore Client.
Create API (backend) to handle the data storage
Read more about creating API in Databutton here.
Start with creating a new project and register the app using the "Web" option ( follow the instructions in details as mentioned earlier here Setting up the Firestore Client)
On the left-hand side tab, under the "Build" dropdown -> Select the "Firestore Database" option
Select the "Create database" option
In the "Select a location" step, choose the nearest Google Cloud region to your application's users, then click the "Next" button ( this step can't be reverted back once created )
Select "Production" or "Test" mode (based on the usage).
Generate Service Account Key ( follow the step below )
Go to the Firebase Console.
Click on the gear icon next to "Project Overview" and select "Project settings".
Navigate to the "Service accounts" tab.
Click "Generate new private key" and download the JSON file.
Copy the credentials from the downloaded JSON file.
Ask Databutton on how to store the Service account key credetials
Example prompt ( while doing via the Databutton's Agent )
Alternatively, you can manually store the Service account key details ( recommended and quick )
Go to the config section in the menu ( Top menu bar in Databutton's workspace -> Select Config โ๏ธ )
Next, prompting the architecture of the firestore database. This step is cruical and varies based on the app in mind. Here's an example of a simpler use case :
Note, this step can be iterative, and it's very important to reciprocate the database architecture concisely. It is also recommended to test and iterate further!
Here's an example code snippet based on the database architecure discussed :
Hover down to the Secrets section and add it with a secret name and the value ( here value is basically the copied credentials which was downloaded)
Once, the architecture looks ideal, Databutton Agent takes care of the next steps for creating a functional API