PetCheck is a comprehensive Progressive Web Application (PWA) that provides veterinarians, pet owners, and researchers with instant access to FDA animal drug safety data, adverse event reports, recall information, and drug interaction checking.
- Drug Search: Search and explore FDA-approved animal drugs with detailed information
- Adverse Event Reports: View real-world safety data from the FDA's adverse event database
- Recall Alerts: Stay informed about animal drug and product recalls
- Pet Profiles: Manage multiple pet profiles with medication tracking
- Interaction Checker: Check for potential drug interactions for your pets
- Veterinarian Finder: Locate nearby veterinary clinics using Google Places API
- Clinical Decision Support: Access comprehensive drug safety information at the point of care
- Adverse Event Trends: Analyze safety trends across different species and drugs
- Drug Interaction Database: Check multi-drug interactions for complex cases
- Patient Management: Track medications for multiple patients with interaction alerts
- Data Analytics: Explore FDA adverse event data with filtering and visualization
- Trend Analysis: Analyze safety trends over time with interactive charts
- Export Capabilities: Download filtered datasets for further analysis
- Green Book Integration: Access the complete FDA Green Book animal drug database
- Offline Support: Core functionality available without internet connection
- Install to Home Screen: Native app-like experience on mobile and desktop
- Push Notifications: Optional alerts for new recalls and safety updates
- Responsive Design: Optimized for mobile, tablet, and desktop devices
- Fast Performance: Service worker caching for instant page loads
- React 18 - Modern UI library with hooks and concurrent features
- TypeScript - Type-safe development
- Vite - Lightning-fast build tool and dev server
- TanStack Query - Powerful async state management and caching
- React Router - Client-side routing
- Tailwind CSS - Utility-first CSS framework
- Vite PWA Plugin - Progressive Web App capabilities with Workbox
- Node.js - JavaScript runtime
- Express - Fast, unopinionated web framework
- TypeScript - Type-safe API development
- Redis - In-memory data store for caching and sessions
- JWT - Secure authentication tokens
- Helmet - Security headers middleware
- Winston - Logging framework
- OpenFDA API - Adverse events, recalls, and Green Book data
- Google OAuth 2.0 - User authentication
- Google Places API - Veterinarian location services
- npm Workspaces - Monorepo management
- ESLint - Code quality and consistency
- Prettier - Code formatting
- Concurrently - Run multiple dev servers
Before you begin, ensure you have the following installed:
- Node.js >= 18.0.0 (Download)
- npm >= 9.0.0 (comes with Node.js)
- Redis >= 6.0 (Installation Guide)
-
Google OAuth Credentials (for user authentication)
- Create a project at Google Cloud Console
- Enable Google+ API
- Create OAuth 2.0 credentials
- Add authorized redirect URIs
-
Google Places API Key (for vet finder feature)
- Enable Places API in Google Cloud Console
- Create an API key with Places API enabled
-
OpenFDA API Key (optional but recommended)
- Request at openFDA
- Increases rate limits from 40 to 240 requests/minute
git clone https://github.com/yourusername/petcheck.git
cd petchecknpm installThis will install dependencies for all packages in the monorepo.
Create a .env file in packages/backend/:
cp packages/backend/.env.example packages/backend/.envEdit packages/backend/.env with your configuration (see Environment Variables section).
# macOS with Homebrew
brew services start redis
# Linux
sudo systemctl start redis
# Windows (with Redis installed)
redis-servernpm run devThis will start:
- Backend API server at
http://localhost:3001 - Frontend dev server at
http://localhost:5173
npm run buildBuilt files will be in:
- Backend:
packages/backend/dist/ - Frontend:
packages/frontend/dist/
petcheck/
├── packages/
│ ├── backend/ # Express API server
│ │ ├── src/
│ │ │ ├── config/ # Configuration and env variables
│ │ │ ├── middleware/ # Express middleware (auth, rate limit, etc.)
│ │ │ ├── routes/ # API route handlers
│ │ │ ├── services/ # Business logic and external API clients
│ │ │ │ ├── auth/ # Google OAuth authentication
│ │ │ │ ├── openfda/ # FDA API integration
│ │ │ │ ├── interactions/ # Drug interaction engine
│ │ │ │ ├── pets/ # Pet profile management
│ │ │ │ └── places/ # Google Places integration
│ │ │ └── index.ts # Server entry point
│ │ ├── package.json
│ │ └── tsconfig.json
│ │
│ ├── frontend/ # React PWA
│ │ ├── public/ # Static assets and PWA manifest
│ │ ├── src/
│ │ │ ├── components/ # Reusable UI components
│ │ │ │ ├── ui/ # Base UI components
│ │ │ │ ├── common/ # Shared business components
│ │ │ │ ├── layout/ # Layout components
│ │ │ │ └── charts/ # Data visualization
│ │ │ ├── pages/ # Route pages/views
│ │ │ ├── contexts/ # React contexts (Auth, etc.)
│ │ │ ├── hooks/ # Custom React hooks
│ │ │ ├── lib/ # Utilities and API client
│ │ │ ├── types/ # TypeScript type definitions
│ │ │ ├── App.tsx # Root component
│ │ │ └── main.tsx # Application entry point
│ │ ├── package.json
│ │ └── vite.config.ts # Vite configuration
│ │
│ └── shared/ # Shared types and utilities
│ ├── src/
│ │ ├── types/ # Shared TypeScript types
│ │ └── utils/ # Shared utility functions
│ └── package.json
│
├── .eslintrc.js # ESLint configuration
├── .prettierrc # Prettier configuration
├── .gitignore # Git ignore patterns
├── package.json # Root package.json (workspaces)
└── README.md # This file
Create a .env file in packages/backend/ with the following variables:
| Variable | Description | Required | Default |
|---|---|---|---|
PORT |
Backend server port | No | 3001 |
NODE_ENV |
Environment (development or production) |
No | development |
REDIS_HOST |
Redis server hostname | No | localhost |
REDIS_PORT |
Redis server port | No | 6379 |
REDIS_PASSWORD |
Redis password (if required) | No | - |
REDIS_DB |
Redis database number | No | 0 |
JWT_SECRET |
Secret key for JWT signing | Yes | - |
JWT_EXPIRES_IN |
JWT expiration time | No | 7d |
GOOGLE_CLIENT_ID |
Google OAuth client ID | Yes | - |
GOOGLE_CLIENT_SECRET |
Google OAuth client secret | Yes | - |
GOOGLE_PLACES_API_KEY |
Google Places API key | Yes | - |
OPENFDA_API_KEY |
OpenFDA API key | No | - |
FRONTEND_URL |
Frontend application URL | No | http://localhost:5173 |
CORS_ORIGINS |
Comma-separated allowed CORS origins | No | http://localhost:5173 |
LOG_LEVEL |
Logging level (debug, info, warn, error) |
No | info |
POST /api/auth/google- Google OAuth authenticationGET /api/auth/me- Get current user profilePOST /api/auth/logout- Logout user
GET /api/drugs/search?q={query}&species={species}- Search animal drugsGET /api/drugs/:nada- Get drug details by NADA numberGET /api/drugs/green-book- Get full Green Book database
GET /api/adverse-events/search?drug={name}&species={species}- Search adverse eventsGET /api/adverse-events/stats?drug={name}- Get event statisticsGET /api/adverse-events/trends?drug={name}&timeframe={period}- Get trend data
GET /api/recalls/search?q={query}&species={species}- Search recallsGET /api/recalls/recent?limit={n}- Get recent recallsGET /api/recalls/:id- Get recall details
POST /api/interactions/check- Check drug interactions- Body:
{ drugs: string[], species?: string }
- Body:
GET /api/pets- Get user's pets (auth required)POST /api/pets- Create pet profile (auth required)GET /api/pets/:id- Get pet details (auth required)PUT /api/pets/:id- Update pet profile (auth required)DELETE /api/pets/:id- Delete pet profile (auth required)
GET /api/vets/search?lat={lat}&lng={lng}&radius={meters}- Find nearby vets
GET /api/health- API health checkGET /api/health/ready- Readiness probeGET /api/health/live- Liveness probe
- Helmet.js - Sets secure HTTP headers
- CORS - Configured cross-origin resource sharing
- Rate Limiting - API rate limiting to prevent abuse
- JWT Authentication - Secure token-based authentication
- Input Validation - Express-validator for request validation
- Redis Sessions - Secure session management
- HTTPS Enforcement - Recommended for production
- Content Security Policy - Prevents XSS attacks
- Compression - Gzip compression for responses
- Never commit
.envfiles to version control - Use strong, unique
JWT_SECRETin production - Enable HTTPS in production environments
- Regularly rotate API keys and secrets
- Keep dependencies updated for security patches
- Monitor Redis and apply security configurations
- Implement proper error handling (no sensitive data in errors)
This application uses data from the U.S. Food and Drug Administration (FDA) through the openFDA API:
- Adverse Event Reports: CVM (Center for Veterinary Medicine) adverse event database
- Product Recalls: Animal drug and product recall data
- Green Book: FDA-approved animal drug products database
Attribution: "This product uses publicly available data from the U.S. Food and Drug Administration (FDA), but it is not endorsed or certified by the FDA."
OpenFDA Terms: https://open.fda.gov/terms/
- Google OAuth 2.0: User authentication
- Google Places API: Veterinary clinic location data
The data provided through this application is for informational purposes only and should not replace professional veterinary advice. Always consult with a licensed veterinarian before making decisions about your pet's healthcare.
-
Not Medical Advice: PetCheck is an informational tool and does not provide veterinary medical advice. Always consult a licensed veterinarian.
-
Data Accuracy: While we strive for accuracy, FDA data may be incomplete or delayed. Adverse event reports are voluntary and may not establish a causal relationship.
-
Interaction Checker: The drug interaction checker is based on available data and may not cover all possible interactions. Consult a veterinarian for comprehensive interaction analysis.
-
API Rate Limits:
- Without OpenFDA API key: 40 requests/minute, 1,000/day
- With OpenFDA API key: 240 requests/minute, 120,000/day
-
Offline Limitations: PWA offline mode provides cached data only. Real-time updates require internet connectivity.
-
Geographic Limitations: Veterinarian finder is limited to areas covered by Google Places API.
Users can install PetCheck as a standalone app:
- Desktop: Click the install button in the address bar
- Mobile: Tap "Add to Home Screen" in the browser menu
- Cached drug database for offline searches
- Saved pet profiles accessible offline
- Previously viewed drug details available offline
- Background sync for pending actions
The application uses Workbox-powered service workers for:
- Smart caching strategies
- Background data synchronization
- Push notification support
- Automatic updates
- Standalone display mode
- Custom theme colors
- App icons (192x192, 512x512)
- Orientation preferences
- Categorization as health/medical app
# Run all tests
npm test
# Run tests in watch mode (backend)
npm run test:watch -w @petcheck/backend
# Run tests for specific package
npm test -w @petcheck/frontend# Lint all packages
npm run lint
# Format code with Prettier
npm run format# Build all packages
npm run build
# Build specific package
npm run build:backend
npm run build:frontend
npm run build:sharednpm run cleanWe welcome contributions from the community! Please see our Contributing Guidelines for details on:
- Code of conduct
- Development workflow
- Pull request process
- Coding standards
- Testing requirements
- Fork the repository
- Create a feature branch (
git checkout -b feature/amazing-feature) - Make your changes
- Run tests and linting (
npm test && npm run lint) - Commit your changes (
git commit -m 'Add amazing feature') - Push to the branch (
git push origin feature/amazing-feature) - Open a Pull Request
This project is licensed under the MIT License - see the LICENSE file for details.
- FDA/CVM - For providing open access to animal drug safety data
- OpenFDA Team - For maintaining excellent API documentation
- React Team - For the amazing React framework
- Vite Team - For the blazing-fast build tool
- All Contributors - Thank you for your contributions!
- Issues: GitHub Issues
- Discussions: GitHub Discussions
- Email: [email protected]
- OpenAPI/Swagger documentation
- Email notifications for recalls
- Export to PDF (pet medication records)
- Multi-language support
- Veterinary prescription integration
- Compounding pharmacy directory
- Clinical trial database integration
- Mobile native apps (React Native)
Disclaimer: This application is not affiliated with, endorsed by, or sponsored by the U.S. Food and Drug Administration (FDA). The information provided is for educational and informational purposes only.
Made with care for pets and their owners.