Inspiration

Many existing nutrition applications focus primarily on calorie counting, which often feels repetitive and difficult to sustain in the long term. While users may know how much they eat, they rarely understand what they are eating or how it impacts their health. We wanted to build a smarter and more supportive system that interprets food in a more human-like way, provides meaningful nutritional insights, and adapts to different dietary habits and cultures.

The ERNIE Hackathon inspired us to explore how large language models can be applied to real-world health challenges and improve everyday decision-making through AI.


What It Does

  • Tracks daily meals, water intake, and macronutrients in a single platform
  • Uses AI-based image and text analysis to identify food and estimate nutritional values
  • Generates personalized 7-day meal plans based on user goals and preferences
  • Provides a smart nutrition chatbot for guidance and explanations
  • Displays daily summaries, nutrition trends, and diet quality scores
  • Supports both English and Mandarin to improve accessibility

How We Built It

Frontend

  • Framework: Next.js 15 (App Router) with TypeScript
  • Styling: Tailwind CSS v4, shadcn/ui, and Radix UI
  • Data Visualization: Recharts for charts and analytics

Backend and Data

  • Supabase
    • User authentication
    • PostgreSQL database
  • API Routes
    • Secure communication between the frontend and AI services

Artificial Intelligence

  • LLM Integration
    • Baidu Ernie 5.0 Thinking
    • Baidu Ernie 4.0-8K (latest)
    • Integrated via the Baidu AI Studio LLM API
  • AI Client Configuration
    • Custom OpenAI-compatible client
    • Custom baseURL pointing to Baidu AI Studio
    • Secure server-side API key handling
  • Prompt Engineering
    • Food image analysis
    • Nutrition estimation
    • Meal planning
    • Conversational chatbot responses

Deployment

  • Platform: Vercel

Version Control

  • Git and GitHub

System Design

  • Modular and scalable architecture
  • Optimized for performance and user experience

Challenges We Ran Into

  • Ensuring reasonable nutrition estimation accuracy from images and text
  • Designing prompts that generate structured and consistent AI responses
  • Managing multilingual support while preserving conversation context
  • Balancing real-time AI responses with smooth UI performance
  • Coordinating multiple AI-powered features within a single application

Accomplishments That We’re Proud Of

  • Successfully applying ERNIE 4.0 and 5.0 across multiple features in a real-world application
  • Delivering a fully functional, end-to-end AI-powered web platform
  • Creating an intuitive dashboard that simplifies nutrition tracking
  • Implementing bilingual AI interaction with persistent chat history
  • Deploying a live demo that demonstrates practical AI usage beyond a prototype

What We Learned

  • How large language models can enhance personalized health applications
  • Practical prompt engineering techniques for structured and reliable AI outputs
  • Full-stack integration of AI services with modern web technologies
  • The importance of UX design in AI-driven systems
  • How to balance automation with user control in health-related applications

What’s Next for EatSmartAI (Application-Building Task)

  • Improve food recognition accuracy using hybrid vision and database matching
  • Add micronutrient tracking, including vitamins and minerals
  • Introduce AI-driven habit analysis and weekly health insights
  • Integrate wearable devices and fitness platforms
  • Expand language support and regional food databases

Built With

Share this project:

Updates