Skip to content

jtaylortech/venv-fitness-bot

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

8 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Personal Fitness Bot

Quick Summary

  • I am building a fitness bot using python, aws, and twilio SMS that I will be able to text on any given day and will receive a response with a random workout to complete

  • This is a serverless environment so AWS will be in use

Steps To Run

Early Steps

Python

  • Initialize the Virtual Environment

    • python3 -m venv environment-name
  • Implement the Required Packages

    • see requirements.txt file
  • Activate the Environment

    • source environment-name/bin/activate
  • Install the Dependencies

    • pip3 install -r requirements.txt
  • Create __send_sms.py__ file for Twilio implementation

    • this file will be in accordance with the twilio walk though mentioned above
    • do not forget to run pip install twilio at the end
  • Write the AWS Lambda Function

    • refer to __lambda_handler.py__ file
    • this will handle the messages
    • Flask is used to maintain the context of the conversation throughout the interaction
      • messages received -> Flask identifies the context -> proper response is kicked back
  • Create __exercise_inventory.json__ as your nonrelational database

    • this is used to hold your variety of categorical workouts to construct a full workout upon request
    • this is needed to carry out the build_workout function in the __lambda.handler.py__ file
    • the history of the workouts will be stored in AWS's DynamoDB
  • Set up the AWS Environment

    • setup the AWS serverless infrastructure
      • a DynamoDB database is required to carry out the write_workout_to_dynamo function
        • name the table whatever you desire
        • the primary key will be a partition key named "workout_user"
        • the sort key will be named "exercise_time"
    • since the code with be deployed to AWS as a Lambda function, Zappa is used to assist in this
      • Zappa will setup the leftover serverless infrastructure
        • includes: IAM roles, Lambda function, & API Gateway
      • refer to __twilio-fit-iam-policy.json__ file
      • create __zappa_settings.json__
        • this is the setup for the deployment configuration for Zappa
        • update zappa as necessary
        • update django as necessary
  • Deploy to the Cloud

    • from the CLI
      • enter zappa deploy fitness-bot
        • "fitness-bot" is used here because that's the name given to the deployment in zappa_settings.json
          • if changes are made, run zappa update fitness-bot

About

building an interactive sms bot that responds with a specialized workout upon request

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published