NutriGym
Next-Generation Fitness Management Platform
Enterprise-grade fitness management ecosystem powered by cutting-edge AI. A complete solution for gyms, trainers, and fitness enthusiasts featuring intelligent workout planning, personalized nutrition guidance, and real-time progress analytics.

Core Features
Enterprise-grade capabilities for modern fitness management
AI-Powered Workout Planning
Advanced LangChain integration generates personalized workout routines based on user goals, experience level, available equipment, and body metrics.
Smart Nutrition System
Comprehensive food database with macro tracking, meal planning, and AI-driven dietary recommendations tailored to individual metabolic needs.
Enterprise Security
JWT-based authentication, bcrypt password hashing, role-based access control, and secure API endpoints ensure data protection.
Multi-Role Management
Sophisticated role system supporting Admins, Trainers, and Users with granular permissions and customized dashboards.
Real-Time Analytics
Socket.io-powered live updates, progress tracking, body measurement history, and comprehensive performance metrics.
QR Check-In System
Contactless gym entry with QR code scanning, attendance tracking, and automated workout session logging.
Project Overview
NutriGym represents the future of fitness management - a sophisticated full-stack mobile and web platform that seamlessly bridges the gap between traditional gym operations and modern AI-powered personal training. Built with React Native for cross-platform mobile excellence and React for web accessibility, the application leverages a robust Node.js/Express backend architecture with MongoDB for scalable data management, hosted on Azure App Service with Azure NAT Gateway for secure outbound connectivity. Images and media are efficiently managed using Azure Blob Storage. The platform integrates custom LangChain agents to deliver personalized workout generation, intelligent nutrition planning, and real-time coaching. Features include QR-based contactless gym check-ins, comprehensive body composition tracking, role-based access control for administrators and trainers, and a rich exercise library with multimedia instructions. Every aspect is designed for performance, security, and user experience.
Complete Feature List
- ✓AI-Powered Personalized Workout Plan Generation
- ✓Intelligent Nutrition & Meal Planning System
- ✓QR Code Contactless Gym Check-in
- ✓Comprehensive Body Measurement Tracking
- ✓Real-time Progress Analytics & Performance Charts
- ✓Role-Based Access Control (Admin/Trainer/User)
- ✓Trainer Assignment & Client Management
- ✓Extensive Food Database with Macro Nutrients
- ✓Rich Exercise Library with Video Instructions
- ✓Chat-based AI Fitness Coach & Virtual PT
- ✓Image Upload for Progress Photos & Verification
- ✓JWT Authentication & Secure API
- ✓Recipe Management System
- ✓Subscription & Membership Management
- ✓Body Part Targeting System
- ✓Advanced Workout & Food Scheduling
- ✓HTTP Request Logging & Monitoring
- ✓Rate Limiting & Security Protection
API Routes Architecture
RESTful API design with 17 main route groups handling comprehensive fitness management functionality. The system implements JWT authentication middleware, rate limiting for API protection, request blacklisting for security, and comprehensive HTTP logging for monitoring and debugging.
/api/auth
Authentication & Authorization
Public authentication endpoints handling user registration, login, and token management. Implements JWT-based authentication with bcrypt password hashing for secure credential storage. Supports role-based user creation (Admin, Trainer, User) and includes token refresh mechanisms for maintaining secure sessions without requiring frequent re-authentication.
/api/user
User Management
Comprehensive user profile management system with full CRUD operations. Allows users to view and update their personal information, manage preferences, and control account settings. Administrators have elevated access to manage all user accounts, assign roles, and oversee user activities across the platform.
/api/membership
Membership Management
Handles gym membership types, pricing plans, and member enrollment. Supports multiple membership tiers with different access levels and benefits. Administrators can create, update, and manage various membership packages, track active memberships, and handle membership renewals and cancellations.
/api/subscription
Subscription System
Manages user subscriptions to membership plans with automated billing cycles and payment tracking. Handles subscription activation, renewal reminders, payment processing integration, and subscription status management. Supports different subscription periods (monthly, quarterly, annual) with prorated adjustments.
/api/trainer
Trainer Management
Dedicated system for managing trainer profiles, certifications, and specializations. Enables trainers to view their assigned clients, manage training sessions, and track client progress. Administrators can assign trainers to members, manage trainer schedules, and oversee trainer-client relationships for optimal service delivery.
/api/measurement
Body Measurements Tracking
Comprehensive body composition tracking system recording weight, body fat percentage, muscle mass, BMI, and custom measurements. Maintains historical data with timestamps for progress visualization. Supports photo uploads for visual progress tracking and generates statistical analytics and trend reports.
/api/workout
Workout Exercise Library
Extensive database of exercises with detailed information including target muscle groups, difficulty levels, equipment requirements, and step-by-step instructions. Supports multimedia content (images, videos) for proper form demonstration. Trainers and admins can add new exercises and update existing ones with modifications and variations.
/api/body-part
Body Part Targeting System
Categorization system for muscle groups and body parts used in exercise selection and workout planning. Enables precise targeting of specific muscle groups for balanced program design. Supports exercise filtering by body part and helps users understand which muscles are engaged during workouts.
/api/food
Food Database
Extensive nutritional database containing detailed macronutrient and micronutrient information for thousands of food items. Includes calories, protein, carbohydrates, fats, fiber, vitamins, and minerals. Supports search functionality, portion size calculations, and allows administrators to expand the database with new food items and custom entries.
/api/recipe
Recipe Management
Collection of healthy recipes with complete nutritional breakdowns and cooking instructions. Users can browse recipes by meal type, dietary preferences, and nutritional goals. Includes ingredient lists with quantities, preparation steps, cooking times, and calculated total macros. Users can save favorite recipes and create custom recipe collections.
/api/workout-plans
Workout Plan Creation & Management
Core workout planning functionality with AI integration powered by LangChain agents. Users can generate personalized workout plans through intelligent analysis of their goals, fitness level, available equipment, and time constraints. Trainers can create custom plans manually or modify AI-generated ones. Supports plan versioning, activation/deactivation, progress tracking, and workout history logging.
/api/food-plans
Nutrition & Meal Planning
Advanced nutrition management system for creating personalized meal plans with daily calorie targets and macronutrient distributions. Users can generate AI-powered meal plans based on their body composition, activity level, and dietary goals. Includes meal timing optimization, food substitution suggestions, and daily nutrition tracking with progress reports.
/api/ai-chat
AI Chat Sessions
Interactive AI-powered chat system for real-time fitness and nutrition guidance. Maintains conversation history across sessions for contextual responses. Users can ask questions about exercises, nutrition, form corrections, and receive personalized recommendations. The AI assistant learns from user preferences and adapts responses based on individual goals and progress.
/api/agent
AI Agent System
Advanced AI agent orchestration handling complex multi-step fitness and nutrition tasks. Coordinates between different AI services to provide comprehensive analysis and recommendations. Manages workout plan generation, meal plan creation, progress analysis, and automated coaching suggestions based on user data and behavioral patterns.
/api/image
Image Upload & Management
Handles image uploads for profile pictures, progress photos, exercise demonstrations, and recipe images. Implements Multer for efficient file handling with size validation, format checking, and secure storage. Supports image compression, thumbnail generation, and cloud storage integration for scalability.
/api/schedule
Workout Schedule Management
Advanced scheduling system for planning and organizing workout sessions. Users can schedule workouts on specific dates and times, set recurring patterns, and receive reminders. Integrates with workout plans to automatically populate schedules. Tracks completed sessions, missed workouts, and maintains a comprehensive workout calendar with progress indicators.
/api/food-schedule
Food Plan Schedule Management
Meal timing and planning scheduler that helps users organize their daily nutrition. Schedule meals and snacks throughout the day with portion sizes and timing. Supports meal prep planning, grocery list generation based on scheduled meals, and sends notifications for meal times. Tracks adherence to scheduled meal plans and provides nutrition consistency reports.
Technology Stack
Backend Architecture
- •RESTful API Design with Express.js
- •MongoDB with Mongoose ODM
- •JWT Token-based Authentication
- •Bcrypt Password Encryption
- •Multer for File Upload Management
- •LangChain Agents Integration
- •Winston Logger for System Monitoring
- •Rate Limiter Middleware
- •Blacklist Middleware for Security
- •Global Error Handling
Frontend Excellence
- •React Native for iOS/Android
- •React for Web Platform
- •Context API for State Management
- •Axios for HTTP Requests
- •Custom Hooks Architecture
- •Responsive Design System
- •Framer Motion Animations
- •Optimized Image Loading
- •Performance Monitoring
Database Schema
- •Users Collection (Multi-role Support)
- •Workout Plans & Schedules
- •Food Plans & Schedules
- •Exercises Library
- •Foods & Recipes Database
- •Body Measurements History
- •Memberships & Subscriptions
- •Trainer-Client Relationships
- •AI Chat Sessions
- •Body Parts Targeting
Cloud Infrastructure (Azure)
- •Azure App Service for Backend Hosting
- •Azure Blob Storage for Media Assets
- •Azure Container Registry (ACR)
- •Azure NAT Gateway for Networking
- •CI/CD with Azure DevOps
- •Scalable Cloud Environment
Mobile Experience
Designed for seamless performance on all devices
AI Personal Trainer Chat & Workout Plans
Engage with our AI assistant to analyze your personal measurements and preferences. It creates and saves a fully personalized workout program directly to the database, ensuring a plan that evolves with you.

AI Dietician Chat & Meal Plans
Chat with our expert AI dietician to receive a custom meal plan. Tailored to your body measurements and specific goals, it calculates optimal calorie targets and creates a diet that fits your lifestyle.

Interactive Body Part Targeting
Our interactive skeletal model allows you to tap on specific muscle groups to discover relevant exercises. Access detailed guides and video demonstrations to ensure perfect form.

Extensive Food Database & Recipes
Explore thousands of foods with detailed nutritional information. Track your macros easily and get insights into your dietary habits. Access detailed recipe instructions and video guides for healthy meals.

Advanced Progress Tracking & Analytics
Visualize your fitness journey with detailed analytics based on your body measurements. Track progress with dynamic graphs, compare measurements over time, and gain insights into your physical development.
Smart Scheduling & Planning
Stay organized with comprehensive scheduling for workouts and meals. Plan your week, log your progress, and never miss a session with intelligent reminders.

Web Admin Panel
The browser-based control center gyms use to manage members, staff and content

Dashboard
A single glance at the gym's health: total members, active subscriptions, memberships expiring in 30 days, today's reservations and monthly revenue — plus plan distribution, revenue trend and new-member charts.
Technical Deep Dive
Overview
NutriGym is a mobile-first, cross-platform fitness ecosystem — built with React Native to run natively on both iOS and Android from a single codebase — that brings workout tracking, nutrition tracking, and body measurements together in one platform. What sets it apart is the LangChain + Google Gemini powered conversational AI trainer and dietician agents, which use the user's past workout and nutrition data as context — giving users personalized, real-time advice that feels like working with a real coach. It's a two-person project, built together with a university colleague and coordinated through Git. The backend was containerized with Docker and deployed to Azure Container Apps as part of our cloud infrastructure. The web admin panel gym staff use to manage members, plans and content shares that same backend, built separately with React, TypeScript and Tailwind CSS and deployed on Vercel.
Tech Stack
Frontend (Mobile)
- React Native 0.81.5
- Expo SDK 54.0.19
- Context API
- Axios
Web Site
- React
- TypeScript
- Tailwind CSS
- Vercel
Backend (API)
- Node.js
- Express ^5.1.0
Database
- MongoDB
- Mongoose ^8.16.3
AI Engine
- LangChain ^1.1.5
- Google Gemini (LLM)
- LangGraph orchestration
Cloud & Infrastructure
- Azure Container Apps
- Docker
- Azure Blob Storage (SAS)
- Nodemailer (SMTP)
API Flow
- 1The client app sends the request to the Express.js web server.
- 2The middleware layer runs in sequence: Rate Limiter → Blacklist Check → Auth Guard (JWT validation).
- 3The API Router dispatches the request to the relevant module's controller.
- 4The controller delegates business logic to the Service layer; cross-module communication goes through a neighboring module's public service rather than its database directly (low coupling).
- 5The service reads/writes MongoDB via its Mongoose model and returns the result to the client as JSON.
RAG Flow — AI Coaching Engine
The AI agent's decision logic is modeled as a LangGraph state machine. A user message passes through the following nodes in order:
- 1Guardrail: The incoming user message first passes a safety check; unsafe content is routed straight to the Response Node and blocked.
- 2Classifier Node: Safe messages are classified by topic: training, nutrition, or a general question.
- 3Trainer / Dietician Agent: Training or nutrition queries are routed to the matching agent; if it needs database context it calls a Tool Node (e.g. fetching the user's workout plan), takes the result back through a feedback loop, and generates the reply.
- 4Retrieval Node + General LLM (RAG): General questions go through the Retrieval Node, which fetches relevant articles from an external knowledge base and feeds them as context to the General LLM — a classic Retrieval-Augmented Generation pattern.
- 5Response Node: The generated reply is streamed to the client over SSE (Server-Sent Events); a typing indicator and skeleton loader hide the expected latency in the UI.
Performance
Standard API endpoints respond in under 50 ms on average thanks to MongoDB indexes. The AI chat endpoint is far slower due to network latency to Gemini, model inference time, and LangChain classification/routing loops — to hide this from the user, the UI streams the response over SSE alongside a skeleton loader and typing indicator.
| Endpoint Category | Avg (ms) | P95 (ms) | Success Rate |
|---|---|---|---|
| Authentication (JWT Validate) | 18 | 35 | 100% |
| Profile/Measurement Updates | 24 | 48 | 99.8% |
| Workout/Meal Logging | 32 | 62 | 99.5% |
| Dashboard Statistics Query | 45 | 88 | 99.7% |
| AI Chat Message Processing | 1850 | 3200 | 98.2% |
Testing & Results
- Three testing levels: Unit (controller/model validations with mocked/stubbed DB and SMTP calls), Integration (cross-module JWT/service communication, LangChain/Gemini routing), and System (use-case-based, end-to-end black-box scenarios).
- Mock dataset: 10 member accounts, 50 exercises, 100 foods/recipes, and predefined trainer availability tables.
- With a 15-user test group, the System Usability Scale (SUS) score reached 88 on the Nutrition screen.
- Task Completion Time dropped across the Home, Nutrition, Profile, and Admin flows — 25→8s, 19→6s, 15→5s, and 18→5s respectively — with the Admin member-registration flow reaching a 100% Task Success Rate.