Setup Tutorial - Internet Archive Voice Apps Google Action
See the developer guide and release notes at https://developers.google.com/actions/ for more details.
- Fork repository.
- Go to directory ::
git clone <repository link>
- Use the Actions on Google Console to add a new project with a name of your choosing and click Create Project.
- Click
skip
["Actions Console" label on top left] - Go to actions under build, and click
Add your first action
- select custom intent, then
build
- Click
CREATE
(continued from above step) - Go to
settings
and clickexport and import
, then clickrestore from zip
. - zip the contents of
dialogflow
inmodels/dialogflow/
and use that zip to restore the project.
- Run server local with colorful logs
- Install node js if not installed before(Check for correct version of node by
node -v
.if notnvm install 8.16.0
andnvm use 8.16.0
) npm install -g firebase-tools
firebase login
[On the opened tab in your browser,login with the same account you created project on google actions]touch functions/.runtimeconfig.json
(For windows cli clone touch repository to use itgit clone https://www.github.com/zacharyjbaldwin/touch-for-windows.git
)firebase init
(remove .firebaserc first)firebase projects:list
[displays projects list with your account]firebase use --add
(choose the project you created in actions console, give an alias name)- add fake keys (temporary workaround) refer this
3.
firebase deploy --only functions
cd functions
andnpm install
DEBUG=ia:* npm start
(In windowsset debug=<project alias name>
thennpm start
)
To expose server to google assistant use ngrok its free plan should be enough.
To publish 5000 port use:
ngrok http 5000
you should find url https://<id>.ngrok.io/
.
Go to the fullfillment section of your dialogflow draft copy of our app and after that you should use this url:
https://<id>.ngrok.io/<your project name>/us-central1/assistant
- profile performance of requests
Env Variable:
PROFILE_REQUESTS=true
(false
by default)firebase functions:config:set performance.requests=true
type welcome in google assistant test It reponds Welcome to the music at the Internet Archive. Want to listen to 78s, Live concerts, Unlocked Recordings or Christmas music?
Now go to
internet-archive-voice-apps\functions\src\strings.js Find the text: welcome change acknowledge >Welcome to music at the Internet Archive(removing the) type welcome in google assistant test You will find the changes reflected as:Welcome to music at the Internet Archive. Want to listen to 78s, Live concerts, Unlocked Recordings or Christmas music?
π get one good first issue assign yourself (if you have access) or write comment that you'd like to work on this issue. That's help to prevent work overlapping.
create git branch feature/<name-of-feature>
, more
π» working on it
Use Mocha for continuous checking of your code quality and cover functionality by tests
npm run mocha -- --watch
β Complete checking of code by run unit tests and code style checking
npm test
π We follow standard javascript code style.
Automatic style fixing, it doesn't solve all problems but could be very helpful
npm run lint -- --fix
π Finally make Pull Request and give complete description what have you done and link the addressed issue.
Also it could be good practice to create your Pull Request earlier,
but add WIP:
at the beginning of its name! This way other developers
could see what are you working right now.