Skip to main content
Rk Jp

⚠️ Warning: Most apps do not NEED a backend! This can be complex work that breaks your project. Please read our introduction to backend document to know if you should do this to your Rork app.

This guide will help you use Firebase to build your backend. By the end of this guide, you will be able to sign users in with their email, establish all the backend databases for your app to fully function, and build out any functions needed to make your app personalized for the users.

Create a Firebase account

  • Go to Firebase and login with your Google account. You may have to answer a few questions before you can create your first project. This takes just a few minutes.
  • Create a new Firebase project (choose name).
    Feel free to skip the Gemini AI assistance and Analytics part for now. You can always add those in later.
    Firebase Starter Pn
  • Register your app.
    After you have a Firebase project, you can register your app within that project.
    • You should see an “Add App” button followed by a set of Platforms. While it may make sense to choose iOS or Android, we are running the Expo framework in the background, which is powered by JS/Web. Choose Web. Screenshot 2025-11-17 at 8.02.41 AM.png
    • Enter your apps nickname. This is internal and wont be seen by public. Screenshot 2025-11-17 at 8.05.48 AM.png
    • Click Register app.
    • You will be shown your config. Please check next steps in Collect Your Config on what to do.

Collect Your Config

On that same page after registering your app, you will see the config and SDK instruction. We are basically going to tell our Rork project editor to add these in. Screenshot 2025-11-17 at 8.07.39 AM.png Please copy the second window that has the firebaseConfig item in it and then return to Rork editor. In the rork editor, please type the following:
Please install firebase package and setup the init config.
Please also setup Firebase Auth and Firebase Database:
{PASTE YOUR ACTUAL COPIED CONFIG FROM ABOVE HERE}
Screenshot 2025-11-17 at 8.09.16 AM.png For the rest of this guide, we will be building the Voice-Only social media app SPEEK.

Creating the Backend Data Schema

This is probably going to be the most challenging part of this whole process if you have never done this, but you can also use AI (inside Rork) to help you out. You need to figure out the data schema needed for your application to work, and the functions that it should be able to do as well. Just like with SQL, you still need to define which objects your app needs — but Firebase uses NoSQL instead of tables. This means:
  • You will create collections (like tables)
  • Each user or post will be a document
  • A document contains fields
  • You can also have subcollections nested inside documents
You can ask Rork the following:
Please list out all of the data schema collections required for our application to work. I will be using this list to create my Firestore collections and security rules.
SPEEK Schema Pn

Create Your First Database

We need to enable Firestore Database in order to be able to store information on the cloud. Click on **Firestore Database **on the left hand panel inside your Firebase project. Create a database and pick a region closest to your users. You cannot change this later and this does affect the speed of your backend. Once in, add the security rules Rork told you to add. Go to the Rules tab and paste them in.
Firebase DBSLS Pn
Now that you know what your objects and security rules are, we can build our Firestore collections. Unlike Supabase, Firebase does not require SQL or table creation ahead of time. Firestore builds collections “just-in-time” when your app writes to them. So, we can ask Rork to do all the work for us now. Before we get to that though, we must setup our Auth so users can sign up and have a user id attached to them.

Set up authentication in Firebase dashboard (e.g., email/password, OAuth providers)

Before we connect your data schema to Firestore, we need to make sure users can actually sign up and sign in. Firebase Authentication is the simplest part of this whole backend setup and requires no databases or SQL.

Enable Email + Password Authentication

  1. In your Firebase dashboard, go to **Authentication **and press Get Started.
  2. Click the Sign-in method tab.
  3. Enable Email/Password.
  4. (Optional) Turn off email verification to make development easier.
  5. (Optional) Enable Google, Apple, or phone number if you want those later. These are highly popular asks from most users to add in.
Firebase saves these settings automatically, so now we can just ask Rork to enable it.

Integrating Auth into Rork

Now that authentication is enabled, Rork can generate all the login and signup logic directly inside your project. In your Rork editor, ask:
Please integrate Firebase Authentication into this project. 
I want email+password sign up, sign in, sign out, and proper session handling.
Use:
- createUserWithEmailAndPassword
- signInWithEmailAndPassword
- onAuthStateChanged for sessions
After sign up, please also create a user document in Firestore inside the "users" collection.
Rork will generate:
  • a signup function
  • a login function
  • an auth state listener
  • the code to create the initial user document in Firestore
  • navigation updates for logged-in vs logged-out users
This gives your app a fully working authentication system.

Ask Rork to Apply Your Schema and Build Your Functions

Now that authentication is working and your Firebase Security Rules are in place, the final step is to give Rork your app’s schema so it can generate all of the backend functionality your project needs. This step is where your backend becomes real — Rork will build:
  • Firestore collection/document structures
  • create / read / update / delete functions
  • queries (feed, user posts, lists, etc.)
  • any subcollection logic (comments, likes, followers, etc.)
  • Firebase Storage upload helpers (if your schema includes images/audio/video)
  • fully typed helper functions your app can call
To do this, open the Rork editor and send the following message:
I have added the Firebase Security Rules. 
Please apply the schema from before that you stated to the project and generate all
helper functions required for it — including create, read, update,
delete, queries, and any subcollection or media upload functionality needed.
Rork will read your schema and build out everything needed for your backend to function.
If it misses a relationship or a field, simply update your schema and re-run the request.
Once this step is complete, your app is fully wired up to Firebase. The authentication, Firestore, and all your app’s backend functions will now work end-to-end!

Test and make sure your database updates with functions in your app

Now that you have everything connected, you should see your updates change the database tables and also persist! Congrats on building a backend! Final SPEEK Transform