A sample web app that summarizes reviews using the PaLM API and a Firebase AI extension.
reviewly-final.mp4
Run these commands in your terminal:
- Navigate to this web app folder and install dependencies:
cd reviewly-end
npm install
- Specify which project Firebase should use:
firebase use <name-of-your-project>
# For example: firebase use codelab-ai-extensions
- To deploy the extension used in this web app, run this command in your terminal:
Note: If you are asked Would you like to delete any other extensions
, select No.
firebase deploy --only extensions
-
Edit the
js/firebase-config.js
file with your Firebase configuration. -
Deploy the Cloud Function in the
functions
folder:
firebase deploy --only functions
- Deploy the Firestore and Cloud Storage Security Rules:
firebase deploy --only firestore:rules,storage
- Back in your terminal, run this command:
npm run dev
- And then navigate to the URL shown in your terminal, for example http://localhost:8080 or http://localhost:8000.
This has no AI functionality.
This is only useful for codelab authors, or learners who are unable to use a real Firebase project or real Google Cloud services.
- In your terminal, navigate to this web app folder:
cd reviewly-end
- Run this command to seed the Firestore emulator with some test data:
firebase emulators:start --project demo-codelab-ai-extension-reviewly --import=../firestore-export/
-
Edit the
js/firebase-config.js
file with your emulator configuration. -
In your terminal tab, run these commands:
npm install
npm run dev
- In the file
js/reviews.js
, uncomment theconnectFirestoreEmulator
line:
// Uncomment these lines to use the local emulator
connectFirestoreEmulator(db, "127.0.0.1", 8080);
connectFunctionsEmulator(functions, "127.0.0.1", 5001);
- And then navigate to the URL shown in your terminal, for example http://localhost:8080 or http://localhost:8000.