Hosting SUSI.AI Web Chat on Firebase
“I often wonder if my smartphone or laptop could become a bit smarter… And, I could talk to it the way I talk to my best friend… Wouldn’t that be cool if I could customise my phone’s assistant and enhance its ‘personality’ whenever I want? Or maybe ‘teach it a little more than others to make its intelligence outshine other students in its class?’ Well, that’s what we aim to achieve in the name of SUSI.AI” Currently, SUSI.AI is in its growing stage and a number of dedicated developers have been working hard to achieve an open source alternative to existing personal assistants like Google Assistant, Alexa and so on. Each one of them has been focussing on improving existing features or introducing new ones. This blog focuses on hosting the SUSI Webchat using Firebase Hosting. It presents the proper sequence of steps that need to be followed to deploy the web chat on Firebase Hosting. What is Firebase Hosting? Firebase Hosting provides fast and secure static hosting for web app. It is a production-grade web content hosting for developers. With Hosting, one can quickly and easily deploy web apps and static content to a global content-delivery network (CDN) with a single command. Hosting gives a project a subdomain on the 'firebaseapp.com' domain. Using the Firebase CLI, the files can be deployed from local directories on a computer to the Hosting server. Files are served over an SSL connection from the closest edge server on the global CDN. Steps : Install the Firebase CLI The Firebase CLI (Command Line Interface) requires Node.js and npm, which can both be installed by following the instructions on https://nodejs.org/. Installing Node.js also installs npm. Note : The Firebase CLI requires Node.js version 5.10.0 or greater. Once Node.js and npm have been installed, install the Firebase CLI via npm: $ npm install -g firebase-tools This installs the globally available firebase command. To update to the latest version, simply re-run the same command. Now login to the Firebase console using $ firebase login Initialize the app Choose the Firebase app that you would like to deploy and then cd into the project directory and run the command: $ firebase init Once this command runs, you would be prompted to choose from the following options : Database: Deploy Firebase Realtime Database Rules Firestore: Deploy rules and create indexes for Firestore Functions: Configure and deploy Cloud Functions Hosting: Configure and deploy Firebase Hosting sites Storage: Deploy Cloud Storage security rules Choose Hosting (use the cursor keys to move the pointer to ‘Hosting’ and then select it by pressing Spacebar key followed by the Enter key). Now, you would be prompted to select a project from the Firebase console that you would like to associate with the web chat. You can create a new project by logging into the Firebase console from a web browser and then follow the steps below : 1) If you don't have an existing Firebase project, click ‘Add Project’ and enter either an existing…
