How to embed Google Assistant in web application? - jsf

Is it possible to include the google assistant into my local web application so that everyone can use it? I've got a JSF-Application that runs on a local tomcat 7 server. My goal is to change the views by voice. I want to do it with the google assistant sdk.
There is the service sdk (python, all functions) and the library sdk(gPRC (java), general function). I tried the java-client, but the hotword detection only works for the service sdk. I need the hotword detection.
Can I run the service python google assistant and my jsf-app on one tomcat server? I can't get my head around it and need your help.
This is only the first step to my goal. Have you any suggestions?

Hotword detection would be non-trivial to implement. A web application contains two parts: a client, which would be the web browser, and the server, which is your local tomcat server.
Web apps basically work with multiple clients communicating to one server through HTTP requests, primarily through Javascript. Your server then processes this, and the cool thing is that the server can be any language you want.
However, the client cannot directly interact with server-side code. This means that locally running feature like hotword detection on the server cannot be directly controlled by the client. You'd need to use a client-side hotword detection library, which would presumably need to be written in Javascript.

Related

How can I convert a HTML template into a Node.JS web app

I'm starting out on my Node.JS journey and I discovered a fantastic boilerplate over at https://github.com/azouaoui-med/pro-sidebar-template. I'm unsure though how to turn the static html into a web app. Just wondering how someone with more experience would do this?
Do I take the html and translate it into a PUG template file? I'm guessing to then make the onclick / links actually run some code, i'd need to point them at the routes setup in the web app?
Sorry to ask such inexperienced questions, web apps seem to take a vastly different approach to the desktop apps i'm familiar with programming
I'm wanting to create a web app that runs on a server, which I will later put on the desktop via electron.
thanks
The project you have is using browser-sync which indirectly uses NodeJS to run a local server and host the web application files.
Do I take the HTML and translate it into a PUG template file?
I am not sure about this question unless you specifically want to use server-side rendering I am not sure I would recommend this to start with especially if you plan to later convert this to a desktop application.
[Note* - Assuming you are referencing this library PUGJS in statements above ]
Now For this requirement I'm wanting to create a web app that runs on a server, which I will later put on the desktop via electron.
This will require you to make your data serving layer which is most commonly called backend separate from that of the data viewing layer which is most commonly referred to as front-end. Thus a case for using the same data layer across different types of clients viz. A web application and/or A desktop application ( electron if you choose so )
Step 1 - Define what sort of web application architecture you want to follow or use. This will be based on your project and business requirements. From what information I have so far I would suggest a simple client-server architecture where your frontend or web-application is the client which makes REST API calls to the backend (API Server) and thus produces a meaningful result.
Step 2 - Start with the creation of 2 projects a frontend where your HTML, CSS JS, etc will be and a simple NodeJS script to serve this static web app when deployed on the server. I am going with NodeJS since the context of this question is suggesting the same.
Step 3 - The other project which will only be an API Server or Backend. This server will provide only REST API to the frontend. This server will talk to the database and provide other services like authentication and logging etc. You can use expressJS for this also in the frontend project.
Here is a simplistic representation of the client-server model which you can reference.
Some additional links for you to digest.
What is the difference between a web application and a client/server application?
https://medium.com/codiumclub/web-application-architecture-part-1-guide-to-become-full-stack-developer-cc9526a3519b

Implementing webhook from a sub app in node.js

I have to implement a platform using Node.js where a file should be obtained from some other site using the webhook. But I could not find a site with the required features. So, I have to create another app to run in the background which have to send files at a regular interval. Those files should reach the platform by using the webhook. I don't know how to implement this scenario. Any suggestions?

Native apps, Web apps communicating with same application server

Hello guys i was learning web developments and have a simple question. If i built a e-commerce web page using node.js and ejs template engine and everything works fine. The next decision is to build a native app for the same e-commerce site either android or IOS. I want the native app to also communicate with the same application server designed in node.js. Do i have to redesign the application server?
My approach or thought:
Native app will have to consume data either xml or json. So i will have to change the business logic of my endpoints. And if i do it this way, i will also have to change the way the web ui interacts with the application server and it also has to consume json or xml response using ajax call. Is my thinking or approach on the right track? But if using node.js, should i avoid the template engines?
Yes, you have to redesign the application server logic by exposing API endpoints. As mobile apps (iOS/Android) will interact with the server using these API endpoints, via JSON. And this will affect your web page also, as everything thing now has to be done via AJAX calls.
Best practice is to built a single page web application using Angular or React.
That way both your mobile app and web app would behave almost the same.

Web long polling using parse.com

My problem is that I am building a app using parse (http://parse.com) and also a website to support it but didn't find a solution to add the "instant messaging" feature to web (Like facebook messaging)
The app (IOS) has a messaging feature that uses push notifications and works just fine.
What can I use for the web part to emulate that? Is it possible to use long polling somehow? What options are available?
I have tried using cloud code but was unsuccessful

Metro Ui Security Architecture

Does anyone know of any article/publication on the security architecture of Metro app?
For example, can the metro app call an external service. If it can,
under what condition. Will it prompt the user first? And if so will
they be able to change their restriction later and how?
Cross domain scripting in a website is usually considered a big
no-no. But if I were to turn the same code into a metro app (since
presumably they're both written in Html 5 + js), does it mean I can
make ajax calls to any server irrespective of their domain? Is it
even possible to port a website into an app? If so how easy is that?
What about accessing local file system? Or does it have to go
through the contracts to do so?
And this is kind of related but if I were to write a website (not an
app). And the site was opened using Metro IE10, can it subscribe
into the metro specific js events? I guess I'm trying to figure out
how to save cost by doing as little development as possible. I
prefer a website that can target multiple platforms and only target
specific platform for the features that absolutely require it - also
not to thrilled with the idea of having to go through microsoft in
order to publish my app.
Any help appreciated.
Metro applications can call into web services located on other machines, but their ability to interact with the local machine is severely limited.
Similarly, accessing arbitrary parts of the local filesystem is not permitted. If your application has the documents (or music or photos) library permission, it can access the files in those libraries.

Resources