|
| 1 | +# Firebase Data Connect Quickstart |
| 2 | + |
| 3 | +## Introduction |
| 4 | + |
| 5 | +This quickstart is a movie review app to demonstrate the use of Firebase Data Connect with a Cloud SQL database. For more information about Firebase Data Connect visit [the docs](https://firebase.google.com/docs/data-connect/). |
| 6 | + |
| 7 | + |
| 8 | +## Getting Started |
| 9 | + |
| 10 | +Follow these steps to get up and running with Firebase Data Connect. For more detailed instructions, check out the [official documentation](https://firebase.google.com/docs/data-connect/quickstart). |
| 11 | + |
| 12 | +### 0. Prerequisites |
| 13 | +- Flutter 3.5.3 or above |
| 14 | +- Latest version of [Visual Studio Code](https://code.visualstudio.com/) |
| 15 | +- The [Firebase Data Connect VS Code Extension](https://marketplace.visualstudio.com/items?itemName=GoogleCloudTools.firebase-dataconnect-vscode) |
| 16 | + |
| 17 | +### 1. Connect to your Firebase project |
| 18 | + |
| 19 | +1. If you haven't already, create a Firebase project. |
| 20 | + 1. In the [Firebase console](https://console.firebase.google.com), click |
| 21 | + **Add project**, then follow the on-screen instructions. |
| 22 | +2. Install flutterfire: |
| 23 | +```sh |
| 24 | +dart pub global activate flutterfire_cli |
| 25 | +``` |
| 26 | +### 2. Cloning the repository |
| 27 | + |
| 28 | +1. Clone this repository to your local machine: |
| 29 | + ```sh |
| 30 | + git clone https://github.com/firebase/quickstart-flutter.git |
| 31 | + ``` |
| 32 | +2. Configure flutterfire |
| 33 | +This will automatically download and set up firebase for your project: |
| 34 | +```sh |
| 35 | +flutterfire configure -y -a com.example.dataconnect |
| 36 | +``` |
| 37 | + |
| 38 | + |
| 39 | +### 3. Open in Visual Studio Code (VS Code) |
| 40 | + |
| 41 | +1. Open the `quickstart-flutter/dataconnect` directory in VS Code. |
| 42 | +2. Click on the Firebase Data Connect icon on the VS Code sidebar to load the Extension. |
| 43 | + a. Sign in with your Google Account if you haven't already. |
| 44 | +3. Click on "Connect a Firebase project" and choose the project where you have set up Data Connect. |
| 45 | +4. Click on "Start Emulators" - this should generate the Kotlin SDK for you and start the emulators. |
| 46 | + |
| 47 | +### 4. Populate the database |
| 48 | +In VS Code, open the `quickstart-flutter/dataconnect/dataconnect/moviedata_insert.gql` file and click the |
| 49 | + `Run (local)` button at the top of the file. |
| 50 | + |
| 51 | +If you’d like to confirm that the data was correctly inserted, |
| 52 | +open `quickstart-flutter/dataconnect/movie-connector/queries.gql` and run the `ListMovies` query. |
| 53 | + |
| 54 | +### 5. Running the app |
| 55 | + |
| 56 | +Press the Run button in VS Code to run the sample app on your device. |
0 commit comments