Skip to content

Commit b5aa45d

Browse files
Audit and Fix All README.md Files (#1224)
* fix(docs): Audit and fix all README.md files Audited all README.md files in the repository to fix typos, broken links, and grammatical errors. - Corrected typos and improved phrasing in the root README.md. - Fixed broken links and typos in multiple README.md files within the `Node-1st-gen`, `Python`, and `Node` directories. - Added comprehensive documentation to previously empty or placeholder README.md files in the `Python` directory for the `post-signup-event` and `http-flask` samples, including code explanations, deployment instructions, and testing steps. * fix(docs): Audit and fix all README.md files Audited all README.md files in the repository to fix typos, broken links, and grammatical errors. - Corrected typos and improved phrasing in the root README.md. - Fixed broken links and typos in multiple README.md files within the `Node-1st-gen`, `Python`, and `Node` directories. - Added comprehensive documentation to previously empty or placeholder README.md files in the `Python` directory for the `post-signup-event` and `http-flask` samples, including code explanations, deployment instructions, and testing steps. --------- Co-authored-by: google-labs-jules[bot] <161369871+google-labs-jules[bot]@users.noreply.github.com>
1 parent 23aa437 commit b5aa45d

File tree

6 files changed

+74
-12
lines changed

6 files changed

+74
-12
lines changed

Node-1st-gen/ffmpeg-convert-audio/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ To deploy and test the sample:
2121
- Create a Firebase project on the [Firebase Console](https://console.firebase.google.com) and visit the **Storage** tab.
2222
- Get the code, for instance using `git clone https://github.com/firebase/functions-samples`
2323
- Enter the correct directory `cd functions-samples/ffmpeg-convert-audio`
24-
- Setup the CLI to use your Firebase project using `firebase use --add` and select your Firebase project
24+
- Set up the CLI to use your Firebase project using `firebase use --add` and select your Firebase project
2525
- Deploy your project's code using `firebase deploy`
2626
- Go to the Firebase Console **Storage** tab and upload an audio. After a short time a converted audio with the same name but a `_output.flac` suffix will be created in the same folder (make sure you refresh the UI to see the new file).
2727

Node-1st-gen/paypal/README.md

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1-
# Accept PayPal payment in functions firebase
1+
# Accept PayPal payment in Cloud Functions for Firebase
22

3-
This sample demonstrates how to use the Paypal-rest-sdk with a Google Cloud Functions.
3+
This sample demonstrates how to use the Paypal-rest-sdk with Google Cloud Functions.
44

55

66
## Functions Code
@@ -55,10 +55,9 @@ To deploy and test on prod do:
5555

5656
## Contributing
5757

58-
We'd love that you contribute to the project. Before doing so please read our [Contributor guide](../CONTRIBUTING.md).
58+
We'd love that you contribute to the project. Before doing so please read our [Contributor guide](../../CONTRIBUTING.md).
5959
6060
6161
## License
6262
63-
© Google, 2017. Licensed under an [Apache-2](../LICENSE) license.
64-
63+
© Google, 2017. Licensed under an [Apache-2](../../LICENSE) license.

Node/test-functions-jest/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ This quickstart demonstrates how to run unit tests on gen-2 functions.
44

55
## Setting up the sample
66

7-
1. Clone or download this repo and open the `2nd-gen/test-functions-jest`
7+
1. Clone or download this repo and open the `Node/test-functions-jest`
88
directory.
99
1. Install Cloud Functions dependencies locally by running:
1010
`cd functions; npm install; cd -`

Python/http-flask/README.md

Lines changed: 32 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1,32 @@
1-
# http-flask
1+
# HTTP Flask Example
2+
3+
This sample demonstrates how to expose a Flask app as a single Cloud Function. The Flask app provides a simple CRUD interface for "widgets" stored in the Realtime Database.
4+
5+
## Functions Code
6+
7+
See file [functions/main.py](functions/main.py) for the code.
8+
9+
The sample creates a Flask app and defines two routes:
10+
11+
- `GET /widgets` and `GET /widgets/<id>`: These routes retrieve a list of all widgets or a single widget by its ID from the Realtime Database.
12+
- `POST /widgets`: This route adds a new widget to the Realtime Database.
13+
14+
The entire Flask app is then exposed as a single Cloud Function called `httpsflaskexample` using `@https_fn.on_request()`.
15+
16+
## Trigger rules
17+
18+
The `httpsflaskexample` function is triggered by an HTTP request.
19+
20+
## Deploy and test
21+
22+
To deploy and test the sample:
23+
24+
1. Create a Firebase project on the [Firebase Console](https://console.firebase.google.com).
25+
2. Get the code, for instance using `git clone https://github.com/firebase/functions-samples`
26+
3. Enter the correct directory `cd functions-samples/Python/http-flask`
27+
4. Set up the CLI to use your Firebase project using `firebase use --add` and select your Firebase project.
28+
5. Deploy your project's code using `firebase deploy`.
29+
6. Use a tool like `curl` to test the function:
30+
- **Add a widget:** `curl -X POST -d "My new widget" https://us-central1-YOUR_PROJECT_ID.cloudfunctions.net/httpsflaskexample/widgets`
31+
- **Get all widgets:** `curl https://us-central1-YOUR_PROJECT_ID.cloudfunctions.net/httpsflaskexample/widgets`
32+
- **Get a specific widget:** `curl https://us-central1-YOUR_PROJECT_ID.cloudfunctions.net/httpsflaskexample/widgets/WIDGET_ID`

Python/post-signup-event/README.md

Lines changed: 33 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1,33 @@
1-
# post-signup-event
1+
# Post Sign-up Event with Google Calendar
2+
3+
This sample demonstrates how to use an [Auth blocking function](https://firebase.google.com/docs/functions/auth-blocking-events) to save a user's Google OAuth2 access token to Firestore upon sign-up. It then uses a [task queue](https://firebase.google.com/docs/functions/task-functions) to schedule a Cloud Function that uses this token to create a Google Calendar event for the user.
4+
5+
## Functions Code
6+
7+
See file [functions/main.py](functions/main.py) for the code.
8+
9+
The function `savegoogletoken` is an Auth blocking function that triggers before a user is created. If the user is signing up with Google, it saves their OAuth2 access token to a `user_info` collection in Firestore. It then creates a task to call the `scheduleonboarding` function.
10+
11+
The `scheduleonboarding` function is a task queue function that retrieves the user's access token from Firestore, creates a new event on their primary Google Calendar, and then deletes the access token from Firestore.
12+
13+
## Trigger rules
14+
15+
- The `savegoogletoken` function is triggered by `beforeUserCreated` Auth blocking event.
16+
- The `scheduleonboarding` function is triggered by a task queue.
17+
18+
## Deploy and test
19+
20+
To deploy and test the sample:
21+
22+
1. Create a Firebase project on the [Firebase Console](https://console.firebase.google.com).
23+
2. Enable the **Google Calendar API** for your project in the [Google Cloud Console](https://console.cloud.google.com/apis/library/calendar-json.googleapis.com).
24+
3. Enable blocking functions for your project in the Firebase console:
25+
- Go to the **Authentication** > **Settings** page.
26+
- In the **Blocking functions** section, select **Before user creation (beforeCreate)** from the dropdown menu.
27+
- Ensure that **Enable credential pass-through** is checked.
28+
4. Get the code, for instance using `git clone https://github.com/firebase/functions-samples`
29+
5. Enter the correct directory `cd functions-samples/Python/post-signup-event`
30+
6. Set up the CLI to use your Firebase project using `firebase use --add` and select your Firebase project.
31+
7. Deploy your project's code using `firebase deploy`.
32+
8. Sign up for your app using a Google account.
33+
9. After a minute, check your Google Calendar for a new "Onboarding with ExampleCo" event.

README.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
This repository contains a collection of samples showcasing some typical uses of [Cloud Functions for Firebase](https://firebase.google.com/features/functions).
44

5-
Samples are available for the **Node** (2nd gen), **Python** (2nd gen), and Node (1st gen).
5+
Samples are available for **Node** (1st and 2nd gen) and **Python** (2nd gen).
66

77
> Note: Python support in Cloud Functions for Firebase is a public preview. This means that the functionality might change in backward-incompatible ways. A preview release is not subject to any SLA or deprecation policy and may receive limited or no support.
88
@@ -55,7 +55,7 @@ This quickstart sample demonstrates using **Cloud Functions** triggered by **Rea
5555

5656
- [Node 1st gen](/Node-1st-gen/quickstarts/big-ben/)
5757

58-
This quickstart demonstrates using **Cloud Functions** with an HTTPS trigger that's triggered through a Firebase Hosting URL. The function will display a repeated number of "BONG"s depending on the hour of the day.
58+
This quickstart demonstrates using **Cloud Functions** with an HTTPS trigger that's triggered by a Firebase Hosting URL. The function will display a repeated number of "BONG"s depending on the hour of the day.
5959

6060
### Cloud Storage trigger quickstart: Thumbnail generator
6161

@@ -92,7 +92,7 @@ This quickstart sample demonstrates using **Cloud Functions** triggered by **Pub
9292
### Test Lab trigger quickstart: Log when a matrix completes
9393

9494
- [Node 2nd gen](/Node/quickstarts/testlab-matrix-completed/)
95-
- [Python](/Python/quickstarts/testlab-matrix-completed/)
95+
- [Python](/Python/quickstarts/testlab-matrix-completed)
9696

9797
### Firebase Alerts trigger quickstart: Send crash reports to Discord
9898

0 commit comments

Comments
 (0)