HydroHomie

This is Infinite Loop's entry for the HuddleHive 2025 Hackathon!

Welcome to HydroHomie! This is a smart hydration tracking application designed to help you build and maintain healthy water-drinking habits. It provides personalized, AI-powered encouragement to keep you motivated and on track with your hydration goals, and a healthy dose of competitiveness and cooperative habit-building with your friends.

Features

  • Daily Water Intake Tracking: Easily log every sip of water you take throughout the day.
  • Goal Setting: Set a daily hydration goal and monitor your progress with a visual water bottle interface.
  • AI-Powered Encouragement: Receive unique motivational messages generated by OpenAI's GPT model, tailored to your local weather conditions and stats on your water intake.
  • User Authentication: Secure login and registration system to keep your data private.
  • Performance Optimized: Caches weather and encouragement data to reduce API calls and improve loading times.

Tech Stack

  • Frontend:

    • React
    • TypeScript
    • Vite
    • Material-UI
    • Axios
  • Backend:

    • Python
    • FastAPI
    • OpenAI API
    • IP API
    • OpenMeteo API

Prerequisites

Before you begin, ensure you have the following installed:

Setup and Installation

Follow these steps to get your development environment set up.

1. Clone the Repository

git clone <https://github.com/karikowska/hydro-homie.git>

The targeted branch is main. If you are not in the targeted branch, please

  1. git fetch origin
  2. git checkout main

2. Backend Setup

  1. Navigate to the backend directory:

    cd backend
    
  2. (Optional but recommended) Create and activate a virtual environment:

    # For Windows
    python -m venv venv
    .\\venv\\Scripts\\activate
    
    # For macOS/Linux
    python3 -m venv venv
    source venv/bin/activate
    
  3. Install Python dependencies: Create a file named requirements.txt in the backend directory and add the following lines:

    fastapi
    uvicorn[standard]
    requests
    openai
    python-dotenv
    

    Then, run the installation command:

    pip install -r requirements.txt
    
  4. Set up environment variables: Create a file named .env in the backend directory and add your OpenAI API key:

    OPENAI_API_KEY="your_openai_api_key_here"
    

    Create a file named .env in the frontend directory and add your BASE_URL API key:

    BASE_URL="http://localhost:8000" (adjust the port according to your backend service)
    

3. Frontend Setup

  1. Navigate to the frontend directory:

    cd ../frontend
    
  2. Install Node.js dependencies:

    npm install
    

Running the Application

  1. Start the Backend Server: In your terminal, from the backend directory, run:

    uvicorn gpt_encourage:app --reload
    

    The backend server will start on http://localhost:8000.

  2. Start the Frontend Development Server: In a new terminal, from the frontend directory, run:

    npm run dev
    

    The application will be available at http://localhost:5173 (or another port if 5173 is in use).


Enjoy staying hydrated with HydroHomie!

Share this project:

Updates