Giter Club home page Giter Club logo

serverless-ai-fitness's Introduction

Serverless AI Fitness

Would you like to say your workouts are created by AI? Cool, me too! And now we can!

Using the OpenAI API, this solution will query ChatGPT to build workouts for you that use equipment you have at your disposal.

For more details, please refer to this blog post.

How It Works

This solution is powered by two Step Functions:

  1. Generate Weekly Schedule - Randomizes which muscle groups, workout types, and equipment will be on each day and gets the workout from ChatGPT
  2. Daily Workout Notifier - Sends an email in the evening with the workout details for the next day

Architecture of the two Step Function workflows

Deployment

This is a complete solution with both a user interface and back-end service. To deploy the entire application, you can hook up the repository to an Amplify build. However if you'd rather only deploy the service, you can do so with the following commands:

cd back-end
sam build
sam deploy --guided

Deployment Variables

To successfully deploy the solution, you must provide the following deployment variables

  • TableName - Name of the table in DynamoDB, defaults to ai-fitness
  • OpenAIApiKey - API Key used to interact with ChatGPT. More on this here
  • MomentoAuthToken - Auth token used to cache ChatGPT responses. Generate your token
  • ContactEmail - The email address you wish to send workouts to

NOTE - This solution relies on the email configuration from this repo to send emails. The stack from that repo must be deployed for emails to be sent. An alternative would be to copy the SendEmailFunction from that repo into this one.

Configuring

You can configure several aspects of this application.

Cost

For the most part, this solution is free. It falls under the free tier for the AWS infrastructure, Momento cache, and SendGrid email allowance. However, this will cost a few cents per month in OpenAI.

serverless-ai-fitness's People

Contributors

allenheltondev 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.