Skip to content

A comprehensive Flask-based web application that combines artificial intelligence with veterinary care management, featuring AI-powered symptom analysis, photo diagnosis, and intelligent health tracking for pets

Notifications You must be signed in to change notification settings

kashisharora-14/VetTrack-AI

Folders and files

NameName
Last commit message
Last commit date

Latest commit

ย 

History

131 Commits
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 

Repository files navigation

๐Ÿพ VetTrack AI - AI-Powered Pet Health Management System

A Flask-based AI web application that helps pet owners manage health more effectively with AI-driven analysis, photo diagnosis, smart tracking, and Murf-powered voice guidance.

๐Ÿ’ก Inspiration:

This project is deeply personal to me. I once had a pet who suffered from parvovirus.
We didnโ€™t have access to a professional vet in our city at the time, so he only received basic treatment without identifying the real issue.
By the time we took him to a bigger hospital, it was too late to save him. Losing him was one of the hardest experiences, and it inspired me to build VetTrack AI โ€” so that other pet owners can have faster access to health insights and never feel helpless in such moments.

โœจ Features

๐Ÿค– AI-Powered Analysis

  • AI Symptom Checker: Advanced symptom analysis using Gemini AI for accurate preliminary diagnoses
  • Photo Analysis: Upload pet photos for AI-powered visual health assessment
  • Smart Diagnosis: Machine learning-based condition likelihood and urgency assessment
  • Voice Integration: Murf TTS API for audio playback of analysis results

๐Ÿฅ Health Management

  • Pet Profiles: Comprehensive pet information management (species, breed, age, medical notes)
  • Health History: Detailed tracking of symptoms, diagnoses, and treatments
  • Urgency Assessment: AI-powered urgency level classification (Low/Medium/High/Emergency)
  • Medical Records: Export consultation summaries and health reports

๐Ÿ“ฑ User Experience

  • Personalized Dashboard: User-specific pet overview and health statistics
  • Voice Greetings: Personalized TTS welcome messages upon login
  • Responsive Design: Mobile-friendly interface with Bootstrap 5
  • Real-time Updates: Live health history and reminder tracking

๐Ÿ”” Smart Notifications

  • Health Reminders: Vaccination, medication, and checkup scheduling
  • Urgency Alerts: Immediate notifications for high-priority health concerns
  • Progress Tracking: Completion status for health tasks and appointments

๐Ÿ’ฌ Consultation System

  • Virtual Consultations: Jitsi Meet integration for video calls with veterinarians
  • Health Summaries: AI-generated consultation notes and recommendations
  • Professional Integration: Share health history with veterinary professionals

๐Ÿš€ Technology Stack

Backend

  • Flask 3.1.2: Modern Python web framework
  • SQLAlchemy 2.0.43: Database ORM and management
  • SQLite: Lightweight database (configurable for production)
  • Python 3.11+: Core programming language

AI & External APIs

  • Google Gemini AI: Advanced symptom analysis and diagnosis
  • Murf TTS API: High-quality text-to-speech for accessibility
  • Jitsi Meet: Video consultation platform integration

Frontend

  • Bootstrap 5.3.0: Responsive CSS framework
  • Font Awesome 6.0.0: Icon library
  • Vanilla JavaScript: Modern ES6+ features
  • HTML5: Semantic markup

Security & Authentication

  • Flask-Login: User session management
  • Password Hashing: Secure credential storage
  • Session Management: Secure user authentication

๐Ÿ“‹ Prerequisites

  • Python 3.11 or higher
  • pip package manager
  • Modern web browser (Chrome, Firefox, Safari, Edge)
  • Internet connection for AI APIs

๐Ÿ› ๏ธ Installation

1. Clone the Repository

git clone https://github.com/yourusername/vettrack-ai.git
cd vettrack-ai

2. Create Virtual Environment

python -m venv venv

# Windows
venv\Scripts\activate

# macOS/Linux
source venv/bin/activate

3. Install Dependencies

pip install -r requirements.txt

4. Environment Configuration

Create a .env file in the project root:

# Required API Keys
GOOGLE_API_KEY=your_gemini_api_key_here
MURF_API_KEY=your_murf_tts_api_key_here

# Optional: Database Configuration
DATABASE_URL=sqlite:///instance/pet_health.db

# Optional: Session Security
SESSION_SECRET=your_secure_session_secret_here

5. Initialize Database

python main.py

The database will be automatically created on first run.

๐Ÿš€ Running the Application

Development Mode

python main.py

The application will be available at http://127.0.0.1:5000

Production Mode

# Set environment variables
export FLASK_ENV=production
export FLASK_APP=main.py

# Run with production server
gunicorn -w 4 -b 0.0.0.0:5000 main:app

๐Ÿ“ฑ Usage Guide

Getting Started

  1. Sign Up: Create a new account with your email and password
  2. Add Pets: Register your pets with species, breed, age, and medical notes
  3. Access Dashboard: View your pets' health overview and quick actions

AI Symptom Checker

  1. Select a pet from your profile
  2. Describe symptoms in detail (or use quick-select checkboxes)
  3. Receive AI-powered analysis with:
    • Preliminary diagnosis
    • Urgency level assessment
    • Treatment recommendations
    • Possible causes
    • Audio playback of results

Photo Analysis

  1. Upload a clear photo of the health concern
  2. Add optional description for context
  3. Get AI visual analysis including:
    • Condition likelihood
    • Severity assessment
    • Urgency classification
    • Professional recommendations

Health Management

  • Track History: Monitor symptoms, treatments, and outcomes
  • Set Reminders: Schedule vaccinations, medications, and checkups
  • Export Reports: Generate consultation summaries for veterinarians

๐Ÿ”ง Configuration

API Keys Setup

Google Gemini AI

  1. Visit Google AI Studio
  2. Create a new API key
  3. Add to your .env file as GOOGLE_API_KEY

Murf TTS API

  1. Sign up at Murf AI
  2. Generate your API key
  3. Add to your .env file as MURF_API_KEY

Database Configuration

  • Default: SQLite database in instance/pet_health.db
  • Production: Set DATABASE_URL in .env for PostgreSQL/MySQL
  • Backup: Database files are automatically created and managed

๐Ÿ“Š Project Structure

vettrack-ai/
โ”œโ”€โ”€ app.py                 # Main Flask application
โ”œโ”€โ”€ main.py               # Application entry point
โ”œโ”€โ”€ models.py             # Database models and schemas
โ”œโ”€โ”€ gemini.py             # AI integration module
โ”œโ”€โ”€ requirements.txt      # Python dependencies
โ”œโ”€โ”€ .env                  # Environment configuration
โ”œโ”€โ”€ static/               # Static assets
โ”‚   โ”œโ”€โ”€ css/             # Stylesheets
โ”‚   โ”œโ”€โ”€ js/              # JavaScript files
โ”‚   โ””โ”€โ”€ uploads/         # User-uploaded images
โ”œโ”€โ”€ templates/            # HTML templates
โ”‚   โ”œโ”€โ”€ dashboard.html   # Main dashboard
โ”‚   โ”œโ”€โ”€ symptom.html     # Symptom checker
โ”‚   โ”œโ”€โ”€ image.html       # Photo analysis
โ”‚   โ””โ”€โ”€ ...              # Other pages
โ””โ”€โ”€ instance/            # Database and uploads

๐Ÿ”’ Security Features

  • Password Hashing: Secure bcrypt-based password storage
  • Session Management: Secure user authentication
  • Input Validation: Comprehensive form validation and sanitization
  • File Upload Security: Secure image handling with size limits
  • SQL Injection Protection: Parameterized database queries

๐ŸŒ API Endpoints

Authentication

  • POST /signup - User registration
  • POST /login - User authentication
  • GET /logout - User logout

Pet Management

  • GET /api/get_pets - Retrieve user's pets
  • POST /api/add_pet - Add new pet profile
  • GET /api/pet/<id>/recent-history - Pet health history

AI Analysis

  • POST /api/check_symptoms - Symptom analysis
  • POST /api/upload_image - Photo analysis
  • POST /api/get_diagnosis_explanation - Detailed diagnosis info

TTS Integration

  • POST /api/tts_generate - Generate speech from text
  • GET /api/tts_status - Check TTS service status

Health Management

  • GET /api/get_health_history - User's health records
  • GET /api/get_reminders - User's health reminders
  • POST /api/add_reminder - Create new health reminder

๐Ÿงช Testing

Manual Testing

  1. User Registration: Test signup and login flows
  2. Pet Management: Add, edit, and view pet profiles
  3. AI Features: Test symptom checker and photo analysis
  4. TTS Integration: Verify audio playback functionality

API Testing

# Test TTS endpoint
curl -X POST http://localhost:5000/api/tts_generate \
  -H "Content-Type: application/json" \
  -d '{"text":"Test message"}'

# Test symptom checker
curl -X POST http://localhost:5000/api/check_symptoms \
  -H "Content-Type: application/json" \
  -d '{"pet_id":1,"symptoms":"lethargy, loss of appetite"}'

๐Ÿš€ Deployment

Local Development

python main.py

Production Deployment

  1. Set Environment Variables:

    export FLASK_ENV=production
    export DATABASE_URL=postgresql://user:pass@localhost/vettrack
  2. Use Production Server:

    pip install gunicorn
    gunicorn -w 4 -b 0.0.0.0:5000 main:app
  3. Reverse Proxy (Nginx):

    server {
        listen 80;
        server_name yourdomain.com;
        
        location / {
            proxy_pass http://127.0.0.1:5000;
            proxy_set_header Host $host;
            proxy_set_header X-Real-IP $remote_addr;
        }
    }

๐Ÿค 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

Development Guidelines

  • Follow PEP 8 Python style guidelines
  • Add comprehensive docstrings for new functions
  • Include error handling for all API endpoints
  • Test new features thoroughly before submitting

๐Ÿ“ License

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

๐Ÿ™ Acknowledgments

  • Google Gemini AI for advanced natural language processing
  • Murf AI for high-quality text-to-speech capabilities
  • Bootstrap for responsive UI components
  • Flask community for the excellent web framework

๐Ÿ“ž Support

  • Issues: Report bugs and feature requests via GitHub Issues
  • Documentation: Check this README and inline code comments
  • Community: Join discussions in GitHub Discussions

๐Ÿ”ฎ Future Enhancements

  • Mobile App: Native iOS/Android applications
  • Machine Learning: Enhanced diagnosis accuracy with custom models
  • Telemedicine: Direct integration with veterinary services
  • Health Monitoring: IoT device integration for continuous monitoring
  • Multi-language Support: Internationalization for global users
  • Advanced Analytics: Health trend analysis and predictive insights

VetTrack AI - Empowering pet owners with AI-driven health insights ๐Ÿพโœจ

Built with โค๏ธ for the pet care community

About

A comprehensive Flask-based web application that combines artificial intelligence with veterinary care management, featuring AI-powered symptom analysis, photo diagnosis, and intelligent health tracking for pets

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published