This is a story of four friends Bob, Alice, Carol and Dan. Last month they went to Las Vegas and had a great time. But when they came back from trip, they had a huge fight over splitting bills. They realized that this was not the first time. Every time they went out together for a trip or a movie, they faced the same problem - manage and split shared expenses. They tried some of the web based and mobile applications. However, they are looking for a simpler way to chat with friends and split expenses in one place.

How can they save their friendship and share expenses at the same time ?

* ---------- Drum Rolls -----------*

Introducing SplitSmartBot - Your chatbot assistance on Facebook messenger. Chat, Split expenses and Enjoy !

What it does

SplitSmartBot is a conversational chatbot based on SplitWise application. Splitwise is a free tool for friends and roommates to track bills and other shared expenses, so that everyone gets paid back. Bot is deployed on facebook messenger so that you chat with friends and split expenses in one place.

With SplitSmartBot, Alice can now do following things.

  1. Invite a Friend to her SplitWise account.

    Alice: I want to invite Bob

    Alice: Can you show all my friends

  2. Create a group and add friends

    Alice: I want to create group Vegas

    Alice: Add Bob to group Vegas

    Alice: Show friends in group Vegas

  3. Add a new bill to the group

    Alice: I paid 100 for drinks

    Alice: Add bill to group Vegas

  4. Get balance report

    Alice: show balance with friend Bob

    Alice: Can you show balance for group Vegas

How we built it

SplitSmartBot is built with AWS Services and deployed on Facebook messenger

1. Architecture

SplitSmartBot is built using following

a. AWS Services

  - Lex
  - Lambda
  - Dynamodb
  - API Gateway
  - Cloud Watch monitoring and logs
  - S3 for hosting lambda code.
  - IAM

b. SplitWise API : c. Programming Language: Python 2.7

d. Tools/Frameworks: Serverless Framework

e. Architecture Diagram:

splitbot architecture

2. Testing instructions

Note: Currently SplitSmartBot is not publicly available. As per Hackathon guidelines, we have given tester role to Facebook ID: stef.devpost.1

You also need a SplitWise account. You can create a new SplitWise account or use following test account.

SplitWise test account

    - username :
    - password : awslex2017

IMPORTANT: If you are using the bot for the first time, You need to authorize the bot to access your splitwise account.

3. Access SplitSmartBot

Challenges we ran into

  1. As bot is based on SplitWise application, a user needs to authorize the bot to access his SplitWise account. Challenge was to integrate SplitWise OAuth with the bot. ( Preferably using Serverless architecture)

  2. For making calls to SplitWise API, we used open source Python SDK for SplitWise. However, SDK didn't support all SplitWise APIs which we wanted to support in bot.

  3. SplitWise application supports multiple workflows ( Invite friend, add friend, add group, add bills etc. ). Therefore, the challenge was to design bot in such a way that user interactions are simplified.

Accomplishments that we're proud of

1. Serverless OAuth integration: We successfully integrated SplitWise OAuth with our bot using Serverless architecture ( Using AWS API gateway, Lambda and Dynamodb ).

2. Open source contribution : We added a new functionality in Python SDK for SplitWise and contributed back to community.

Commit to SplitWise SDK

What we learned

  1. Building conversational bot with AWS Lex and Lambda
  2. Using AWS API Gateway to build scalable REST API
  3. NoSQL concepts and Dynamodb for user session management
  4. Integrating OAuth with a chat bot
  5. Debugging and monitoring Serverless applications

What's next for SplitSmartBot

  1. Cover remaining uses cases supported by SplitWise. ( e.g Settle bills, Pay bills etc)
  2. Integrate SplitSmartBot with AWS Mobile Hub
  3. Use Amazon Poly for speech support
  4. Deploy bot on other platforms such as Slack.

Built With

Share this project: