Skip to content

Commit bca483a

Browse files
committed
docs: update the getting started
1 parent f0f5ce4 commit bca483a

File tree

1 file changed

+50
-27
lines changed

1 file changed

+50
-27
lines changed

dataconnect/README.md

Lines changed: 50 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -11,15 +11,33 @@ For more information about Firebase Data Connect visit [the docs](https://fireba
1111
Follow these steps to get up and running with Firebase Data Connect. For more detailed instructions,
1212
check out the [official documentation](https://firebase.google.com/docs/data-connect/quickstart).
1313

14-
### 1. Create a New Data Connect Service and Cloud SQL Instance
15-
16-
1. Open [Firebase Data Connect](https://console.firebase.google.com/u/0/project/_/dataconnect) in
17-
your project in Firebase Console and select Get Started.
18-
2. Create a new Data Connect service and a Cloud SQL instance. Ensure the Blaze plan is active.
19-
Pricing details can be found at [Firebase Pricing](https://firebase.google.com/pricing).
20-
3. Select your server region, if you wish to use vector search, make sure to select `us-central1` region.
21-
4. Allow some time for the Cloud SQL instance to be provisioned. After it's provisioned, the instance
22-
can be managed in the [Cloud Console](https://console.cloud.google.com/sql).
14+
### 1. Connect to your Firebase project
15+
16+
1. If you haven't already, create a Firebase project.
17+
1. In the [Firebase console](https://console.firebase.google.com), click
18+
**Add project**, then follow the on-screen instructions.
19+
20+
2. Upgrade your project to the Blaze plan. This lets you create a Cloud SQL
21+
for PostgreSQL instance.
22+
23+
> Note: Though you set up billing in your Blaze upgrade, you won't be
24+
charged for usage of {{data_connect_short}} or the
25+
[default Cloud SQL for PostgreSQL configuration](https://firebase.google.com/docs/data-connect/#pricing)
26+
during the preview.
27+
28+
3. Navigate to the [Data Connect section](https://console.firebase.google.com/u/0/project/_/dataconnect)
29+
of the Firebase console and follow the setup workflow:
30+
- Select a location for your Cloud SQL for PostgreSQL database.
31+
- Fill in the following fields:
32+
- Service ID: `dataconnect`
33+
- Cloud SQL Instance: `cloud-sql-instance`
34+
- Database name: `postgres`
35+
4. Allow some time for the Cloud SQL instance to be provisioned. After it's provisioned, the instance
36+
can be managed in the [Cloud Console](https://console.cloud.google.com/sql).
37+
38+
5. Download and then add the Firebase Android configuration file (`google-services.json`) to your app:
39+
1. Click **Download google-services.json** to obtain your Firebase Android config file.
40+
2. Move your config file into the module (app-level) root directory of your app.
2341

2442
### 2. Set Up Firebase CLI
2543

@@ -32,24 +50,29 @@ npm install -g firebase-tools
3250
### 3. Cloning the repository
3351
This repository contains the quickstart to get started with the functionalities of Data Connect.
3452

35-
1. Clone this repository to your local machine.
36-
1. (Private Preview only) Checkout the `fdc-quickstart` branch and open the project in Android Studio.
37-
1. Open the a terminal window and initialize your Firebase project with `firebase init dataconnect`.
38-
1. Overwrite only dataconnect.yaml when prompted, do not overwrite any other dataconnect files.
39-
(Optional): If you intend on using other Firebase features, run `firebase init` instead, and select both DataConnect options as well as any feature you intend to use.
40-
1. Allow domains for Firebase Auth in your [project console](https://console.firebase.google.com/project/_/authentication/settings) (e.g. http://127.0.0.1).
41-
42-
### 4. Running queries and mutations in VS Code
43-
The VSCode Firebase Extension allows you to generate Firebase Data Connect SDK code, run queries/mutations, and deploy Firebase Data Connect with a click. Alternatively, see below for CLI commands.
44-
45-
1. Install [VS Code](https://code.visualstudio.com/).
46-
2. Download the [Firebase extension](https://firebasestorage.googleapis.com/v0/b/firemat-preview-drop/o/vsix%2Ffirebase-vscode-latest.vsix?alt=media) and [install](https://code.visualstudio.com/docs/editor/extension-marketplace#_install-an-extension) it.
47-
3. Open this quickstart in VS code, and in the left pane of the Firebase extension, and log in with your Firebase account.
48-
(Optional): If your Firebase project was not initialized in the last section, you can click `Run firebase init` and select `Data Connect` to initialize.
49-
4. Click on deploy to deploy your schema to your cloud SQL instance. Or run `firebase deploy --only dataconnect` (this will also activate vectors search if it's enabled in the schema).
50-
5. Running the VSCode extension should automatically start the DataConnect emulators. If you see an emulators error, try running `firebase emulators:start dataconnect` manually.
51-
52-
Now you should be able to deploy your schema, run mutations/queries, generate SDK code, and view your application locally.
53+
1. Clone this repository to your local machine:
54+
```sh
55+
git clone https://github.com/firebase/quickstart-android.git
56+
```
57+
58+
2. (Private Preview only) Checkout the `fdc-quickstart` branch (`git checkout fdc-quickstart`)
59+
and open the project in Android Studio.
60+
61+
### 4. Deploy the service to Firebase and generate SDKs
62+
63+
1. Open the `quickstart-android/dataconnect/dataconnect` directory and deploy the schema with
64+
the following command:
65+
```bash
66+
firebase deploy
67+
```
68+
2. Once the deploy is complete, you should be able to see the movie schema in the
69+
[Data Connect section](https://console.firebase.google.com/u/0/project/_/dataconnect)
70+
of the Firebase console.
71+
72+
3. Generate the Kotlin SDK by running:
73+
```bash
74+
firebase dataconnect:sdk:generate
75+
```
5376

5477
### 5. Populating the database
5578
1. Run `1_movie_insert.gql`, `2_actor_insert.gql`, `3_movie_actor_insert.gql`, and `4_user_favorites_review_insert.gql` files in the `./dataconnect` directory in order using the VS code extension,

0 commit comments

Comments
 (0)