AWS Builder Center
Weekend Challenge: Turn One Annoying Task Into an App: Fit Intelligence

Weekend Challenge: Turn One Annoying Task Into an App: Fit Intelligence

A serverless AI fitness coach that uses Amazon Bedrock models to analyze workout posture and return instant feedback.

Cloud Enthusiast
Vision and What the App Does Training alone often involves a lot of guesswork. One might be unsure whether the posture is right or the exercise is for the correct body target. Here is where FitIntelligence comes in. You take a picture of yourself exercising, upload it to the app, let the app know which gym strategy you are performing or intend to do, and the app generates suggestions. It acts just as a coach or fitness trainer would do by giving honest, and specific feedback. The choice of app was chosen by a community upvote on the previous weekend challenge which was, to build an app to solve the most annoying task. Binod Prasad Joshi’s FitIntelligence emerged on top and became our current weekend challenge, and the app to build for the week. Moreover, I made some modifications to transform it into a form checker to make it lightweight, with a focus on exercises' feedback, just as exercising in a poor form is risky and could sometimes make others avoid it altogether, it could also be very frustrating without a personal trainer. To add to it, the process of working out consistently is tedious, and it could be very hard to notice the irregularities in physique and details, such as whether the squat height is necessary or the push-ups are optimal.
How You Built It The build surrounds a single architectural belt: a call to a Bedrock model to interpret the image obtained from the browser rendered by Amplify, and a language model to interpret what the detected image implies. A model that can handle both the reading of the photo and the explaining in plain language was chosen. The frontend of the app has options for a user, particularly a fitness enthusiast, to pick from, ranging from squats to planks. The app entails a robust, serverless solution with a single-page frontend and a generative vision integration. Some of the challenges encountered were the Bedrock throttling requests, which were captured in the CloudWatch metrics. To overcome it, I waited for a token refill, the models had to be changed and then requested a quota increase. Another challenge was the roles and permissions, which were easily overcome by carefully going through the JSON permissions and lambda auto-generated policies to cross-check and add the necessary adjustments.
AWS Services Used AWS Amplify housed the index.html frontend interface of the entire web application. It held the static files and delivered fast hosting via GitHub. AWS Lambda contained the function that runs the app, and it called on the Amazon Bedrock model to process the image and exercise input received from the frontend. It provided a serverless compute backend that processed the function containing the app, which was built in Node.js. Amazon Bedrock used its multimodal capability to access the function in AWS Lambda and returned a structured JSON output with the exercise comments. It acted as the main engine to evaluate the mechanics of the body and postures in a single call.
Architecture Overview The architecture relies entirely on AWS free-tier services.
A diagram outlining the architecture of FitIntelligence

Screenshots
Two permissions configured at the Lambda function

Amplify housing the app

App in Amplify

Uploaded photo in app

Needs adjust

What You Learned Different models have various capabilities. I experimented with text only, text and image only, and others to see their functionalities at play. I had learnt the AWS Lambda function URL in the building of this app for the challenge.
Link to App or Public GitHub Repository The source code can be viewed here  https://github.com/KathleenCode/fitintelligence 
Any opinions in this article are those of the individual author and may not reflect the opinions of AWS.
Enjoyed reading this content? Let the author know!

Your likes, comments, shares, and saves help creators reach more builders.

Loading recommendations

Loading article