PRASIT Subscribe

Complete Firebase Course: Auth, Database, Hosting and a Real App

So, you’ve got your app’s screens set up. The buttons do their thing, the layout’s tight, and users can bounce from page to page. 

But where does all their info actually live? Where do you stash those event details? And how does an admin keep everything up to date in the app?

That’s where the backend steps in. With Firebase, you get a bunch of backend services out of the box — no need to build everything from scratch.

We’ll start simple: first, get a feel for the main Firebase services and what they cost. 

After that, we’ll piece everything together and make a Flutter event app that lets people sign in with Google, stores info in Cloud Firestore, and gives admins a web panel to keep things running smoothly.

What You’ll Learn

  • Firebase provides backend services for authentication, application data, files, hosting, notifications, and analytics.

  • Firestore uses collections and documents, while Realtime Database stores data in a JSON tree.

  • Firebase’s paid plan charges by usage rather than providing an unlimited monthly subscription.

  • A screen-by-screen plan helps an AI agent connect your frontend, database, and admin panel.

Table of Contents

Frontend, Backend and What Firebase Actually Does

The frontend is the part of an application that people interact with: buttons, forms, screens, colors, and layouts. You can build it with Flutter, React, HTML, CSS, and JavaScript.

The backend handles work behind those screens. It manages accounts, stores data, saves uploaded files, and applies the logic that makes the application useful.

Think about a video platform. Its player and buttons are part of the frontend. 

The systems that store video details, thumbnails, and account information belong to the backend.

Firebase is Google’s application development platform. Instead of building your own login service, database infrastructure, and file upload system from scratch, you connect your frontend to Firebase services.

This makes starting much easier, especially for beginners. You still need to decide what your application should do, how its data should be organized, and who can access it. Firebase provides the building blocks.

Firebase Authentication: Login and Sign-Up

Authentication answers a simple question: who is using the application? 

Firebase Authentication supports several sign-in methods, including:

  • Google sign-in

  • Email and password

  • Phone number verification with an OTP

  • Apple, Facebook, and GitHub sign-in

With email and password, a person creates an account first, then uses those credentials to return. 

With Google sign-in, they choose a Google account and continue through the authorization flow.

The right method depends on your application. I often prefer email-based access combined with phone verification when limiting casual duplicate accounts matters. 

Phone verification adds a useful check, but it should not be treated as proof that every account belongs to a different person.

The Authentication console also includes account-management settings, usage information, and email templates for actions such as email verification and password resets. 

Check the customization options for each template rather than assuming every message supports the same changes.

One important distinction: an authentication account is not your entire user profile. 

Authentication manages identity. Extra application details, such as event registrations, belong in your database.

Firestore vs Realtime Database

After login, you need somewhere to save application data. Two important Firebase NoSQL options are Cloud Firestore and Realtime Database. Firebase also offers SQL-related tools, but our event app will use Firestore.

Cloud Firestore

Firestore organizes data into collections and documents. This is useful when your application has several kinds of related information.

For example, an event application needs event details, user profiles, and registration records. 

Keeping these in a clear document-based structure makes them easier to manage. 

E-commerce and billing applications are other examples where organized records matter.

Realtime Database

Realtime Database stores data as a JSON tree. It is useful for synchronized information such as chat messages, online status, and live location updates.

Imagine sending a chat message and having it appear on another device without a manual refresh. That is the kind of behavior real-time synchronization supports.

Both databases support real-time updates. Do not choose only because one has “Realtime” in its name. 

Start with your data structure and the operations your app needs. Google’s database comparison guide provides more detail.

For our event app, Firestore is a practical fit because we need organized event, user, and registration records.

Other Firebase Services You Should Know

Cloud Storage

Cloud Storage handles files such as images, videos, documents, and downloads. It is different from a database.

A database stores structured information, such as an event title or a user’s name. 

Storage holds the actual uploaded file. Think of the difference between a video’s details and the video file itself.

Hosting and App Hosting

Firebase Hosting helps you publish a website on the internet. Firebase also offers App Hosting for supported web application workflows. 

Choose the product that matches the kind of site or web app you are deploying.

Cloud Messaging

Firebase Cloud Messaging is used for push notifications. You can create a notification campaign and send a message to configured application installations. This is separate from saving information in the database.

Analytics

Analytics helps you understand application activity: how many people use it, where they come from, and when they are active. Its reports can help you understand usage instead of guessing.

Cloud Functions and AI Features

Cloud Functions lets you run backend logic, including server-side work needed for integrations such as payment gateways.

Firebase’s AI-related tools can also help you add generative features, such as text generation and conversational experiences. 

Available media-generation features depend on the model and service you use.

You do not need to enable everything. Start with the services your application actually needs. Our example only requires Authentication and Firestore for its core workflow.

Firebase Pricing: Free Plan vs Pay as You Go

Firebase has a no-cost Spark plan and a pay-as-you-go Blaze plan. The main point is simple: Blaze is not a fixed monthly bundle that gives you unlimited access.

Your bill depends on the billable services and resources you use.

The free plan provides allowances for several services. As a starting reference, Firestore includes a storage allowance of about 1 GiB, while Realtime Database includes 1 GB of stored data. 

However, storage is only one limit. Database activity, downloads, connections, and other quotas also matter.

Cloud Messaging and Analytics have no-cost offerings. Authentication pricing depends on the method and configuration, so do not assume phone OTP has the same pricing as Google sign-in.

Some services require billing to be enabled. Hosting also has no-cost allowances, so it is not accurate to treat every hosting feature as paid-only. Before choosing a plan, check the current Firebase pricing page.

Keep Billing Visible

When upgrading, you link billing and provide the required payment details. 

Available payment methods and verification steps depend on your country and billing account.

To review costs, open Google Cloud Console, select your project, and go to Billing. Check usage and configure budget alerts early.

A budget alert is not an automatic spending cap. Use it to stay informed, alongside regular checks of your service usage. 

Also review billing for each Firebase project instead of assuming that upgrading one upgrades all the others.

Plan the Flutter Event App Before Building

Our application has a simple purpose: an admin creates events, and users sign in and register for them.

The stack is straightforward:

  • Flutter: the user-facing application.

  • Firebase Authentication: Google sign-in.

  • Cloud Firestore: users, events, and registrations.

  • HTML, CSS, and JavaScript: the web admin panel.

Before generating code, plan the application screen by screen. We need an authentication screen, an event list, a registration flow, a profile screen, and settings.

Next, describe what each screen reads or saves. Signing in creates an identity. The profile displays user details. The home screen reads events. Joining an event writes a registration.

This becomes your product requirements document, or PRD. A clear plan gives an AI coding agent specific work to complete. A vague request leaves too many decisions open.

Create and Connect the Flutter and Firebase Projects

1. Create the Flutter Project

With Flutter installed, create a project folder and open it in your editor. Use the command palette to create a new Flutter project, select the Empty Application template, and enter a project name.

Choose Android and Web if you want both targets available. The exact editor menus may differ, but the goal is the same: start with a clean Flutter application.

2. Create a Firebase Project

Open Firebase Console, create a project, and give it a recognizable name, such as Event App. Complete the setup, including the Analytics choice.

Then add an Android app inside that Firebase project. Find your Android application ID in the app-level Gradle configuration and enter it accurately during registration.

3. Create the Firestore Database

Open Firestore Database and create a database. Select the appropriate edition and choose a region near your intended users to help keep network latency low.

For a learning prototype, test mode makes early setup easier. However, test mode is not a production security policy. Replace its permissive access with rules that match your application’s users and roles before release.

4. Enable Google Sign-In and Add Configuration

In Authentication, enable Google as a sign-in provider, choose the support email, and save.

Then download the current google-services.json file from project settings and place it inside the Flutter project's android/app/ folder. Downloading it after enabling Google sign-in helps keep the configuration current.

This file identifies the Firebase project and Android app. It does not replace SDK setup or security rules. Follow the current FlutterFire setup instructions for dependencies, initialization, and platform-specific requirements.

Use an AI Coding Agent with Firebase MCP

An AI coding agent can work with your local application files. Through Firebase MCP, it can also use authorized tools to interact with your Firebase project.

The workflow is:

  1. Install or configure Firebase MCP in a compatible coding environment.

  2. Complete its authorization flow with the correct Google account.

  3. Confirm the Firebase project ID.

  4. Provide your PRD and relevant application files.

  5. Review requested operations before approving them.

The demonstration uses an AI editor and an Antigravity agent workflow. Interfaces may change, but the idea stays the same: give the agent enough context to coordinate frontend code and backend setup.

It can help create the screens, connect Authentication, prepare Firestore operations, and add demo events. 

You do not have to create every document manually in the console; application code can create records when it writes them.

Still, automation does not remove the need to review changes. Check permissions, database rules, and project selection. 

Treat authorization tokens as sensitive, and never assume an integration is safe only because of the company behind it.

Test the App Against the Backend

Run the application and test the complete flow, not just its appearance.

  1. Sign in with Google. Confirm that the account appears in Firebase Authentication.

  2. Check the profile record. Verify that the expected name and email appear in Firestore.

  3. Compare event data. Confirm that database events match the application list.

  4. Edit or delete an event. Refresh if required and check the result in the app.

  5. Join an event. Confirm that the registration contains the expected user details.

In the example, the first registration attempt failed because of a permissions problem. 

The error was passed back to the coding agent, the rules were corrected, and registration succeeded on the next attempt.

That is a useful debugging habit: use the actual error instead of guessing. 

Check whether the problem comes from authentication, the document path, or access rules. Do not solve it by opening the entire database to everyone.

Build a Web Admin Panel

The user app now works, but managing events directly in Firestore is not convenient for everyday tasks. 

An admin panel gives those operations a simpler interface.

Add a Web app to the same Firebase project and copy its web configuration. Provide that configuration and a separate admin PRD to your coding agent.

Test both sides together. Create an event in the admin and confirm it appears in the app. Register from the app and confirm the registration appears in the admin.

A login form alone does not secure an admin panel. Administrative permissions must be enforced through backend access controls, not only through buttons or a password check in browser code.

What You Have Built

You now have the structure of a full-stack application: a Flutter frontend, Google authentication, Firestore records, and a web interface for administration.

The design is intentionally simple. The important result is understanding how a user action becomes stored data, and how that data returns to the frontend.

Once that flow makes sense, Firebase becomes much easier to use in your next application.

Written by

PRASIT

Get new stories by email

From PRASIT. No spam, unsubscribe anytime.

More from PRASIT

Report this story

papyras