Skip to content

sghosh685/SmartSip

Repository files navigation

💧 SmartSip

AI-Powered Hydration Tracking PWA

SmartSip helps you stay hydrated with intelligent tracking, personalized goals, and an AI coach. Built as a Progressive Web App for seamless mobile and desktop experience.

SmartSip PWA


✨ Features

  • 🎯 Smart Goal Tracking - Dynamic daily goals based on activity, weather, and health conditions
  • 🤖 AI Hydration Coach - Personalized feedback powered by Groq LLM
  • 🔥 Streak System - Gamified motivation with badges and celebrations
  • 🍵 Multi-Drink Support - Track water, coffee, tea, and more with hydration multipliers
  • 📊 Visual Analytics - Beautiful charts and progress visualizations
  • 🌙 Dark Mode - Easy on the eyes, day or night
  • 📱 PWA Install - Add to home screen for native-like experience
  • ☁️ Cloud Sync - Sign in with Google to sync across devices

🏗️ Tech Stack

Layer Technology
Frontend React, Vite, Tailwind CSS
Backend FastAPI, Python, SQLAlchemy
Database PostgreSQL (Supabase)
Auth Supabase Auth (Google OAuth)
AI Groq API (Llama 3.1)
Hosting Vercel (Frontend), Render (Backend)

🚀 Quick Start

Prerequisites

  • Node.js 18+
  • Python 3.9+
  • Supabase account (free tier)
  • Groq API key (free tier)

Local Development

  1. Clone the repository

    git clone https://github.com/YOUR_USERNAME/smartsip.git
    cd smartsip
  2. Setup Frontend

    cd frontend
    npm install
    cp .env.example .env
    # Edit .env with your Supabase credentials
    npm run dev
  3. Setup Backend

    cd backend
    python -m venv venv
    source venv/bin/activate  # Windows: venv\Scripts\activate
    pip install -r requirements.txt
    cp .env.example .env
    # Edit .env with your database URL and API keys
    uvicorn backend:app --reload --port 8001
  4. Open in browser

    http://localhost:5173
    

📁 Project Structure

SmartSip/
├── frontend/               # React/Vite frontend
│   ├── src/
│   │   ├── App.jsx        # Main application (reduced to routing + state)
│   │   ├── components/    # Modular UI components
│   │   │   ├── HomeScreen.jsx
│   │   │   ├── StatsScreen.jsx
│   │   │   ├── SettingsScreen.jsx
│   │   │   ├── AlarmScreen.jsx
│   │   │   ├── BottomNav.jsx
│   │   │   ├── LoginModal.jsx
│   │   │   └── HydrationVisualizer.jsx
│   │   ├── hooks/         # Custom React hooks
│   │   ├── utils/         # Utility functions (dateUtils.js)
│   │   ├── lib/           # Utilities (Supabase client)
│   │   └── constants/     # Drink types, badges, etc.
│   ├── .env.example       # Environment template
│   └── vercel.json        # Vercel deployment config
├── backend/               # FastAPI backend
│   ├── backend.py         # API routes and logic
│   ├── database.py        # SQLAlchemy setup
│   ├── models.py          # Database models
│   ├── tests.py           # Automated backend tests
│   ├── phase_c_cleanup.py # Data sanitization script
│   └── .env.example       # Environment template
├── docs/                  # Documentation
├── render.yaml            # Render deployment config
└── README.md              # Entry point

🔐 Environment Variables

Frontend (frontend/.env)

VITE_SUPABASE_URL=https://your-project.supabase.co
VITE_SUPABASE_ANON_KEY=your-anon-key
VITE_API_URL=http://localhost:8001/api

Backend (backend/.env)

DATABASE_URL=postgresql://user:pass@host:5432/db
GROQ_API_KEY=your-groq-api-key
CORS_ORIGINS=http://localhost:5173

📖 Documentation


🧪 Testing

Backend Tests

cd backend
python tests.py

Data Cleanup (Admin)

# Dry run - shows what would be fixed
python phase_c_cleanup.py

# Live run - actually fixes corrupted data
python phase_c_cleanup.py --live

🤝 Contributing

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

📄 License

Copyright © 2025 SmartSip. All Rights Reserved.

Proprietary software. See the LICENSE file for details.


🙏 Acknowledgments


Made with 💙 and lots of water

About

AI hydration coach that adapts daily water goals based on activity, weather, and health—helping users build lasting habits

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors