Skip to content

a technical test for the Senior Software Developer on Torre.

License

Notifications You must be signed in to change notification settings

ElCuboNegro/Torre-Assistant

Repository files navigation

Torre Assistant

Description:

Kronos Torre is a Google Action that can help you to find a job. Note: this project is not intended to production. use Vue, nuxt or any other way to render pages inside google assistant is not recomended and this is only an example intended to show the use of this tools.

this project is NOT INTENDED FOR PRODUCTION and is just made for demostrative purposes.

A way better and simplier way to perform this divelopment is through rich responses and SSML, but that kind of efforts don't allow you to modify the frontend at any level. Some of the functions should be approved by google before shown as part as google assistant, however you can explore them at:

https://torre-assistant.web.app

the project can be tested in the alpha release from the following link: https://assistant.google.com/services/a/uid/000000c2fdcd53e1?hl=es

that will give you access to some features related with google actions.

To quick apply to torre jobs, there will be needed public API's

Installation:

NodeJS

Download and install Node.js according to the Node.js documentation to use the fulfillment library. Your installation of Node.js also allows you to install the Firebase CLI with npm, and later, to run your conversational fulfillment implementation locally.

Gactions

Install the gactions command line interface (CLI) tool by downloading an installation package, unpacking it, and configuring your execution path.

To install and configure gactions, follow these steps:

  1. Download the appropriate package for your operating system:
Platform Package checksum
Windows Download sha256
Linux Download sha256
Mac Download sha256
  1. Extract the package to a location of your choice and add the binary to your environment's PATH variable. Alternatively, extract the package to a location that's already in your PATH variable (for example, /usr/local/bin).
  2. On Linux and Mac, enable execute permissions if necessary:
$ chmod +x PATH_TO/gactions
  1. Run the following command to authenticate the CLI. This command starts an authentication flow and requires a web browser:
$ gactions login
  1. When the flow is complete, the CLI automatically authenticates.

Firebase CLI

Install and set up the Firebase CLI according to the Firebase documentation. The Firebase CLI lets you deploy an Interactive Canvas web app to Firebase Hosting and, if necessary, manually deploy fulfillment to Cloud Functions for Firebase.

Usage:

Create and setup the project:

Before you can use the gactions command-line tool, you must create a project in the Actions console and give gactions access to the project. To create and set up a copy of this project, do the following:

Go to the Actions console. Click New project, enter a project name, and click Create project, Select the games category (this will allow us to create html canvas inside the action) and click Next. Select Blank project and click Start building. Enable the Actions API in the Google Cloud console by following the instructions in Enable and disable APIs. This allows gactions to interact with your project.

Get the Torre Assistant code

  1. clone this repository into your local machine
  2. Open the 'torre-assistant'/sdk/settings/settings.yaml file and change the value of the projectId (torre-assistant) field to YOUR project's ID. (it won't deploy if there is a colission with other firebase project)

Deploy and test the Assistant

After you set up the project, you can deploy the Torre Assistant web app and your Actions project. This process creates a draft version of your Actions project that you can deploy to the Actions simulator for previewing and testing:

  1. From the torre-assistant/ directory, run the following command to deploy the Torre Assistant web app (the contents of the public/ directory).
    firebase deploy --project PROJECT_ID --only hosting
    
    You can see a rendered version of the web app at the URL returned by the Firebase CLI in a browser: https://PROJECT_ID.web.app.
  2. Open the torre-assistant/sdk/webhooks/ActionsOnGoogleFulfillment/index.js file and change the value of the CANVAS_URL variable to your project's web app URL.
const CANVAS_URL = 'https://PROJECT_ID.web.app';
  1. Open the torre-assistant\sources\frontend\src\util\client.jsfile and change the value of the baseURL.
	baseURL: "https://PROJECT_ID.web.app/api/v1"
  1. Compile the frontend with
npm run build
  1. create a .env file with the following information (change for the info that applies to you):

    category= GAMES_AND_TRIVIA
    defaultLocale= es
    developerEmail= [email protected]
    developerName= Juan José Albán Ortiz
    displayName= Torre Assistant
    fullDescription= The assistantis a voice interface to Torre.co
    privacyPolicyUrl= https=//torre.co/privacy
    pronunciation= Torre Asistant
    shortDescription= Get your dream job
    smallLogoImage=
    termsOfServiceUrl= https=//torre.co/terms
    projectId= "torre-assistant"
    
    # BackEndConfiguration
    apiURL = https=//us-central1-torre-assistant.cloudfunctions.net/api
    
    # Database
    
    PORT= 7777
    DEBUG= TRUE
    DB_USERNAME=
    DB_PASSWORD=
    DB_NAME=
    DB_HOST=
    DB_PORT=
    DB_DIALECT=

    fill all the parts with the correct information of your database.

  2. From the torre-assistant/sdk/ directory, run the following command to push the local version of your Actions project to the console as a draft version:

gactions push 
  1. From the torre-assistant/sdk/ directory, run the following command to test your Actions project in the simulator:
gactions deploy preview
  1. Open the link that the command-line tool returns to go to the simulator.

Pending jobs:

  1. connect the NLU to the webapp: ETA -> 4 days
  2. finish the account linking integration: ETA -> 12 hours
  3. connect the account handler to the webapp: ETA -> 2 days
  4. connect to a custom smalltalk engine: ETA -> 6 days

Contributing

TBD

Credits:

Google Actions SDK -> Google LLC. Nuxt.js -> Creators CI integration -> @pandres95

License:

Copyright, Juan José Albán (2021)

About

a technical test for the Senior Software Developer on Torre.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published