-
Notifications
You must be signed in to change notification settings - Fork 0
Open
Description
Resources
Code Examples
- Full step by Step Example
- https://github.com/actions-on-google/dialogflow-facts-about-google-nodejs
- https://github.com/firebase/assistant-codelab
- https://developers.google.com/actions/dialogflow/first-app
- DialogFlow - Basic Fufillment Conversation, Weather API example with Javascript. This is how we would use another API
Firebase Documentation
- Cloud Functions Docs. Doing the example project will be helpful. Realtime Database Triggers and HTTP Triggers will be helpful.
- Realtime Database Docs. Look at REST section.
Webbook @JessePeplinski
- Create Webbook - - This is where we have all the business logic for responding to requests. This is also where the API integrations will go. We currently have boilerplate code.
- Connect Webhook - We'll connect this to Dialogflow once we have an endpoint. It is connected, and Dialogflow is now using our endpoint. Now when we talk in DialogFlow, it doesn't do anything interesting (yet) because we need to write code.
Project Design / Architecture
organizing-your-firebase-cloud-functions - this is how we should eventually structure our project
│
└───functions
│ index.js - Contains all cloud functions
└─── exports.dialogflowFirebaseFulfillment - contains all google action logic
└─── exports.createUserAccount - add user to db when they authenticate
└─── exports.cleanUpUserData - When a user is deleted, set flag in the db
Write Code
Google Actions & Dialogflow
Responses to our intents and add all relevant contexts and context parameters. Will be able to test this in Dialogflow by checking "use webhook".
- Locations
- List all locations
- Add
- Update
- Delete
- Items
- List all items
- Add
- Update
- Delete
- Expiration Dates
- List all expiration dates
- Add
- Update
- Delete
- Grocery List / Cart
- List all items in cart
- Add
- Update
- Delete
- Purchase
Routines and Reminders
- Reminder of the items that are expiring soon or that have expired
Database
@JessePeplinski and @ZacharyPeck to work together to integrate.
GREAT RESOURCE HERE
- Connect to DB
- Add users to DB with a cloud function (named
exports.addUsertoDatabaseWithAuth - Read something from DB (GET)
- Add something to DB (POST)
- Listen for changes onWrite see handle event data here. Not sure if we even have to do this with realtime database, but good for testing to make sure that we are actually manipulating db.
Dynamic Population
Update status of items based on intents. We will need to create separate intents for add / remove / delete. This can be tested from the Firebase Console --> Database.
- Locations
- List all locations
- Add
- Update
- Delete
- Items
- List all items
- Add
- Update
- Delete
- Expiration Dates
- List all expiration dates
- Add
- Update
- Delete
- Grocery List / Cart
- List all items in cart
- Add
- Update
- Delete
- Purchase