From 17e6eea5d716fd9805ae491f12e8110be7f0bfcd Mon Sep 17 00:00:00 2001 From: Michael Fan Date: Fri, 16 Jul 2021 16:50:13 -0400 Subject: [PATCH] Add sample data, simplify Firebase files --- .firebaserc | 9 --------- README.md | 2 +- firebase.json | 17 ----------------- package.json | 2 +- sample_data/firebase-export-metadata.json | 8 ++++++++ .../all_namespaces_all_kinds.export_metadata | Bin 0 -> 52 bytes .../all_namespaces/all_kinds/output-0 | Bin 0 -> 5785 bytes .../firestore_export.overall_export_metadata | Bin 0 -> 95 bytes 8 files changed, 10 insertions(+), 28 deletions(-) create mode 100644 sample_data/firebase-export-metadata.json create mode 100644 sample_data/firestore_export/all_namespaces/all_kinds/all_namespaces_all_kinds.export_metadata create mode 100644 sample_data/firestore_export/all_namespaces/all_kinds/output-0 create mode 100644 sample_data/firestore_export/firestore_export.overall_export_metadata diff --git a/.firebaserc b/.firebaserc index 7f21596..5ff84bc 100644 --- a/.firebaserc +++ b/.firebaserc @@ -1,13 +1,4 @@ { - "targets": { - "gt-recycling": { - "hosting": { - "recycling-frontend": [ - "gt-recycling" - ] - } - } - }, "projects": { "default": "gt-recycling" } diff --git a/README.md b/README.md index bc9ff94..503cb26 100644 --- a/README.md +++ b/README.md @@ -41,10 +41,10 @@ To run locally for development: 1. Go back to the project root directory and run `npm start` 1. This will start a local development instance. In a web browser, navigate to http://localhost:4200/ to view 1. This also starts the [Firebase emulators](https://firebase.google.com/docs/emulator-suite). The website mostly uses emulated resources during development instead of production data. + 1. Some sample data is automatically imported for testing purposes. 1. Firestore and Functions are emulated. Authentication uses production auth data, and is not emulated due to lack of need. 1. Firestore Rules are not emulated, so be mindful when testing new changes. 1. If you need the emulated database to contain record data, there are two Functions endpoints (`seedRouteRecords` and `seedCheckinRecords`) to help you by seeding some data. - 2. A Firebase Hosting version of our website is emulated, at http://localhost:5000/. It may behave unexpectedly, so use the 4200 website instead. For some reason, this can't be shut off, but we can just ignore it. ### Deploying this code diff --git a/firebase.json b/firebase.json index d663c81..ffde5d9 100644 --- a/firebase.json +++ b/firebase.json @@ -1,21 +1,4 @@ { - "hosting": [ - { - "target": "recycling-frontend", - "public": "dist/recycling-frontend", - "ignore": [ - "firebase.json", - "**/.*", - "**/node_modules/**" - ], - "rewrites": [ - { - "source": "**", - "destination": "/index.html" - } - ] - } - ], "functions": { "predeploy": [ "npm --prefix \"$RESOURCE_DIR\" run lint" diff --git a/package.json b/package.json index dce71a4..768a5e4 100644 --- a/package.json +++ b/package.json @@ -6,7 +6,7 @@ "build-prod": "ng build --prod", "dev": "ng serve", "e2e": "ng e2e", - "emulate": "firebase emulators:start", + "emulate": "firebase emulators:start --import=./sample_data", "lint": "ng lint", "ng": "ng", "start": "concurrently \"npm run dev\" \"npm run emulate\"", diff --git a/sample_data/firebase-export-metadata.json b/sample_data/firebase-export-metadata.json new file mode 100644 index 0000000..c1422b9 --- /dev/null +++ b/sample_data/firebase-export-metadata.json @@ -0,0 +1,8 @@ +{ + "version": "9.12.1", + "firestore": { + "version": "1.12.0", + "path": "firestore_export", + "metadata_file": "firestore_export/firestore_export.overall_export_metadata" + } +} \ No newline at end of file diff --git a/sample_data/firestore_export/all_namespaces/all_kinds/all_namespaces_all_kinds.export_metadata b/sample_data/firestore_export/all_namespaces/all_kinds/all_namespaces_all_kinds.export_metadata new file mode 100644 index 0000000000000000000000000000000000000000..9ba805cc3c0e257779a09a4afd4e25c480e11568 GIT binary patch literal 52 zcmd;5;Sxy8EJ`gd$uCNcPpv4(FDemOFn#O(T`xW|NqkraVF>YXF$i(wmzETimgpJ) E05qBvbN~PV literal 0 HcmV?d00001 diff --git a/sample_data/firestore_export/all_namespaces/all_kinds/output-0 b/sample_data/firestore_export/all_namespaces/all_kinds/output-0 new file mode 100644 index 0000000000000000000000000000000000000000..47956fcd86ccd1e7969740497ac2d94689303f86 GIT binary patch literal 5785 zcmd^DZ)jUp6wj+^lP>96vohMN9i6gG3qtea(r$Af`e*IdW=sDqZ8EjXpVu@mFMs;- z5}PaYPZb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