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.
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.
- 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
- 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
- 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
- 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
- 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
- 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
- Google Gemini AI: Advanced symptom analysis and diagnosis
- Murf TTS API: High-quality text-to-speech for accessibility
- Jitsi Meet: Video consultation platform integration
- Bootstrap 5.3.0: Responsive CSS framework
- Font Awesome 6.0.0: Icon library
- Vanilla JavaScript: Modern ES6+ features
- HTML5: Semantic markup
- Flask-Login: User session management
- Password Hashing: Secure credential storage
- Session Management: Secure user authentication
- Python 3.11 or higher
- pip package manager
- Modern web browser (Chrome, Firefox, Safari, Edge)
- Internet connection for AI APIs
git clone https://github.com/yourusername/vettrack-ai.git
cd vettrack-aipython -m venv venv
# Windows
venv\Scripts\activate
# macOS/Linux
source venv/bin/activatepip install -r requirements.txtCreate 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_herepython main.pyThe database will be automatically created on first run.
python main.pyThe application will be available at http://127.0.0.1:5000
# 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- Sign Up: Create a new account with your email and password
- Add Pets: Register your pets with species, breed, age, and medical notes
- Access Dashboard: View your pets' health overview and quick actions
- Select a pet from your profile
- Describe symptoms in detail (or use quick-select checkboxes)
- Receive AI-powered analysis with:
- Preliminary diagnosis
- Urgency level assessment
- Treatment recommendations
- Possible causes
- Audio playback of results
- Upload a clear photo of the health concern
- Add optional description for context
- Get AI visual analysis including:
- Condition likelihood
- Severity assessment
- Urgency classification
- Professional recommendations
- Track History: Monitor symptoms, treatments, and outcomes
- Set Reminders: Schedule vaccinations, medications, and checkups
- Export Reports: Generate consultation summaries for veterinarians
- Visit Google AI Studio
- Create a new API key
- Add to your
.envfile asGOOGLE_API_KEY
- Sign up at Murf AI
- Generate your API key
- Add to your
.envfile asMURF_API_KEY
- Default: SQLite database in
instance/pet_health.db - Production: Set
DATABASE_URLin.envfor PostgreSQL/MySQL - Backup: Database files are automatically created and managed
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
- 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
POST /signup- User registrationPOST /login- User authenticationGET /logout- User logout
GET /api/get_pets- Retrieve user's petsPOST /api/add_pet- Add new pet profileGET /api/pet/<id>/recent-history- Pet health history
POST /api/check_symptoms- Symptom analysisPOST /api/upload_image- Photo analysisPOST /api/get_diagnosis_explanation- Detailed diagnosis info
POST /api/tts_generate- Generate speech from textGET /api/tts_status- Check TTS service status
GET /api/get_health_history- User's health recordsGET /api/get_reminders- User's health remindersPOST /api/add_reminder- Create new health reminder
- User Registration: Test signup and login flows
- Pet Management: Add, edit, and view pet profiles
- AI Features: Test symptom checker and photo analysis
- TTS Integration: Verify audio playback functionality
# 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"}'python main.py-
Set Environment Variables:
export FLASK_ENV=production export DATABASE_URL=postgresql://user:pass@localhost/vettrack
-
Use Production Server:
pip install gunicorn gunicorn -w 4 -b 0.0.0.0:5000 main:app
-
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; } }
- 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
- 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
This project is licensed under the MIT License - see the LICENSE file for details.
- 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
- Issues: Report bugs and feature requests via GitHub Issues
- Documentation: Check this README and inline code comments
- Community: Join discussions in GitHub Discussions
- 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