Giter Club home page Giter Club logo

lyff's Introduction

Lyff

Inspiration

Sometimes, you find yourself without Internet or data and really need to call a Lyft. Lyff lets you call a Lyft with just a quick phone call!

What It Does

Users can call 1-888-970-LYFF, where an automated chatbot will guide them through the process of ordering a Lyft to their final destination. Users can simply look at the street name and number of the closest building to acquire their current location.

How It's Built

We used the Nexmo API from Vonage to handle the voice aspect, Amazon Lex to create a chatbot and parse the speech input, Amazon Lambda to implement the internal application logic, the Lyft API for obvious reasons, and Google Maps API to sanitize the locations.

Built With

  • Python
  • Google Maps Geocoder API
  • Nexmo API
  • Amazon Lex
  • Amazon Lambda
  • Lyft API

Team

This app was built at PennApps Fall 2017 by Akash Levy, Zachary Liu, Selina Wang, and David Fan. Awarded Best Use of Vonage/Nexmo API! See our DevPost page: https://devpost.com/software/lyff

Lyff Logo

Installation Instructions

  1. Clone this repository

  2. Set up an S3 bucket:

    • Go to AWS S3 Console Home
    • Create a bucket for storing user Lyft access tokens (you can use the default settings)
    • Create AWS credentials for accessing this bucket and copy them into lyff_lambda/rootkey.csv in the following format:
      AWSAccessKeyId=<ACCESS_KEY>
      AWSSecretKey=<SECRET_KEY>
      
  3. Set up your Lyft developer app:

    • Create your Lyft developer account and login
    • Create a new app
    • Substitute your Client ID and Client Secret into lyff_lambda/lyff_creds.py
  4. Set up your Amazon Lambda function for the chatbot logic:

    • Go to AWS Lambda Home
    • Click on "Create Function"
    • Click "Author from Scratch"
    • No triggers necessary
    • Pick a name, runtime environment should be Python 2.7, use lambda_basic_execution role
    • Confirm and create function
    • Zip all the files in lyff_lambda/ and upload this ZIP file as the Lambda function
    • Click "Save"
  5. Set up your Amazon Lex bot:

    • Go to AWS Lex Home
    • Create a new bot
    • Add a slot called "RideTypes" with the following settings:

    Ride Types

    • Add a slot called "Status" with the following settings:

    Settings

    • Add a slot called "YesNo" with the following settings:

    YesNo

    • Make your setup look like this:

    Lyff Logo

    • Click "Save Intent" then "Build"
    • Click "Publish" and create a new alias (we called ours "Prod")
    • Create AWS credentials for accessing this Lex bot and copy them into nexmo/rootkey.csv in the following format:
      AWSAccessKeyId=<ACCESS_KEY>
      AWSSecretKey=<SECRET_KEY>
      
  6. Set up your Lex connector:

    • Run the server provided by Zach's lex-connector at a URL that is accessible to Nexmo. We used Amazon EC2 and configured the domain to be publicly accessible. Alternatively, once the fixes to lex-connector in Zach's fork are pulled into the main lex-connector branch, you can follow these instructions to use Nexmo's default connector to Amazon Lex.
    • Modify the uri attribute in nexmo/ncco.json to look like this:
      wss://LEX_CONNECTOR_ENDPOINT/bot/BOTNAME/alias/PUBLISH_ALIAS/user/AWSServiceRoleForLexBots/content
      
    • Leave the AWS_KEY_HERE and AWS_SECRET_HERE in this file untouched
  7. Set up your Amazon Lambda function for the dynamic NCCO fetcher:

    • Go to AWS Lambda Home
    • Click on "Create Function"
    • Click "Author from Scratch"
    • Add an "API Gateway" trigger with default settings
    • Setup your IAM role so your endpoint is accessible to Nexmo
    • Pick a name, runtime environment should be Python 2.7, use lambda_basic_execution role
    • Confirm and create function
    • Zip all the files in lyff_lambda/ and upload this ZIP file as the Lambda function
    • Click "Save"
    • Make the function publicly access
  8. Set up Nexmo:

    • Sign up for a Nexmo account and add enough money to buy a number
    • Buy a number
    • Install the Nexmo CLI: npm install -g nexmo-cli
    • Run nexmo app:create "Lyff" <NCCO_FETCHER_LAMBDA_FUNCTION_PUBLIC_URL> http://example.com and you should get your app ID
    • Link your app to your phone number with nexmo link:app <PHONE_NUMBER_HERE> <APP_ID_HERE>
  9. You're done! Try calling your phone number to make sure everything works!

Future Work

  • Support for booking through SMS
  • Support for stateful calls
  • Support for getting ride status
  • Support for connecting to Lyft driver using Nexmo proxy

lyff's People

Watchers

 avatar

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.