In this section, you’ll enable Cloud Firestore in your project. We’ll walk through creating your database, adding data, and securing it with rules — all inside the Firebase Console.
Open Your Firebase Project
- Go to https://console.firebase.google.com.
- Select the project where you want to enable Firestore.
Navigate to Firestore
From the left-hand menu:
- Click “Create” → “Firestore Database”.
- You’ll arrive at the Firestore overview page.
(Add screenshot: Firebase console showing Firestore Database option under Build)
Create a Firestore Database
- Click “Create database”.
- Choose your security rules mode:
- Start in production mode — best for live apps (locked by default).
- Start in test mode — open for development and testing.
- Click Next.
(Add screenshot: Firestore create database popup with security rules options)
Choose Your Database Location
- Select a Cloud Firestore location (for example:
us-central,europe-west).⚠️ This can’t be changed later — choose carefully!
- Click Enable to create your Firestore instance.
(Add screenshot: Firestore location selection dropdown)
Review and Edit Security Rules
-
Click the “Rules” tab at the top of the Firestore dashboard.
-
You’ll see default rules like:
rules_version = '2'; service cloud.firestore { match /databases/{database}/documents { match /{document=**} { allow read, write: if false; } } } -
For now, we can just allow authenticated users to write, adjust later as needed
allow read: if true; allow write: if request.auth.uid != null;
Note:
If not already done, you need to update your DATABASE_URL in your .env.example file
DATABASE_URL=project-id.firebaseio.com