Skip to content

Commit c6f42f2

Browse files
committed
Added untracked files
1 parent 23179f2 commit c6f42f2

File tree

10 files changed

+4835
-0
lines changed

10 files changed

+4835
-0
lines changed

data_connect/README.idx.md

Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
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+
### 1. Connect to your Firebase project
13+
14+
1. If you haven't already, create a Firebase project.
15+
1. In the [Firebase console](https://console.firebase.google.com), click
16+
**Add project**, then follow the on-screen instructions.
17+
2. Enable Email/Password Sign-in method [here](https://console.firebase.google.com/project/_/authentication/providers).
18+
19+
### 2. Cloning the repository
20+
21+
1. Clone this repository to your local machine:
22+
```sh
23+
git clone https://github.com/firebase/quickstart-flutter.git
24+
```
25+
2. Configure flutterfire
26+
This will automatically download and set up firebase for your project:
27+
```sh
28+
flutterfire configure -y -a com.example.dataconnect
29+
```
30+
31+
32+
### 3. Open in Visual Studio Code (VS Code)
33+
34+
1. Click on the Firebase Data Connect icon on the VS Code sidebar to load the Extension.
35+
a. Sign in with your Google Account if you haven't already.
36+
2. Click on "Connect a Firebase project" and choose the project where you have set up Data Connect.
37+
3. Click on "Start Emulators" - this should generate the Kotlin SDK for you and start the emulators.
38+
39+
### 4. Populate the database
40+
In VS Code, open the `quickstart-flutter/dataconnect/dataconnect/moviedata_insert.gql` file and click the
41+
`Run (local)` button at the top of the file.
42+
43+
If you’d like to confirm that the data was correctly inserted,
44+
open `quickstart-flutter/dataconnect/movie-connector/queries.gql` and run the `ListMovies` query.
45+
46+
### 5. Running the app
47+
48+
Press the Run button in VS Code to run the sample app on your device.
Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
extend type FavoriteMovie {
2+
"""
3+
✨ Implicit foreign key field based on `FavoriteMovie`.`user`. It must match the value of `User`.`id`. See `@ref` for how to customize it.
4+
"""
5+
userId: String! @fdc_generated(from: "FavoriteMovie.user", purpose: IMPLICIT_REF_FIELD)
6+
"""
7+
✨ Implicit foreign key field based on `FavoriteMovie`.`movie`. It must match the value of `Movie`.`id`. See `@ref` for how to customize it.
8+
"""
9+
movieId: UUID! @fdc_generated(from: "FavoriteMovie.movie", purpose: IMPLICIT_REF_FIELD)
10+
}
11+
extend type MovieActor {
12+
"""
13+
✨ Implicit foreign key field based on `MovieActor`.`movie`. It must match the value of `Movie`.`id`. See `@ref` for how to customize it.
14+
"""
15+
movieId: UUID! @fdc_generated(from: "MovieActor.movie", purpose: IMPLICIT_REF_FIELD)
16+
"""
17+
✨ Implicit foreign key field based on `MovieActor`.`actor`. It must match the value of `Actor`.`id`. See `@ref` for how to customize it.
18+
"""
19+
actorId: UUID! @fdc_generated(from: "MovieActor.actor", purpose: IMPLICIT_REF_FIELD)
20+
}
21+
extend type MovieMetadata {
22+
"""
23+
✨ Implicit primary key field. It's a UUID column default to a generated new value. See `@table` for how to customize it.
24+
"""
25+
id: UUID! @default(expr: "uuidV4()") @fdc_generated(from: "MovieMetadata", purpose: IMPLICIT_KEY_FIELD)
26+
"""
27+
✨ Implicit foreign key field based on `MovieMetadata`.`movie`. It must match the value of `Movie`.`id`. See `@ref` for how to customize it.
28+
"""
29+
movieId: UUID! @fdc_generated(from: "MovieMetadata.movie", purpose: IMPLICIT_REF_FIELD)
30+
}
31+
extend type Review {
32+
"""
33+
✨ Implicit foreign key field based on `Review`.`movie`. It must match the value of `Movie`.`id`. See `@ref` for how to customize it.
34+
"""
35+
movieId: UUID! @fdc_generated(from: "Review.movie", purpose: IMPLICIT_REF_FIELD)
36+
"""
37+
✨ Implicit foreign key field based on `Review`.`user`. It must match the value of `User`.`id`. See `@ref` for how to customize it.
38+
"""
39+
userId: String! @fdc_generated(from: "Review.user", purpose: IMPLICIT_REF_FIELD)
40+
}

0 commit comments

Comments
 (0)