Skip to content

mrchandrayee/AI-Health-Platform

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

5 Commits
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

AI Health Platform

πŸš€ Overview

The AI Health Platform frontend is a comprehensive Next.js application that provides a complete health and fitness management experience. All requested features from the original requirements have been implemented.

πŸ“± Available Pages & Features

βœ… Authentication & User Onboarding

  • Login Page (/auth/login) - Email/password authentication with modern UI
  • Registration Page (/auth/register) - User signup with validation
  • Onboarding Wizard (/onboarding) - 4-step comprehensive user setup:
    • Personal Information (age, gender, height, weight, activity level)
    • Goals Setting (primary goals, target weight, timeline, motivation)
    • Preferences (dietary restrictions, cultural preferences, workout types, equipment)
    • Health Information (medical conditions, injuries, medications, sleep, stress)

🍎 AI Nutrition Bot Interface

  • Nutrition Page (/nutrition) with 4 tabs:
    • Meal Plans Tab: View current and past meal plans with nutritional breakdowns
    • Generate Plan Tab: Comprehensive form for AI meal plan generation:
      • Primary goals (weight loss, muscle gain, maintenance, bulking)
      • Dietary restrictions (vegetarian, vegan, halal, kosher, gluten-free, dairy-free)
      • Cultural preferences input
      • Meals per day configuration
      • Target calories setting
    • Food Logs Tab: Track daily meal consumption with logging capabilities
    • Nutrition Goals Tab: View and manage daily calorie and macro targets

πŸ‹οΈ AI Fitness Planner Interface

  • Fitness Page (/fitness) with 4 tabs:
    • Workout Plans Tab: Current active plans with progress tracking
    • Generate Plan Tab: AI workout plan generation form:
      • Fitness goals (strength, muscle, endurance, weight loss, general fitness)
      • Current fitness level (beginner, intermediate, advanced)
      • Available equipment selection
      • Workout frequency and session duration
      • Injury history and limitations input
    • Workout Logs Tab: Recent workout history with completion status
    • Exercise Library Tab: Searchable exercise database with difficulty levels

πŸ“Š Smart Progress Dashboard

  • Progress Page (/progress) with 5 tabs:
    • Overview Tab: Combined progress visualization and workout consistency calendar
    • Weight Tracking Tab: Weight logging and history with trend analysis
    • Fitness Progress Tab: Strength progression and cardio improvements
    • Wellness Metrics Tab: Sleep quality, stress level, and energy tracking
    • Goals Tab: Current goal progress with completion percentages

πŸ“š Education Hub

  • Education Page (/education) with 3 tabs:
    • Articles Tab: AI-curated health articles with categories and search
    • Videos Tab: Educational video library with duration and view counts
    • Favorites Tab: Saved content management
    • Features: Search functionality, category filtering, featured content

πŸ‘€ User Profiles & Settings

  • Profile Page (/profile) with 4 tabs:

    • Personal Info Tab: Editable personal information and physical stats
    • Preferences Tab: Units, language, timezone settings
    • Privacy Tab: Profile visibility and security settings
    • Notifications Tab: Comprehensive notification preferences
  • Settings Page (/settings):

    • Data Management: Export data, backup, storage usage
    • App Preferences: Dark mode, auto-sync, offline mode, beta features
    • Danger Zone: Clear data and account deletion options

πŸ‘¨β€βš•οΈ Trainer Portal (PT Dashboard)

  • Trainer Clients Page (/trainer/clients) with 4 tabs:
    • My Clients Tab: Client list with search, progress tracking, and quick actions
    • Schedule Tab: Daily schedule management with session links
    • Messages Tab: Client communication interface
    • Analytics Tab: Client progress overview and program effectiveness metrics

🏠 Main Dashboard

  • Dashboard Page (/) - Personalized homepage with:
    • Overview cards showing key metrics
    • Progress charts and visualizations
    • Quick actions for common tasks
    • Recent activity feed
    • Adaptive layout based on user role (client vs trainer)

🎨 UI/UX Features Implemented

βœ… Modern Design System

  • Gradient backgrounds and modern color schemes
  • Tailwind CSS with custom design tokens
  • Lucide React icons throughout the interface
  • Responsive design for all screen sizes
  • Dark/light mode support (configurable in settings)

βœ… Interactive Components

  • Multi-step forms with progress indicators
  • Tab navigation for organized content
  • Modal dialogs for confirmations and detailed views
  • Toggle switches for settings
  • Progress bars and completion indicators
  • Search and filter functionality
  • Loading states and transitions

βœ… Form Handling & Validation

  • Client-side validation for all forms
  • TypeScript interfaces for type safety
  • Comprehensive form states with error handling
  • Multi-select checkboxes for preferences
  • Dynamic form updates based on user selections

πŸ›  Technical Implementation

βœ… Architecture

  • Next.js 15 with App Router
  • TypeScript for type safety
  • Tailwind CSS for styling
  • React Context for state management
  • React Query for API state management
  • React Hook Form for form handling

βœ… Components Structure

src/
β”œβ”€β”€ app/                          # Next.js App Router pages
β”‚   β”œβ”€β”€ auth/                     # Authentication pages
β”‚   β”œβ”€β”€ education/               # Education hub
β”‚   β”œβ”€β”€ fitness/                 # Fitness planner
β”‚   β”œβ”€β”€ nutrition/               # Nutrition bot
β”‚   β”œβ”€β”€ onboarding/              # User onboarding
β”‚   β”œβ”€β”€ profile/                 # User profile
β”‚   β”œβ”€β”€ progress/                # Progress tracking
β”‚   β”œβ”€β”€ settings/                # App settings
β”‚   └── trainer/                 # Trainer portal
β”œβ”€β”€ components/
β”‚   β”œβ”€β”€ dashboard/               # Dashboard components
β”‚   β”œβ”€β”€ layout/                  # Layout components
β”‚   └── providers/               # Context providers
β”œβ”€β”€ contexts/                    # React contexts
β”œβ”€β”€ lib/                         # Utilities and API client
└── types/                       # TypeScript type definitions

βœ… State Management

  • AuthContext for user authentication state
  • QueryClient for server state caching
  • Local state with useState for component-specific data
  • Form state managed with controlled components

βœ… API Integration Ready

  • Complete API client (src/lib/api.ts) with all endpoints
  • TypeScript interfaces for all API requests/responses
  • Error handling and retry logic
  • Authentication headers management
  • Loading states for all async operations

πŸ”— Navigation & Routing

βœ… Protected Routes

  • Automatic redirection to /auth/login for unauthenticated users
  • Role-based navigation (trainer vs client features)
  • Onboarding flow for new users

βœ… Navigation Structure

/ (Dashboard)
β”œβ”€β”€ /auth/login
β”œβ”€β”€ /auth/register
β”œβ”€β”€ /onboarding
β”œβ”€β”€ /nutrition
β”œβ”€β”€ /fitness
β”œβ”€β”€ /progress
β”œβ”€β”€ /education
β”œβ”€β”€ /profile
β”œβ”€β”€ /settings
└── /trainer/clients (trainer only)

πŸš€ Getting Started

Prerequisites

  • Node.js 18+
  • npm or yarn

Installation

# Navigate to frontend directory
cd frontend

# Install dependencies
npm install --legacy-peer-deps

# Start development server
npm run dev

Environment Variables

Create a .env.local file:

NEXT_PUBLIC_API_URL=http://localhost:8000
NEXTAUTH_SECRET=your-secret-key
NEXTAUTH_URL=http://localhost:3000

πŸ“‹ Features Checklist

βœ… Authentication & Onboarding

  • Login page with email/password
  • Registration page with validation
  • Multi-step onboarding wizard
  • Protected routes implementation
  • User session management

βœ… AI Nutrition Bot

  • Meal plan request form with all required fields
  • Meal plan display with nutritional information
  • Food logging capabilities
  • Recipe details components
  • Ingredient swap functionality (UI ready)

βœ… AI Fitness Planner

  • Fitness plan request form
  • Workout plan display with progress tracking
  • Exercise library with search
  • Workout logging capabilities
  • Adaptive plan modification (UI ready)

βœ… Progress Dashboard

  • Overall progress summary
  • Interactive charts (placeholder for chart library)
  • Weight tracking with history
  • Goal management and visualization
  • Manual data input forms

βœ… Education Hub

  • Article list with categories and search
  • Article detail views
  • Video library with player components
  • Favorites management
  • Search and filter functionality

βœ… User Profile & Trainer Portal

  • User profile management
  • Trainer client dashboard
  • Client progress monitoring
  • Communication interface
  • Plan assignment capabilities

🎯 Next Steps

  1. Backend Integration: Connect all API endpoints with the FastAPI backend
  2. Chart Library: Integrate Chart.js or similar for data visualization
  3. Real-time Features: Add WebSocket support for live updates
  4. Mobile App: Convert to React Native or PWA
  5. Advanced AI Features: Integrate with OpenAI API for enhanced recommendations

πŸ“± Mobile Responsiveness

All pages are fully responsive and optimized for:

  • Desktop (1024px+)
  • Tablet (768px - 1023px)
  • Mobile (320px - 767px)

πŸ”’ Security Features

  • Input validation on all forms
  • XSS protection through React's built-in escaping
  • CSRF protection ready for production
  • Secure authentication flow
  • Data privacy controls in settings

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors