RexSoft · Articles · Case Studies

Article

Smart Fit Coach: AI-Powered Personal Fitness Coaching with .NET 10, Blazor, and Azure OpenAI

Tools: .NET 10 · Blazor Server · Semantic Kernel Agents · Azure OpenAI & AI Search · Azure App Service

The SmartFit solution is a comprehensive AI-powered fitness platform developed using Microsoft .NET 10.

The solution consists of two integrated applications:

SmartFitCoach: A Blazor Server web application providing AI-powered personal coaching, personalised training plans, a 4-week schedule manager, and a real-time fitness chat assistant for end users (described in this article).

SmartFitDataManager: A companion Blazor Server web application for managing the exercise database and fitness article content pipeline — including web scraping, AI translation, GIF image editing, duplicate detection, and Azure AI Search indexing (a description is here).

SmartFitCoach is a full-stack AI fitness coaching web application built with Blazor Server on .NET 10. It combines a searchable exercise library, personalised AI-generated training plans, a 4-week rolling schedule, workout tracking, and a real-time conversational AI coach — all in one modern, responsive interface.

This project demonstrates RexSoft's expertise in AI-assisted application development using the latest Microsoft technologies, including Semantic Kernel, Azure OpenAI, Azure Blob Storage, and Azure AI Search.


Technology and Design

The application is built as an Interactive Blazor Server application on .NET 10, providing a real-time, reactive UI powered by SignalR — with no separate JavaScript framework required. The SignalR message size limit is intentionally uncapped to handle large AI responses and rich browser storage payloads without interruption.

Microsoft Semantic Kernel (v1.x) and Semantic Kernel Agents Core coordinate all AI interactions. Semantic Kernel manages structured system prompts enriched with real-time context — today's date, the user's profile, and the live schedule state — and coordinates a set of specialised Kernel Plugins for exercise search and schedule management.


Azure OpenAI — Dual-Model Strategy

Two Azure OpenAI deployments are registered simultaneously under different service IDs:

A GPT-4o mini deployment ("default") — used for the conversational chat assistant. Fast, cost-effective, and context-aware across the full chat history.

A GPT-4o deployment ("plan") — used exclusively for generating personalised training plans, where deeper reasoning and richer output quality justify the additional capacity.

A configuration toggle (UseGpt4oForPlans) allows the plan deployment to fall back to the mini model transparently — ideal for cost-controlled environments without any code changes.


Azure AI Search - Fitness Article RAG

ArticleSearchService integrates Azure AI Search (Azure.Search.Documents 11.x) to implement Retrieval-Augmented Generation (RAG) over a curated library of fitness articles indexed by SmartFitDataManager. When the user asks for training programmes, routines, or coaching advice, the AI retrieves relevant articles first and grounds its response in real, vetted fitness knowledge — rather than generating answers purely from model weights.


Azure Blob Storage - Exercise Database Bootstrap

On every startup, the application downloads a fresh exercises.sqlite file from Azure Blob Storage (Azure.Storage.Blobs 12.x) into a temporary directory. If the blob is unreachable - for example during local development - the app silently falls back to a local file path. The same codebase works identically in both environments without modification.


SQLite + Entity Framework Core

The exercise library is stored in a SQLite database and accessed via Entity Framework Core (v9) using a DbContextFactory for efficient scoped access across concurrent Blazor Server sessions. Each exercise record includes muscle group, equipment, difficulty, exercise type, and image metadata — all searchable through the ExerciseSearchPlugin.


Browser Persistence

User profiles (name, sex, age, weight, height, fitness level, and avatar photo) and full chat history are persisted in the browser's own local storage via Blazored.LocalStorage (v4.x) - no server-side user accounts or login required. Each user's data is private to their device and loaded automatically on every visit.

All AI-generated responses are rendered as formatted HTML using Markdig (v1.x), a fast CommonMark-compliant Markdown parser — turning coaching output into readable text with headers, bullet lists, and highlighted sections.


Application Pages

Today's Training

A focused daily view of the exercises scheduled for the current day. Each exercise is displayed as a card with a thumbnail image. Users mark exercises as completed directly from this page completed cards are highlighted in green with a checkmark overlay.

Monthly Schedule

A rolling 4-week calendar showing the current week fully expanded, with future weeks collapsible.Each day card shows scheduled exercises, completion counts, and the date. Users can tap any day to open a detailed day view, add or remove exercises, and review progress.

AI Coach Chat

A full conversational chat interface backed by Azure OpenAI. The assistant is context-aware — it knows today's date, the user's full profile, and the current schedule. Users can:

• Ask for exercise recommendations — results appear as interactive, numbered, clickable cards with exercise images inline

• Request personalised training plans — sourced from fitness articles via RAG, populated with real exercise cards

• Manage the schedule conversationally — "add push-ups to Wednesday next week"

• Request workout analysis — "review my session from last Monday"

• Ask for general fitness advice and coaching


Exercise cards in chat are numbered. Users can reference any result by number ("add exercise 3 to Friday") and the AI resolves the exercise name automatically from context.

[screenshot: chat page with exercise cards]

[screenshot: training plan response]


Profile & Settings

Users configure their personal profile — name, sex, age, weight (kg), height (cm), fitness level, and a custom avatar photo uploaded from their device. Profile data is passed to the AI coach

to personalise every coaching response and plan.


Training History

Full tracking of completed training sessions across all dates. A separate admin history view provides management-level oversight of all user activity.

Technical Overview


Framework NET 10 · Blazor Server (Interactive Server Components)

AI Orchestration Microsoft Semantic Kernel 1.x · Semantic Kernel Agents Core 1.x

LLM Azure OpenAI (GPT-4o & GPT-4o mini — dual deployment)

Search / RAG Azure AI Search (Azure.Search.Documents 11.x)

Blob Storage Azure Blob Storage (Azure.Storage.Blobs 12.x)

Database SQLite · Entity Framework Core 9.x

Client Storage Blazored.LocalStorage 4.x

Markdown Markdig 1.x

Real-Time ASP.NET Core SignalR (unbounded message size)

Deployment Azure App Service


SmartFitCoach demonstrates how Semantic Kernel, Azure OpenAI, and Blazor Server can combine to deliver a genuinely adaptive, AI-native user experience. The dual-model strategy, RAG-grounded

responses, and plugin-based agent architecture make this a practical example of production-ready AI integration with .NET 10.