DEV Community

Muhammed Ashraf
Muhammed Ashraf

Posted on

How I Built AURA: A Serverless, AI-Powered Fitness Engine on AWS Bedrock: Part 1

Introduction

Most of the current fitness apps are using static template to generate a workout and diet plans for you.

they are just getting some basic inputs (age, weight, hight and maybe body fats) while ignoring other parameters that could enhance the generated plans such as (HRV, Sleep, Strain & Your body readiness for training)

For example:
It tells you to eat 2,500 calories every single day, and completely ignore the fact that you slept 4 hours last night, your HRV tanked by 35%, and your central nervous system is fried.

The idea came into my mind to build a fitness app that could generate exercise & diet plans then these plans should be tailored for you based on your data.

The idea became bigger so I tought it will be better that AURA athlete coach ( my app ) to become hub for everything

You could do the following:

  • Generate exercise & diet plans based on you need ( Weight Loss, Muscle gain & Maintenance ) including number of days and meals per day.
  • Select your pathway (Hypertrophy, Conditioning, Powerbuilding and Longevity)
  • Lifter engine that you could track your exercises and log them for better visibility about each muscle group and how it was trained during the week
  • Macro Feature that could help you to log your daily food or sync through MyFitnessPal for better tracking of your targets.
  • Progress that you could use to log your actual photo contains your progress to have a better visibilty
  • Pulse which contains all the data about you (Recovery, Strain, Sleep, Calories, Stress, Spo2, Calories, Training Load, Muscle Volume Group, Fitness Age & pace of aging, Acitvity & burn)
  • Access to AI Chat to follow-ups and answering user's questions

High-Level Architecture & Sequence Flow Overview

The core guiding principle behind AURA's backend is Zero Client-Side Credentials. The mobile app holds no database keys, AWS credentials, or LLM API tokens. Everything flows through an authenticated, rate-limited serverless proxy.

High Level Diagram:

The Tech Stack at a Glance:
Frontend Mobile: React, TypeScript, Capacitor, Tailwind CSS (Custom Dark Glassmorphic Design System).

Compute: AWS Lambda running Node.js in a Private VPC.

Database: Amazon RDS PostgreSQL managed via Amazon RDS Proxy for connection pooling.

AI Core: AWS Bedrock running Amazon Nova Pro (for complex workout/diet plan generation) and Amazon Nova Lite (for real-time coaching chat) and for arabic we use Qwen3.5 32B with Bedrock Gaurdrails & Prompt Caching features enabled.

Media & Assets: Amazon S3 for exercise video & user saved progress photos with KMS-encrypted presigned URLs for progress photos.

Deep Dive 1: Serverless AI Orchestration with AWS Bedrock

Instead of relying on third-party LLM APIs with unpredictable latency and client-side key exposure, I routed all AI operations through AWS Bedrock.

I used 3 Models based on user needs,

  • Nova Lite for real time messages with the AI Coach
  • Nova Pro for generating exercises & diet plans
  • Qwen 3.5 32B for native Egyptian Arabic Language.
  1. Enforcing Strict JSON Output Contracts
    LLMs are notoriously bad at returning consistent JSON when given loose instructions. To prevent app crashes, the Lambda function supplies a strict JSON schema contract and runs a deterministic post-validation pass.

  2. Dialect & Medical Guardrails
    Because AURA supports regional coaching dialects (such as urban Egyptian Arabic) and operates in the health domain, system prompts require explicit guardrails:

  • Dialect Negative Constraints: To prevent the model from mixing dialects ( the system prompt explicitly bans out-of-region keywords.

  • Medical Scope Boundaries: The AI is strictly programmed as an athletic performance coach, not a medical doctor. If a user mentions red-flag symptoms like acute chest pain or severe joint injuries, the model immediately halts fitness advice and directs them to seek medical attention.

Deep Dive 2: Biometric Telemetry & Autoregulation
An AI coach is only as smart as the data you feed it. AURA integrates with Android Health Connect and Apple HealthKit to read read-only telemetry:

  • Heart Rate Variability (HRV)

  • Resting Heart Rate (RHR)

  • Sleep Duration & Sleep Architecture (Deep, REM, Light)

  • Active Strain & Step Counts

UI/UX & Gamification: Making Science Feel Cinematic

A technical backend means nothing if the user experience feels like a boring medical dashboard. We built AURA's frontend around dark glassmorphism, high-contrast neon accents, and interactive gamification in addition to this we are allowing user to select the theme that he likes

Glowing Progress Rings: Vector SVG rings using custom HSL glow filters that adapt dynamically to health scores (Green for Primed, Yellow for Caution, Red for Low Recovery).

Interactive 3D Reward Vaults: Replacing flat checkboxes with claimable Daily Reward Vaults, complete with success haptics and confetti overlays.

Tiered Quick Challenges: Level 1 to Level 4 athletic challenges granting scaled XP (+100 to +500 XP) with repeatable prestige badge multipliers (x1, x2, x3) to encourage user to go further and achieve his daily goals.

Theme Customization: Live theme presets (Hyper Emerald, Solar Amber, Lava Crimson, Amethyst) that persist across all top headers, navigation bars, and glass cards.

Will continue the rest of setup and solution on part 2 meanwhile you could visit the website here

and I will drop some of screenshots from the app

Exercise with description and gif:

Heartrate graph

Recovery & Strain Readiness:

Top comments (0)