IBM/CognitiveConcierge

Name: CognitiveConcierge

Owner: International Business Machines

Description: A swift iOS app for recommending the best local restaurants with a swift with kitura backend API

Created: 2016-10-13 04:32:03.0

Updated: 2018-05-19 13:59:15.0

Pushed: 2018-05-17 19:01:06.0

Homepage: https://developer.ibm.com/code/patterns/build-a-cognitive-recommendation-app-with-swift

Size: 27777

Language: Swift

GitHub Committers

UserMost Recent Commit# Commits

Other Committers

UserEmailMost Recent Commit# Commits

README

Apache 2

CognitiveConcierge

Watson Conversation is now Watson Assistant. Although some images in this code pattern may show the service as Watson Conversation, the steps and processes will still work.

CognitiveConcierge is an end-to-end Swift application sample with an iOS front end and a Kitura web framework back end. This application also demonstrates how to pull in a number of different Watson services to your Swift client and server side apps via the Watson Developer Cloud's Swift SDK, including Watson Assistant, Text to Speech, Speech to Text, and the Natural Language Understanding service.

Included Components
Application Workflow Diagram

Application Workflow

  1. The user deploys the server application to IBM Cloud.

  2. The user interacts with the IOS application.

  3. When the user performs any action, IOS application the server application API which uses the Watson services and Google Places API to provide the user recommendations.

Prerequisite

If you haven't so yet, you also need to download and install the following:

Steps

Use the following steps to deploy the application

1. Deploy the Server Application

You can deploy the server application using any one of the following ways:

a) Using the Deploy to Bluemix button

Clicking on the button below creates a IBM Cloud DevOps Toolchain and deploys this application to the IBM Cloud. The manifest.yml file [included in the repo] is parsed to obtain the name of the application, configuration details, and the list of services that should be provisioned. For further details on the structure of the manifest.yml file, see the Cloud Foundry documentation.

Deploy to Bluemix

Once deployment to the IBM Cloud is completed, you can view the deployed application and services from your IBM Cloud account.

b) Using the Bluemix command line

You can also manually deploy the Server Application to the IBM Cloud. Though not as magical as using the Bluemix button above, manually deploying the app gives you some insights about what is happening behind the scenes. Remember that you'd need the Bluemix command line installed on your system to deploy the app to the IBM Cloud.

Execute the following command to clone the Git repository:

clone https://github.com/IBM/CognitiveConcierge.git

Go to the project's root folder on your system and execute the Cloud-Scripts/services/services.sh script to create the services CognitiveConcierge depends on. Please note that you should have logged on to the IBM Cloud before attempting to execute this script. For information on how to log in, see the IBM Cloud documentation.

Executing the Cloud-Scripts/services/services.sh script:

Cloud-Scripts/services/services.sh

Before deploying your application to the cloud, you will need to update it with the google API Key. In the main.swift folder, update the struct value with your google API Key.

After the services are created and you've updated this file, you can issue the bx app push YOUR_APP_NAME command from the project's root folder CognitiveConcierge to deploy the server application to IBM Cloud.

Once the application is running on the IBM Cloud, you can access your application's assigned URL (i.e. route). To find the route, you can log on to your IBM Cloud account, or you can inspect the output from the execution of the bluemix app push or bx app show <application name> commands. The string value shown next to the urls field contains the assigned route. Use that route as the URL to access the sample server using the browser of your choice.

 app show CognitiveConcierge
king 'cf app CognitiveConcierge'...

ing health and status for app CognitiveConcierge in org ishan.gulhane@ibm.com / space dev as ishan.gulhane@ibm.com...


ested state: started
ances: 1/1
e: 512M x 1 instances
: cognitiveconcierge-lazarlike-archaizer.mybluemix.net
 uploaded: Mon Jun 5 18:01:42 UTC 2017
k: cflinuxfs2
dpack: swift_buildpack

 state     since                    cpu    memory         disk           details
 running   2017-06-05 11:05:41 AM   0.3%   6.4M of 512M   269.8M of 1G
2. Update Assistant Service
3. Run the iOS Application
Install the necessary dependencies
Update configuration for iOS app
Running the application

Press the Play button in Xcode to build and run the project in the simulator or on your iPhone!

Running the Kitura-based server locally

Before building the CognitiveConcierge-Server application, first update the credentials in the config/nlu-creds file for local development.

You can then build the CognitiveConcierge-Server by going to the CognitiveConcierge-Server directory of the cloned repository and running swift build. To start the Kitura-based server for the CognitiveConcierge app on your local system, go to the CognitiveConcierge-Server directory of the cloned repository and run .build/debug/CognitiveConcierge. You should also update the bluemix.plist and CognitiveConcierge.plist file in the Xcode project in order to have the iOS app connect to this local server. See the Update configuration for iOS app section for details.

CognitiveConcierge App video

cognitive concierge video

Learn More About
Troubleshooting
License

Apache 2.0


This work is supported by the National Institutes of Health's National Center for Advancing Translational Sciences, Grant Number U24TR002306. This work is solely the responsibility of the creators and does not necessarily represent the official views of the National Institutes of Health.