A comprehensive health tracking application built with Next.js, featuring AI-powered insights, Oura Ring integration, and detailed health analytics.
# 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 devVisit http://localhost:3000 and log in with:
- Email: demo@ihealth.com
- Password: demo123
- π 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
- 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
- Node.js 18 or higher
- PostgreSQL database
- Git
git clone https://github.com/mc0l85/ihealth-nextjs.git
cd ihealth-nextjs/app
npm run setup-
Clone and install dependencies
git clone https://github.com/mc0l85/ihealth-nextjs.git cd ihealth-nextjs/app npm install -
Set up environment variables
cp .env.local.example .env.local
Edit
.env.localwith 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"
-
Set up database
npx prisma generate npx prisma db push npm run seed
-
Start development server
npm run dev
| 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 |
- 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
- Comprehensive health data tracking
- Oura Ring API integration
- AI-powered chat system
- Secure user authentication
- Data visualization ready
Connect your Oura Ring to automatically sync:
- Sleep data (duration, efficiency, stages)
- Activity data (steps, calories, heart rate)
- Readiness scores and recovery metrics
AI-powered features include:
- Personalized health insights
- Chat-based data analysis
- Trend identification
- Goal recommendations
Built with modern, accessible components:
- Radix UI primitives
- Custom Tailwind CSS styling
- Framer Motion animations
- Responsive design patterns
- Dark/light mode support
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
- NextAuth.js authentication
- Secure password hashing (bcrypt)
- JWT token management
- Environment variable protection
- Database query sanitization
- Push to GitHub
- Connect to Vercel
- Set environment variables
- Deploy automatically
# Build image
docker build -t ihealth-nextjs .
# Run container
docker run -p 3000:3000 ihealth-nextjs# Run tests
npm test
# Run tests in watch mode
npm run test:watch
# Generate coverage report
npm run test:coverage- Responsive design for all screen sizes
- Touch-friendly interface
- Progressive Web App (PWA) ready
- Offline data caching
- Fork the repository
- Create a feature branch (
git checkout -b feature/amazing-feature) - Commit your changes (
git commit -m 'Add amazing feature') - Push to the branch (
git push origin feature/amazing-feature) - Open a Pull Request
This project is licensed under the MIT License - see the LICENSE file for details.
- π Check the SETUP.md guide
- π Report issues on GitHub
- π¬ Join our community discussions
- π§ Contact support
- Apple Health integration
- Google Fit integration
- Advanced AI insights
- Social features
- Nutrition tracking
- Medication reminders
- Doctor portal
- Export/import data
- 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