Giter VIP home page Giter VIP logo

b1-smile's Introduction

Deprecation Notice

This public repository is read-only and no longer maintained.


License: Apache2 REUSE status

Smile Survey - Face recognition and Qualtrics APIs

Read full blog post here

Description

This application feeds a Qualtrics survey with the user's rating given a selfie analysed by the Amazon Rekognition API. It also merges the selfie with stickers (other smaller pictures) in case user wants to save it and share to social network.

Requirements

  • A free trial account on SAP Business Technology Platform with Cloud Foundry Trial initialized;
  • The Cloud Foundry Command Line Interface (CLI) on your machine;
  • A Qualtrics Survey with API access

Notes

Deployment

Clone this repository

$ git clone https://github.com/mendesthi/smilesurvey.git

Give a name to your app on the manifest.yml

From the root directory, using the Cloud Foundry CLI push your app to the SAP CP Cloud Foundry

$ cf push

It requires the Qualtrics Tenant, Qualtrics API Survey ID and API Token so you can get programmatic access to the required resources.

The Qualtrics tenant is part of the URL of the tenant your Qualtrics Survey. Suppose the URL for your tenant is https://sapinsights.eu.qualtrics.com/ then you need to set the value "sapinsights.eu" to your QUALTRICS_TENANT variable;

See here how to retrieve Qualtrics API Token and Survey ID, and set them to the environment variables QUALTRICS_TOKEN and QUALTRICS_SURVEYID;

It also requires to configure credentials for AWS SDK. Check the instructions on this post to configure them properly.

Then you finally configure your app as an app client into your user pool. Follow the instructions on this Amazon Cognito Developer Guide to do so.

The AWS s3 is used to temporarly store the picture so the user can download and save it. Create a new bucket on aws s3 and note the bucket name.

Now you have all the AWS and Qualtrics information required, set them to the Cloud Foundry environments:

$ cf set-env <appname> AWS_ACCESS_KEY <your_aws_access_key>
$ cf set-env <appname> AWS_CLIENTID <your_aws_client_id>
$ cf set-env <appname> AWS_SECRET_KEY <your_aws_secret_key>

$ cf set-env <appname> AWS_POOLID <your_aws_pool_id>
$ cf set-env <appname> AWS_USERPOOLID <your_aws_user_pool_id>

$ cf set-env <appname> AWS_USERNAME <your_aws_user_name>
$ cf set-env <appname> AWS_PASSWORD <your_aws_password>
$ cf set-env <appname> AWS_REGION <your_aws_region>

$ cf set-env <appname> AWS_BUCKET <your_aws_S3_bucket_name>

$ cf set-env <appname> QUALTRICS_SURVEYID <your_aws_access_key>
$ cf set-env <appname> QUALTRICS_TENANT <your_aws_access_key>
$ cf set-env <appname> QUALTRICS_TOKEN <your_aws_access_key>

Restart your application (so it can read the new environment variables):

$ cf restart <appname>

Now access the app from the URL route shown in the terminal.

To check that your environment variables have been set correctly, run the following command:

$ cf env <appname>

You should get a list like this:

User-Provided:
AWS_ACCESS_KEY: ABCDE1FG2HIJKLMNOP3QR
AWS_BUCKET: smilebucket
AWS_CLIENTID: 1a2bb3cdefg45h67t2z1tv5ou4
AWS_PASSWORD: MyPassword
AWS_POOLID: eu-west-1:1v2v3h44-5678-9h10-1wd2-1234567aa123
AWS_REGION: eu-west-1
AWS_SECRET_KEY: tABCcDEF1abcdEfGhIJK/12a$bc3ddEFgHiJKL/m
AWS_USERNAME: thecastro
AWS_USERPOOLID: eu-west-1_ABCdE1G2I
QUALTRICS_SURVEYID: SV_cPdRNZGwsIudugh
QUALTRICS_TENANT: sapinsights.eu
QUALTRICS_TOKEN: H0Ce5sn8ejjgFZL7yprCDvyfF7l2puOrA6Lm0D9Y

Support and Contributions

This repository is provided "as-is". No warranty or support is available. Feel free to open issues.

License

Copyright (c) 2020 SAP SE or an SAP affiliate company. All rights reserved. This project is licensed under the Apache Software License, version 2.0 except as noted otherwise in the LICENSE file.

b1-smile's People

Contributors

dellagustin-sap avatar mendesthi avatar trinidadmg avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Forkers

isabella232

b1-smile's Issues

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.