Skip to content

NextJS rebuild of the iHealth application with authentication, dashboard, health data visualization, and comprehensive Ubuntu 24.04 installation instructions

License

Notifications You must be signed in to change notification settings

mc0l85/ihealth-nextjs

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

10 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

iHealth NextJS - Personal Health Tracking Platform

A comprehensive health tracking application built with Next.js, featuring AI-powered insights, Oura Ring integration, and detailed health analytics.

πŸš€ Quick Start

# Clone the repository
git clone https://github.com/mc0l85/ihealth-nextjs.git
cd ihealth-nextjs/app

# Run automated setup
npm run setup

# Start development server
npm run dev

Visit http://localhost:3000 and log in with:

✨ Features

  • πŸ“Š Health Data Tracking - Monitor steps, calories, heart rate, weight, and more
  • πŸ’ͺ Workout Logging - Track exercises with detailed metrics
  • 😴 Sleep Analysis - Comprehensive sleep quality monitoring
  • πŸ”— Oura Ring Integration - Sync data from your Oura Ring
  • πŸ€– AI Health Insights - Get personalized recommendations
  • πŸ“± Responsive Design - Works on desktop, tablet, and mobile
  • πŸ” Secure Authentication - NextAuth.js with multiple providers
  • πŸ“ˆ Data Visualization - Beautiful charts and graphs
  • πŸ’¬ AI Chat Assistant - Ask questions about your health data

πŸ› οΈ Tech Stack

  • Frontend: Next.js 14, React 18, TypeScript
  • Styling: Tailwind CSS, Radix UI, Framer Motion
  • Database: PostgreSQL with Prisma ORM
  • Authentication: NextAuth.js
  • Charts: Chart.js, Recharts, Plotly.js
  • AI: OpenAI API integration
  • Deployment: Vercel-ready

πŸ“‹ Prerequisites

  • Node.js 18 or higher
  • PostgreSQL database
  • Git

πŸ”§ Installation

Automated Setup (Recommended)

git clone https://github.com/mc0l85/ihealth-nextjs.git
cd ihealth-nextjs/app
npm run setup

Manual Setup

  1. Clone and install dependencies

    git clone https://github.com/mc0l85/ihealth-nextjs.git
    cd ihealth-nextjs/app
    npm install
  2. Set up environment variables

    cp .env.local.example .env.local

    Edit .env.local with your values:

    DATABASE_URL="postgresql://username:password@localhost:5432/ihealth_db"
    NEXTAUTH_URL="http://localhost:3000"
    NEXTAUTH_SECRET="your-secret-key-here"
    OPENAI_API_KEY="your-openai-api-key"
  3. Set up database

    npx prisma generate
    npx prisma db push
    npm run seed
  4. Start development server

    npm run dev

πŸ“œ Available Scripts

Script Description
npm run dev Start development server
npm run build Build for production
npm run start Start production server
npm run lint Run ESLint
npm run setup Complete development setup
npm run seed Seed database with demo data
npm run reset-db Reset database (delete all data)
npm run migrate Run database migrations
npm run db:push Push Prisma schema to database
npm run db:studio Open Prisma Studio
npm run generate Generate Prisma client

πŸ—„οΈ Database Schema

Core Models

  • User - User accounts, profiles, and health goals
  • HealthRecord - Daily health metrics (steps, calories, heart rate, etc.)
  • Workout - Exercise sessions with detailed tracking
  • SleepData - Sleep quality and duration metrics
  • ActivityData - Daily activity summaries
  • OuraData - Oura Ring integration data
  • ChatConversation/ChatMessage - AI chat functionality

Key Features

  • Comprehensive health data tracking
  • Oura Ring API integration
  • AI-powered chat system
  • Secure user authentication
  • Data visualization ready

πŸ”— Integrations

Oura Ring

Connect your Oura Ring to automatically sync:

  • Sleep data (duration, efficiency, stages)
  • Activity data (steps, calories, heart rate)
  • Readiness scores and recovery metrics

OpenAI

AI-powered features include:

  • Personalized health insights
  • Chat-based data analysis
  • Trend identification
  • Goal recommendations

🎨 UI Components

Built with modern, accessible components:

  • Radix UI primitives
  • Custom Tailwind CSS styling
  • Framer Motion animations
  • Responsive design patterns
  • Dark/light mode support

πŸ“Š Data Visualization

Multiple chart types for health data:

  • Line charts for trends
  • Bar charts for comparisons
  • Pie charts for distributions
  • Interactive Plotly.js charts
  • Real-time data updates

πŸ” Security

  • NextAuth.js authentication
  • Secure password hashing (bcrypt)
  • JWT token management
  • Environment variable protection
  • Database query sanitization

πŸš€ Deployment

Vercel (Recommended)

  1. Push to GitHub
  2. Connect to Vercel
  3. Set environment variables
  4. Deploy automatically

Docker

# Build image
docker build -t ihealth-nextjs .

# Run container
docker run -p 3000:3000 ihealth-nextjs

πŸ§ͺ Testing

# Run tests
npm test

# Run tests in watch mode
npm run test:watch

# Generate coverage report
npm run test:coverage

πŸ“± Mobile Support

  • Responsive design for all screen sizes
  • Touch-friendly interface
  • Progressive Web App (PWA) ready
  • Offline data caching

🀝 Contributing

  1. Fork the repository
  2. Create a feature branch (git checkout -b feature/amazing-feature)
  3. Commit your changes (git commit -m 'Add amazing feature')
  4. Push to the branch (git push origin feature/amazing-feature)
  5. Open a Pull Request

πŸ“ License

This project is licensed under the MIT License - see the LICENSE file for details.

πŸ†˜ Support

  • πŸ“– Check the SETUP.md guide
  • πŸ› Report issues on GitHub
  • πŸ’¬ Join our community discussions
  • πŸ“§ Contact support

πŸ—ΊοΈ Roadmap

  • Apple Health integration
  • Google Fit integration
  • Advanced AI insights
  • Social features
  • Nutrition tracking
  • Medication reminders
  • Doctor portal
  • Export/import data

πŸ™ Acknowledgments

  • Next.js team for the amazing framework
  • Prisma for the excellent ORM
  • Radix UI for accessible components
  • Tailwind CSS for utility-first styling
  • OpenAI for AI capabilities

Made with ❀️ for better health tracking

About

NextJS rebuild of the iHealth application with authentication, dashboard, health data visualization, and comprehensive Ubuntu 24.04 installation instructions

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published