Skip to content

Commit 3703d46

Browse files
authored
FriendlyEats ReadMe updates for Firebase Console setup (#726)
* Add images and initial README changes * Typo fixes and functions disclaimer * Add Firestore Photo * Additional info * Small changes * Callout for funcitons in deployment script * Address comments; Add addendum about functions * delete glyph
1 parent 87103cc commit 3703d46

File tree

9 files changed

+61
-2
lines changed

9 files changed

+61
-2
lines changed
-4.4 MB
Binary file not shown.

firestore/angular-rewrite/README.md

Lines changed: 61 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
FriendlyEats is a restaurant recommendation app built on Firestore. It was built with the [Angular](https://angular.io/) Javascript framework, and can make use of [Firebase's Local Emulator Suite](emulator-docs) (specifically, the [Authentication](https://firebase.google.com/docs/emulator-suite/connect_auth), [Storage](https://firebase.google.com/docs/emulator-suite/connect_storage), [Functions](https://firebase.google.com/docs/emulator-suite/connect_functions), and [Firestore](https://firebase.google.com/docs/emulator-suite/connect_firestore) emulators) so that the quickstart can be run without needing to create a project in the [Firebase Console](https://console.firebase.google.com).
88

99
For more information about Firestore visit the [Firestore docs][firestore-docs].
10+
1011
For more information about the Firebase Emulator Suite visit the [Emulator Suite docs][emulator-docs]
1112

1213
[firestore-docs]: https://firebase.google.com/docs/firestore/
@@ -17,7 +18,7 @@ Before following the steps to build and run this quickstart you will need:
1718
1. [Node.Js](https://nodejs.org/en/download) Version 16.0 or higher
1819
2. [Java](https://jdk.java.net/) JDK version 11 or higher.
1920

20-
## Setup and run the app locally:
21+
## Configure and run the app locally with emulators:
2122

2223
Follow these steps to setup and run the quickstart:
2324

@@ -36,14 +37,72 @@ Follow these steps to setup and run the quickstart:
3637
npm install && (cd functions && npm install)
3738
```
3839

39-
***Note:** When modifying the contents of `functions/src`, be sure to run `npm run build` in the `functions/` directory so that Typescript changes can be compiled bundled into the next emulator run.*
40+
> **Note:** When modifying the contents of `functions/src`, be sure to run `npm run build` in the `functions/` directory so that Typescript changes can be compiled and present in the next emulator run.
4041

4142
1. Run and serve the project locally:
4243
```bash
4344
npm start
4445
```
4546
1. Open [http://127.0.0.1:4200](http://127.0.0.1:4200) in your browser and try out the app!
47+
48+
## Configure and run the app with the Firebase Console:
49+
50+
Follow these steps to have a working version of the quickstart running with the Firebase console:
51+
52+
> **Note:** In the original application (that runs on the emulators), there is a Firebase Function that updates the `avgRating` field of a restaurant whenever that restaurant recieves a review. While **Authentication**, **Storage**, and **Firestore** are offered as free services through the Firebase console, using Firebase **Functions** on the Firebase Console requires a billing plan. There is a [free tier billing plan](https://firebase.google.com/pricing) that allows up to 2 million free function calls per month, but enabling this plan requires presenting payment information to Firebase. The following instructions, therefore, exclude those steps needed to deploy and host functions on the Firebase Console. All application functionality, other than the auto-updating `avgRating` field for restaurants, is conserved.
53+
54+
1. Create a new Firebase project in the [Firebase Console](https://console.firebase.google.com)
55+
56+
2. On the project homepage, select `Web` under `Get Started By Adding Firebase To Your App` and follow prompts to create your app, making sure to **copy the `firebaseConfig` object** when presented.
4657

58+
![Photo of Firebase Project Homepage](images/ProjectHomepage.png)
59+
60+
![Photo of firebaseConfig object](images/CopyWebConfig.png)
61+
62+
3. With the `firebaseConfig` copied, navigate to `src/environments/environments.ts` and paste the contents of the object into the `prod` field:
63+
64+
![Photo of `environments.ts` file with mock firebase web config info copied](images/environments-ts.png)
65+
66+
4. On line 79 of `src/app/app.module.ts`, change your environment from `environments.local` to `environments.prod` in the `provideFirebaseApp` function call
67+
68+
![Photo of `environments.prod` selection in `src/app/app.module.ts`](images/ProdAppModule.png)
69+
70+
5. Back in the Firebase console, enable email and password authentication on your project by doing: **Authentication > SIGN-IN METHOD > Email > Email/Password > SAVE**
71+
72+
![Photo of the enable email/password screen on Firebase Authentication page](images/Enable-Email.png)
73+
74+
6. In the Firebase console, enable Firestore on your project by clicking **Create Database** in the **Cloud Firestore** section of the console and answering all prompts.
75+
76+
* When prompted, select "Start in Test Mode"
77+
78+
![Photo of Firebase Firestore Setup](images/EnableFirestore.png)
79+
80+
7. Simmilarly, enable Cloud Storage on your project by clicking **Get Started** in the **Storage** section of the console and answering all prompts.
81+
82+
* When prompted, select "Start in Test Mode"
83+
84+
![Photo of Firebase Storage Setup](images/EnableStorage.png)
85+
86+
8. Set the CLI to use the project you created in Step 1:
87+
88+
```bash
89+
firebase --use add
90+
```
91+
92+
9. Deploy the firebase security rules and indexes
93+
94+
```bash
95+
firebase deploy --only firestore
96+
```
97+
98+
> **Note:** If you've opted to set up a billing plan and wish to deploy functions as well, replace this command with simply `firebase deploy`.
99+
100+
10. Serve your Angular app and see it connect to the Firebase Console!
101+
102+
```bash
103+
ng serve
104+
```
105+
47106
## Support
48107
49108
- [Firebase Support](https://firebase.google.com/support/)
155 KB
Loading
179 KB
Loading
333 KB
Loading
351 KB
Loading
97 KB
Loading
144 KB
Loading
114 KB
Loading

0 commit comments

Comments
 (0)