D.O.C is an intelligent medication companion that helps patients manage their medications safely through AI-powered drug identification, age verification, dosage confirmation, and comprehensive health documentation.
- 40% of medication errors are age-related
- 7,000+ annual deaths from preventable medication mistakes
- Patients don't know if their medications are safe for their age
- No centralized system to track medications, documents, and doctor communications
- Terminal illness patients lack access to latest drug research
D.O.C provides 7 intelligent features:
- Camera Drug Scanner - Identify drugs via photo, get instant descriptions
- Side Effects Checker - Comprehensive side effect database
- Age Verification - AI validates drug safety for patient's age
- Dosage Confirmation - Verify prescribed dosage accuracy
- Medical Triage - Store documents, prescriptions, doctor contacts
- Research Updates - Latest drug news for cancer/terminal illnesses
- Patient Logging - Voice/text notes sent directly to doctors
Unique Feature: Handles multiple medications simultaneously
- Framework: React 18 + Vite
- Styling: Tailwind CSS
- State Management: Context API + React Query
- Routing: React Router v6
- HTTP Client: Axios
- Camera: react-webcam
- Voice Recording: react-media-recorder
- Framework: FastAPI (Python 3.11+)
- Database: Supabase (PostgreSQL)
- Authentication: JWT tokens
- File Storage: Supabase Storage
- API Documentation: Swagger/OpenAPI
- OCR: Tesseract, Google Cloud Vision API
- NLP: Claude API (Anthropic), OpenAI Whisper
- Drug Data: OpenFDA, RxNorm, DrugBank
- Research: PubMed API, ClinicalTrials.gov API
Node.js 18+ Python 3.11+ Git Tesseract OCR
Quick Start
- git clone https://github.com/Contractor-x/D.O.C/tree/Collins
- cd D.O.C
- cd frontend
- npm install
- cp .env.example .env
- npm run dev
- Backend Setup
- cd backend
- python -m venv venv
- source venv/bin/activate
- pip install -r requirements.txt
- cp .env.example .env
- uvicorn app.main:app --reload
- cd ai-services
- pip install -r requirements.txt
- cp .env.example .env
- VITE_API_BASE_URL=http://localhost:8000/api/v1
- VITE_SUPABASE_URL=your_supabase_url
- VITE_SUPABASE_ANON_KEY=your_supabase_key
- DATABASE_URL=postgresql://user:pass@localhost:5432/doc
- SUPABASE_URL=your_supabase_url
- SUPABASE_KEY=your_supabase_key
- SECRET_KEY=your_jwt_secret_key
- CLAUDE_API_KEY=your_claude_api_key
- OPENAI_API_KEY=your_openai_key
- GOOGLE_CLOUD_VISION_KEY=your_google_vision_key
- OPENFDA_API_KEY=not_required
- RXNORM_API_KEY=not_required
- PUBMED_API_KEY=your_pubmed_key
- CLAUDE_API_KEY=your_claude_api_key
- OPENAI_API_KEY=your_openai_key
Authentication POST /api/v1/auth/register POST /api/v1/auth/login POST /api/v1/auth/refresh GET /api/v1/auth/me Camera & Drug Identification POST /api/v1/camera/scan GET /api/v1/drugs/{drug_id} POST /api/v1/drugs/identify POST /api/v1/drugs/batch-scan Side Effects GET /api/v1/side-effects/{drug_id} GET /api/v1/side-effects/interactions POST /api/v1/side-effects/report Age Verification POST /api/v1/age-verification/check GET /api/v1/age-verification/beers-criteria POST /api/v1/age-verification/batch-check Dosage Confirmation POST /api/v1/dosage/verify POST /api/v1/dosage/calculate GET /api/v1/dosage/guidelines/{drug_id} Medical Triage POST /api/v1/triage/documents/upload GET /api/v1/triage/documents DELETE /api/v1/triage/documents/{id} POST /api/v1/triage/doctors GET /api/v1/triage/doctors PUT /api/v1/triage/doctors/{id} Research Updates GET /api/v1/research/latest GET /api/v1/research/by-illness/{illness} POST /api/v1/research/bookmark GET /api/v1/research/bookmarks Patient Logging POST /api/v1/logs/text POST /api/v1/logs/voice GET /api/v1/logs POST /api/v1/logs/send-to-doctor GET /api/v1/logs/analytics
User Journey Login → Dashboard → Camera Scanner → Results → Side Effects → Age Verification → Dosage Check → Save to Triage → Log Experience Page Descriptions
- Camera Scanner Live camera feed Capture multiple drugs at once OCR processing indicator Drug identification results Brief description for each drug
- Side Effects List all identified drugs Expandable side effect cards Severity indicators (mild/moderate/severe) Interaction warnings Filter by severity
- Age Verification Input patient age AI analyzes each drug for age-appropriateness Risk score (0-10) Recommendations Alternative suggestions
- Dosage Confirmation Display prescribed dosage Compare with recommended dosage Show acceptable range Flag over/under dosing Doctor's prescription view
- Medical Triage Upload medical documents (PDF, images) Document categorization (prescriptions, lab results, etc.) Doctor contact management Emergency contacts Quick access to recent documents
- Research Updates Filter by illness type Latest clinical trials New drug approvals Research summaries Bookmark articles Share with doctor
- Patient Logging Text entry for notes Voice recording option Categorize logs (side effects, mood, pain level) Timeline view Send specific logs to doctor AI analysis of patterns
- OCR Drug Identification Technology: Tesseract + Google Cloud Vision Accuracy: 92%+ Process: Image preprocessing (grayscale, denoise, contrast) Text extraction Drug name matching with fuzzy logic NDC barcode detection
- Age Risk Detection Algorithm: Custom ML + Beers Criteria Input: Drug name, dosage, patient age Output: Risk score (0-10), recommendations Rules: 40+ Beers Criteria drugs for elderly (65+) Pediatric contraindications (<18) Weight-based dosing for children Renal function adjustments
- Side Effect Prediction Data Source: OpenFDA Adverse Events Model: Classification + NLP Features: Common vs rare side effects Severity classification Drug-drug interactions Food-drug interactions
- Dosage Validation Algorithm: Rule-based + ML Checks: Age-appropriate dosing Weight-based calculations (mg/kg) Renal dose adjustments Maximum daily limits Frequency validation
- Voice Transcription Technology: OpenAI Whisper API Languages: 90+ supported Features: Real-time transcription Medical terminology recognition Speaker diarization Sentiment analysis
- Research Aggregation Sources: PubMed, ClinicalTrials.gov, FDA Algorithm: NLP + Content Ranking Features: Relevance scoring Publication date weighting Clinical trial phase filtering Automatic summarization
- AI Explanations Technology: Claude API (Anthropic) Purpose: Patient-friendly explanations Reading Level: 8th grade Languages: English, Spanish (expandable)
Tables users id, email, password_hash, age, created_at medications id, user_id, drug_name, dosage, ndc_code, identified_at side_effects id, drug_id, effect_name, severity, frequency age_checks id, user_id, medication_id, age, risk_score, safe, checked_at dosage_checks id, medication_id, prescribed_dose, recommended_dose, within_range documents id, user_id, file_url, document_type, uploaded_at doctor_contacts id, user_id, doctor_name, specialty, phone, email research_articles id, title, summary, illness_type, publication_date, source_url patient_logs id, user_id, log_type, content, voice_url, sent_to_doctor, created_at
- Run Tests
cd frontend
- npm test
cd backend
- pytest
- cd ai-services
- pytest
Frontend (Vercel)
- cd frontend
- vercel deploy --prod Backend (Railway/Render)
- cd backend
Push to GitHub Connect repo to hosting platform. Auto-deploy on push
- Frontend: https://doc-app.vercel.app
- Backend API: https://doc-api.railway.app
- Documentation: https://doc-api.railway.app/docs
Frontend Developer - React UI/UX Implementation
Backend Developer - FastAPI + Database Architecture
AI Developer - ML Models + NLP + OCR Services
MIT License - See LICENSE file
OpenFDA for drug data Anthropic for Claude API Beers Criteria for geriatric medication guidelines
📞 Support For issues: GitHub Issues For questions: [email protected] Built for safer medication management
