Skip to content
This repository was archived by the owner on Jun 24, 2025. It is now read-only.

Commit a59bdb6

Browse files
author
Tyler Ayers
committed
updated firestore demo
1 parent be873d6 commit a59bdb6

1 file changed

Lines changed: 13 additions & 10 deletions

File tree

tutorial-demos/firestore-demo/README.md

Lines changed: 13 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
# Apigee Firestore Quickstart & Adapter
2-
This repository contains a quickstart proxy for the [Apige API Management](cloud.google.com/apigee) platform to connect to a collection in a [Firestore](cloud.google.com/firestore) database. The API provided by the proxy can then be easily used by any REST clients, including [AppSheet](cloud.google.com/appsheet) no-code apps.
2+
This repository contains a quickstart proxy for the [Apige API Management](https://cloud.google.com/apigee) platform to connect to a collection in a [Firestore](https://firebase.google.com/products/firestore) database. The API provided by the proxy can then be easily used by any REST clients, including [AppSheet](https://cloud.google.com/appsheet) no-code apps.
33

44
## Prerequisites
55
Firestore is a great document database for storing any kind of unstructured data, however we do need some structures to automatically use any database with this quickstart.
@@ -18,20 +18,21 @@ As you can see, only primitive data types are supported in the Firestore documen
1818
## Quickstart deploy
1919
The fastest way to deploy and spin up an API offering CRUD operations on your Firestore database is to import the **Firestore Quickstart** proxy bundle in Apigee, and then set these properties:
2020

21-
1. In the default Endpoint PreFlow, replace the following variables in the 1st policy **Set-Firestore-Variables** to your own values:
21+
1. Download the [Apigee Firebase Quickstart Proxy 0.8.zip](https://github.com/apigee/api-platform-samples/releases/tag/v0.8-beta) bundle and import it into your Apigee environment.
22+
2. In the default Endpoint PreFlow, replace the following variables in the 1st policy **Set-Firestore-Variables** to your own values:
2223
1. **GCP_PROJECT** - replace with the GCP project name where your Firestore database is located.
2324
2. **firestore.key** - in case the **id** index field isn't named **id** in the Firestore documents (see prerequisites above), then you should set the correct name here (it is recommended to just use **id**).
2425
3. **GCP_SVC_KEY** - set this to your GCP service account private key (which has the permissions to access Firestore in your GCP project) from the **private_key** field in the key JSON file (beginning with -----BEGIN PRIVATE KEY----- and ending with -----END PRIVATE KEY-----)
2526
4. **GCP_SVC_EMAIL** - set this to the GCP service account email address from the **client_email** field in the private key JSON file.
26-
2. Change the proxy basepath to something meaningful (default is **/importantstuff**, for no particular reason)
27-
3. Deploy the proxy. By default an API key is activated for the proxy, disable the 2nd policy in the PreFlow if you want to test without one. Now you can call https://host/basepath/collection/document to all CRUD operations on your Firestore data, using simple JSON payload messages. WooHoo!
28-
4. You can also use this proxy as an API data source in an AppSheet app, it will just work.
27+
3. Change the proxy basepath to something meaningful (default is **/importantstuff**, for no particular reason)
28+
4. Deploy the proxy. By default an API key is activated for the proxy, disable the 2nd policy in the PreFlow if you want to test without one. Now you can call https://host/basepath/collection/document to all CRUD operations on your Firestore data, using simple JSON payload messages. WooHoo!
29+
5. You can also use this proxy as an API data source in an AppSheet app, it will just work.
2930

3031
## Example
3132
An example is deployed for this Firestore data structure:
3233
```json
3334
{
34-
"name": "projects/tyler-240211/databases/(default)/documents/jokes/8ebb59f9",
35+
"name": "projects/...",
3536
"fields": {
3637
"funny": {
3738
"booleanValue": true
@@ -57,9 +58,7 @@ An example is deployed for this Firestore data structure:
5758
"timestamp": {
5859
"timestampValue": "2020-10-08T13:05:29Z"
5960
}
60-
},
61-
"createTime": "2020-10-08T11:06:55.234785Z",
62-
"updateTime": "2020-10-08T11:21:56.903039Z"
61+
}
6362
}
6463
```
6564
This proxy then offers REST CRUD APIs with this much nicer structure:
@@ -74,4 +73,8 @@ This proxy then offers REST CRUD APIs with this much nicer structure:
7473
"location": "29.987294, -39.6875"
7574
}
7675
```
77-
The OpenAPI spec for the example is under /specs, and can also be used to create an AppSheet app based on the API.
76+
The OpenAPI spec for the example is under /specs, and can also be used to create an AppSheet app based on the API.
77+
78+
Here is an example AppSheet app using this API proxy.
79+
80+
<iframe src="https://www.appsheet.com/start/8a3ad802-67c5-4796-9bc6-7dbe1a3ced3d#_currentLat=39.385364&_currentLng=-80.437768&_mapType=roadmap&_zoom=4&appName=JokesApp-1224517&page=google-map&table=jokes&view=Map" title="Jokes App" width="400" height="700"></iframe>

0 commit comments

Comments
 (0)