Skip to content

Commit 3c13462

Browse files
committed
docs: update and correct documentation
- Updates the README.md file to be more accurate and to point to the documentation in the docs/ directory. - Updates the documentation in the docs/ directory to be more complete and to correct stale information.
1 parent e199068 commit 3c13462

File tree

4 files changed

+23
-8
lines changed

4 files changed

+23
-8
lines changed

firestore/README.md

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -32,9 +32,9 @@ Follow these steps to setup and run the quickstart:
3232
npm -g i firebase-tools
3333
```
3434

35-
1. Install and build all project dependencies
35+
1. Install all project dependencies
3636
```bash
37-
npm install && (cd functions && npm install)
37+
npm install && (cd functions && npm install) && (cd scripts && npm install)
3838
```
3939

4040
> **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.
@@ -49,7 +49,9 @@ Follow these steps to setup and run the quickstart:
4949

5050
Follow these steps to have a working version of the quickstart running with the Firebase console:
5151

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.
52+
> **Note on Billing:** Firebase offers two main pricing plans: the Spark Plan (free) and the Blaze Plan (pay-as-you-go). The Spark Plan has a generous free tier for many services, including Cloud Functions. If you exceed the limits of the Spark Plan, your app's usage of that particular service will be capped for the rest of the billing cycle to prevent any charges. The Blaze Plan gives you the same free tier as the Spark Plan, but you are billed for any usage that exceeds those limits.
53+
>
54+
> For more information, see the [Firebase pricing page](https://firebase.google.com/pricing).
5355
5456
1. Create a new Firebase project in the [Firebase Console](https://console.firebase.google.com)
5557
@@ -90,7 +92,7 @@ Follow these steps to have a working version of the quickstart running with the
9092
```bash
9193
npm run production
9294
```
93-
> **Note:** If you've opted to set up a billing plan and wish to deploy functions as well, replace the `firebase deploy --only firestore` on line 8 of `package.json` with `firebase deploy`.
95+
> **Note:** If you've opted to set up a billing plan and wish to deploy functions as well, replace the `firebase deploy --only firestore` on line 9 of `package.json` with `firebase deploy`.
9496

9597
11. (Optional) Populate production Firestore with mock data
9698

firestore/docs/backend.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,3 +15,9 @@ The following commands are available for the backend (run from the `functions` d
1515
The Firebase Functions are located in the `functions/src/index.ts` file. Here is a brief overview of their purpose:
1616

1717
* **`updateNumRatings`**: This function is triggered when a new rating is added to a restaurant's `ratings` sub-collection. It recalculates the average rating for the restaurant and updates the `avgRating` and `numRatings` fields in the corresponding restaurant document.
18+
19+
## Note on Billing
20+
21+
Firebase offers two main pricing plans: the Spark Plan (free) and the Blaze Plan (pay-as-you-go). The Spark Plan has a generous free tier for many services, including Cloud Functions. If you exceed the limits of the Spark Plan, your app's usage of that particular service will be capped for the rest of the billing cycle to prevent any charges. The Blaze Plan gives you the same free tier as the Spark Plan, but you are billed for any usage that exceeds those limits.
22+
23+
For more information, see the [Firebase pricing page](https://firebase.google.com/pricing).

firestore/docs/data-model.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ The Friendly Eats application uses two main collections in Firestore: `restauran
44

55
## `restaurants`
66

7-
This collection contains a document for each restaurant. The structure of a restaurant document is as follows:
7+
This collection contains a document for each restaurant. The structure of a restaurant document is defined in the [`restaurant.ts`](../src/types/restaurant.ts) file.
88

99
* `id` (string): The unique identifier for the restaurant.
1010
* `avgRating` (number): The average rating of the restaurant.
@@ -17,11 +17,11 @@ This collection contains a document for each restaurant. The structure of a rest
1717

1818
## `ratings`
1919

20-
This is a sub-collection of a restaurant document. It contains a document for each rating that a restaurant has received. The structure of a rating document is as follows:
20+
This is a sub-collection of a restaurant document. It contains a document for each rating that a restaurant has received. The structure of a rating document is defined in the [`ratings.ts`](../src/types/ratings.ts) file.
2121

2222
* `id` (string, optional): The unique identifier for the rating.
2323
* `rating` (number): The rating given by the user (1-5).
2424
* `text` (string): The text of the review.
2525
* `timestamp` (Date, optional): The timestamp of the review.
2626
* `userId` (string, optional): The ID of the user who submitted the review.
27-
* `userName` (string, optional): The name of the user who submitted the review.
27+
* `userName` (string, optional): The name of the user who submitted the review.

firestore/docs/setup.md

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,13 @@ This document provides step-by-step instructions for setting up the Friendly Eat
99
* [Angular CLI](https://angular.io/cli)
1010
* [Firebase CLI](https://firebase.google.com/docs/cli)
1111

12+
To install the CLIs globally, run the following commands:
13+
14+
```bash
15+
npm install -g @angular/cli
16+
npm install -g firebase-tools
17+
```
18+
1219
## Installation
1320

1421
1. **Clone the repository:**
@@ -73,4 +80,4 @@ This document provides step-by-step instructions for setting up the Friendly Eat
7380
* **For a production project:**
7481
```bash
7582
npm run populate-production
76-
```
83+
```

0 commit comments

Comments
 (0)