Reader small image

You're reading from  Google Cloud AI Services Quick Start Guide

Product typeBook
Published inMay 2018
Reading LevelIntermediate
PublisherPackt
ISBN-139781788626613
Edition1st Edition
Languages
Right arrow
Author (1)
Arvind Ravulavaru
Arvind Ravulavaru
author image
Arvind Ravulavaru

Arvind Ravulavaru is a platform architect at Ubiconn IoT Solutions, with over 9 years of experience in software development and 2 years in hardware & product development. For the last 5 years, he has been working extensively on JavaScript, both on the server side and the client side. And for the last couple of years in IoT, building a platform for rapidly developing IoT solutions, named The IoT Suitcase. Prior to that, Arvind worked on big data, cloud computing, and orchestration.
Read more about Arvind Ravulavaru

Right arrow

Setting Up a Smart Forum App

In the last chapter, we saw what Google Cloud Platform is and what services it offers. We delved deep into one of its verticals, named Google Cloud AI, and went through all the services in that vertical. In this chapter, we are going to get started with our learning on Google Cloud AI services.. We are going to set up the base project in this chapter and build on top of it from the next chapter onward.

The topics to be covered in this chapter are:

  • Design and architecture of SmartExchange
  • Technology overview
  • Project set up and exploration
  • Deploying the base application to Heroku

Technical requirements

SmartExchange architecture

The application we are going to build in this book is named SmartExchange. SmartExchange is a forum application, where registered users can create threads or topics of discussions and other users can like or reply to it. SmartExchange is not a full-fledged forum application but has all the key pieces needed to showcase the idea. As we keep moving toward the end of the book, we will be adding one Cloud AI service per chapter and will finally make the forum application a smart forum application. We are going to work with the following Cloud AI services:

  • Cloud vision
  • Video intelligence
  • Speech recognition
  • Cloud language processing
  • Cloud translation

SmartExchange demo

Before getting started, you can...

Setting up the project

Now that we are aware of the high-level architecture, let's get started by setting up the environment to develop the project. To develop and run the application locally, we need to have the following dependencies installed:

  1. Git
  2. Node.js
  3. MongoDB (optional)
  4. Angular CLI
  5. Yarn (optional)
  6. Heroku Toolbelt (optional)

Installing Git

To install Git, head over to https://git-scm.com/book/en/v2/Getting-Started-Installing-Git and follow the instructions on that page to install Git for your OS. Once you have successfully installed, you can run the following command to verify the installation:

$ git --version
git version 2.11.0 (Apple Git-81)
...

Setting up an authentication

When working with any Google Cloud AI service, we need to have either an API key or a
service account key set up. In this section, we are going to set up both, so you can use any
approach to explore. Before we set up the API key or a service account, we need to have a
Google Cloud project. If you already have a project, you can skip this section.

Creating the project

To create a new project, follow the below steps:

  1. Navigate to Google Platform Console: https://console.cloud.google.com/
  2. Create a new project using the project selector menu form the top navigation bar of the page
  3. I have created a new project for this book named as SmartExchange and have given a custom project ID as smart-exchange...

Setting up code

Now that we have all the tools needed to start developing the application, we will go through the list of technology pre-requisites:

Deploying to Heroku

This step is optional and you can do it if you are interested in deploying this application to Heroku. To continue with this section, you need to have set up a Heroku account and you need to have installed the Heroku Toolbelt.

  1. Once that is done, open a new Command Prompt or Terminal inside the smart-exchange-base folder and run the following command:
$ heroku login

This is your prompt for your Heroku credentials that you have signed up with.

  1. Once you are logged in, let's initialize a new git repository by using the following command:
$ git init
  1. Next, let's get our application ready for deployment. Run the following command:
$ npm run build
or
$ yarn build

This will run the required scripts to build the final dist folder, which will be deployed to Heroku. For everything to run smoothly on Heroku, we have added a file named Procfile that has the...

Summary

We started off this chapter by understanding the application architecture and the technology overview. Then, we installed the required dependencies and downloaded the base application. We then walked through the code and ran the application. Finally, we saw how to deploy the application to Heroku. In the next chapter, we will start interfacing with the first Google Cloud AI service Vision API and see how that can be used along with this application.

lock icon
The rest of the chapter is locked
You have been reading a chapter from
Google Cloud AI Services Quick Start Guide
Published in: May 2018Publisher: PacktISBN-13: 9781788626613
Register for a free Packt account to unlock a world of extra content!
A free Packt account unlocks extra newsletters, articles, discounted offers, and much more. Start advancing your knowledge today.
undefined
Unlock this book and the full library FREE for 7 days
Get unlimited access to 7000+ expert-authored eBooks and videos courses covering every tech area you can think of
Renews at $15.99/month. Cancel anytime

Author (1)

author image
Arvind Ravulavaru

Arvind Ravulavaru is a platform architect at Ubiconn IoT Solutions, with over 9 years of experience in software development and 2 years in hardware & product development. For the last 5 years, he has been working extensively on JavaScript, both on the server side and the client side. And for the last couple of years in IoT, building a platform for rapidly developing IoT solutions, named The IoT Suitcase. Prior to that, Arvind worked on big data, cloud computing, and orchestration.
Read more about Arvind Ravulavaru