Skip to content

kmorawala/For-A-Cause

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

95 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

For-A-Cause

About this project

This project is part of the AWS Hackathon submissions that enables users to discover and donate to charities that speaks to them (yes, literally!) via any Amazon smart device with voice enabled capabilities! We have developed a full eco-system to support charities to help raise funds:

  • A front-end for charities to register with us and provide us with their information to share with users
  • An AWS DynamoDB database that stores the information
  • An Alexa voice skill that allows the users to easily discover charities that are meaningful to them with an option to make a donations via Amazon Pay.

The following describes how the entire eco-system works:

Demo Video

Please find the demo video here

Inspiration

Our project’s inspiration came from when we were looking for a way to donate to a certain charity in a quick and easy manner via voice interactions. In this world of technology, we did not come across any skill that was comprehensive enough to support both users and charities while allowing donations to be made via voice commands. Once we discovered this gap, we quickly brainstormed some ideas and decided to create a blueprint for this project. We wanted to provide charities with an avenue of voice activated donations that would help charities of any size, location, technology, and type, and our eco-system does just that!

What it does and How we built it

Our design is broken into three tiers:

  • Charity Interactions: A front-end is dedicated for the charities to register with us and provide us with valuable information to share with users.
  • Storage: An AWS (DynamoDB) NoSQL database is utilized that stores the information provided by the charities and later retrieved by the Alexa skill.
  • User Interactions via Alexa voice skill: The user interacts with the app using an Amazon smart device via Alexa voice skill - For A Cause. Python is used for the back-end logic for the skill development. The back-end retrieves necessary information from the database, uses Amazon Pay for processing donation payments, and handles other requests as made by the users. Amazon Pay is integrated in the Alexa Skill to enable seamless payment processing between the user and us.

The system architechure and data flow are as follows:

We used the following technologies:

  • Alexa ASK (Alexa Skills Kit)
  • Python
  • AmazonPay
  • AWS DynamoDB
  • HTML
  • CSS
  • Jquery
  • Bootstrap
  • Flask
  • Route53
  • Application Load Balancer
  • AWS Certificate Manager
  • AWS CLI
  • noSQL Workbench
  • Slack
  • Google Meet
  • Github

How to use it

Please refer to the "How to test" section before testing it. Judges are given beta tester and developer level access to the Alexa skill. A user access is created for the judges for DynamoDB and Amazon Pay. The user ID and passwords are provided in the original hackathon submission.

For donors/users, the skill can be used by invoking the wake word "Alexa, open for a cause", the user can simply get started. The app provides necessary help instructions as the users interact. It handles various situations, such as exploring more charities, donating to a charity or providing more information about charity, processing payments using Amazon Pay, etc.

The charities can access the registration form www.for-a-cause.net. The charity form collects various information from the charity for the Alexa skill to use and their e-mail address to arrange for the funding to be distributed periodically.

Challenges we ran into

All of our team members do not have extensive experience in developing an Alexa skill and integrating it various AWS services, such as DynamoDB, AmazonPay, AWS certificate manager, etc. The challenge was to familiarize ourselves quickly with new concepts/technologies, research, build and test a fully functioning application. We found this challenge to be fun and rewarding and hoping that it would help charities to raise funding in future.

Accomplishments that we're proud of

We feel proud to be able to develop a multi-facet system that the charities can use to raise funding, while making it easier for the users to donate to their favorite charities! We also learned a ton (as listed below)!

What we learned

We learned an abundance of things from where we started. A few of the highlights are as follows:

  • Alexa Voice Skills
  • AWS DynamoDB and its integration to Alexa skills
  • AmazonPay and its integration to Alexa skills
  • Various front-end technologies
  • Research Skills
  • Collaboration
  • Time management
  • Communication/interpersonal skills

What's next for our project

We would like to add features such as monthly subscription, ability for charities to obtain user addresses to send appreciation gifts, and so forth. We think this app has a huge potential to help non-profits!

How to test it

  • Alexa Skill Since this app has not been published to public, but only published to the beta testers, there are two ways to test the app (besides having to set it up using the files provided in the repo using the instructions under how we set it up):

    • Using Console:
      • The hackathon judges have been provided the access to Alexa Developer Console.
      • Once logged into the account using the e-mail addresses provided on the Hackathon page, they should be able to see a skill called Cause on their console.
      • There will be a live skill and one under development. Since AmazonPay has been set up under the SandBox mode, click on the one that is labelled as under development.
      • Click on the test tab and start testing it away! The best way to test the app is by speaking to it rather than typing to avoid any non-word inputs (i.e. $1 instead of one dollar).
    • As a beta tester:
      • Using the e-mail addresses provided on the hackathon page, login to your accounts.
      • Go here
      • Enable the skill called Cause
      • Be sure to enable Amazon Pay permission in the skill
      • Use any associated device or Alexa App on the phone to start interracting with the app and test it away!
  • DynamoDB

    • DyanmoDB can be accessed on AWS Management Console using the account number, username and password provided in the Devpost submission.
    • Under search area, search for DyanmoDB
    • Click on Tables on the left and CharityInfo on the right
    • Click on Items to see the database entries.
    • Here is where you can see the charity information being stored.
  • Amazon Pay

    • Amazon Pay can be accessed on Seller Central using the username and password provided in the Devpost submission.
    • Select sandbox view upon login.
    • Click on Orders and Manage Transactions to see the transaction history.
    • Here is where you can see the donation payments being processed under a sandbox environment.
  • Flask App

    • The website is fully deployed here
    • All the testing can be performed on the live website.
    • All the relevant documentation is available in our repository

How we set up the Alexa Skill

We wanted to provide some simple set up instructions for anyone who wanted to follow along!

  • Alexa Skill Since this app has not been published into the market place, if you would like to use it on your Alexa devices, go to Alexa Developer Console and click on Create a Skill

Click on Custom

Choose Start from scratch.

Tabs

There are three tabs that we will work in this tutorial: Build, Code and Test. Feel free to work with more and use additional functionalities as you like.

Build Tab

Give an appropriate invocation word under Skill Invocation Name field for your app. This word will start the skill when uttered by the user.

Under Intents, use the files from Alexa Skill/Slots_Intents folder to name and import various Utterances.

Similarly, use Categories-values-slots.csv file to create custom slot values.

Finally, click on Save Model and then Build Model. This step needs to be performed every time a change on the Build tab is made.

Under "MakeDonationIntent," be sure to create a slot as follows:

Click on "Edit Dialogue" and set it up as follows:

Code Tab

Upload all of the remaining files to this tab, unless any of these files already exist and look identical. All the .txt files represent various categories of coding questions, one per line of the file. Further, the categories would match up to the slot values of Categories under the Build tab.

You will also need to establish a keys.py file that would include CarKeys class, under which "__role_creds" variable is set up to create an AWS IAM Policy to Grant AWS Lambda Access to an Amazon DynamoDB Table. See further details here

Click on Save first. Once successfully saved, click on Deploy. This step may require additional configuration on AWS lambda when doing it for the first time. Every time something under the Build tab changes, these steps have to be performed.

Test Tab

This is where you can type in or speak to test your app on the left side and you will see JSON response on the right side.

If you reached this point, you have successfully made a wonderful app on your Alexa device. Test it out now! Be sure that you are using the same amazon account for your device as well as for the developer console. If for some reason, the app does not work, be sure that "English-US" is selected as language under your Alexa App settings.

How we set up DynamoDB

  • DynamoDB For testing purposes, or to follow along with the creation process, these are the steps to set up DynamoDB like we did. (AWS Management Console -> DynamoDB) and click on Create table

Name the table "CharityInfo" and set the Primary Key to ID as a Number and then hit Create. DynamoDB doesn't need to know the other rows yet, unlike a regular RDS.

How we set up the Flask App

  • AWS Elastic Beanstalk Luckily, Elastic Beanstalk takes care of most of the heavy lifting, spinning up everything needed to deploy our Flask App.

You will need to make sure to install EB CLI first, which can be done with Homebrew on a Mac:

$ brew update

$ brew install awsebcli

Once the EB CLI is installed, you can take the files downloaded from github, and easily deploy them to Elastic Beanstalk (Make sure to download only the folder labelled "Flask App", as this was run independently in it's own environment for deployment, and not tested with the bundle of "For-A-Cause").

~/ForACauseFlaskApp$ eb init -p python-3.6 ForACauseFlaskApp --region us-east-1

~/ForACauseFlaskApp$ eb create flask-env

Then we will open the app:

~/ForACauseFlaskApp$ eb open

From here, once the form is submitted, it will append the needed columns to the existing DynamoDB table that we created earlier.

IAM Permissions

Lastly, we make sure each app has access to each other app.

The Alexa_Lambda and aws-elasticbeanstalk-ec2-role role will need DynamoDBFullAccess.

About

This project is part of the AWS Raise-Up Buildathon

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors