Enterprise-grade HIPAA-compliant healthcare platform with enterprise security, database integration, and comprehensive testing. Combines Google Gemini AI with machine learning for intelligent medical risk assessment.
π Try it now: ai-health-screening.vercel.app
- JWT Authentication - Role-based access control (RBAC)
- Multi-Factor Authentication - TOTP-based 2FA implementation
- Data Encryption - AES-256 field-level encryption
- HIPAA Compliance - Full audit logging and privacy controls
- API Security - Rate limiting, input validation, threat detection
- Real-time Monitoring - Security event tracking and alerting
- PostgreSQL/Supabase - Production-grade cloud database
- SQLAlchemy ORM - Async database operations
- Data Models - Patient records, assessments, audit logs
- Relationship Management - Foreign keys and data integrity
- Migration Support - Schema versioning and updates
- Backup & Recovery - Automated data protection
- Medical-grade interface designed for healthcare workflows
- Comprehensive form validation with real-time feedback
- Professional assessment reports with clinical reasoning
- Mobile-responsive design for all devices
- Accessibility compliant (WCAG 2.1 standards)
- Google Gemini Pro - Advanced medical reasoning and clinical analysis
- Scikit-learn ML - Risk scoring algorithms with demographic factors
- Hybrid Intelligence - Combines modern LLMs with traditional ML
- FastAPI Backend - High-performance async API
- Microservices Design - Modular, scalable architecture
- CI/CD Pipeline with comprehensive testing
- Production error handling and graceful fallbacks
- Python 3.13 - Modern backend language
- FastAPI - High-performance async web framework
- SQLAlchemy - Advanced ORM with async support
- PostgreSQL - Production database (Supabase)
- JWT + MFA - Enterprise authentication
- AES-256 Encryption - Data protection at rest
- HIPAA Compliance - Healthcare security standards
- Google Gemini AI - Advanced medical AI analysis
- Scikit-learn - Machine learning risk assessment
- Pandas & NumPy - Data processing and analysis
- ML Model Versioning - Production model management
- Next.js 15 - React framework with TypeScript
- Mantine UI - Professional component library
- Real-time validation - Form validation with error handling
- Responsive design - Mobile-first approach
- GitHub Actions - CI/CD automation
- Comprehensive Testing - 41+ tests across security & database
- Environment management - Secure configuration
- Production monitoring - Health checks and alerting
- β Role-Based Access Control - Admin, Healthcare Provider, Patient, Auditor roles
- β Multi-Factor Authentication - TOTP-based 2FA
- β Data Encryption - AES-256 encryption for sensitive data
- β Audit Logging - Comprehensive HIPAA-compliant activity tracking
- β API Security - Rate limiting, input validation, threat detection
- β Security Monitoring - Real-time threat detection and response
- β Patient Records - Comprehensive medical history tracking
- β Assessment History - Complete evaluation timeline
- β ML Model Versioning - Production model management
- β Audit Trail - Full data access logging
- β Data Relationships - Referential integrity
- β Backup & Recovery - Automated data protection
- β Symptom Analysis - Advanced parsing of medical descriptions
- β Risk Stratification - ML-powered risk scoring (0-100 scale)
- β Clinical Reasoning - AI-generated medical explanations
- β Emergency Detection - Automated urgency classification
- β Demographic Factors - Age, gender, and history consideration
- β Healthcare-grade UI - Professional medical design patterns
- β Form Validation - Real-time input validation and feedback
- β Assessment Reports - Clinical-grade result presentation
- β Mobile Responsive - Works on all device sizes
- β Accessibility - WCAG 2.1 compliant interface
- Authentication & Authorization tests
- Data encryption & privacy tests
- HIPAA compliance validation
- Input validation & sanitization
- Rate limiting & API security
- Security monitoring & threat detection
- Model structure validation
- CRUD operations testing
- Relationship integrity
- Audit logging verification
- Security compliance
- Data classification
- Backend: 90%+ test coverage
- Security: 100% critical path coverage
- Database: 100% model coverage
- API Endpoints: Comprehensive integration tests
# Required software
Python 3.13+
Node.js 18+
PostgreSQL (or Supabase account)# Clone and setup backend
git clone https://github.com/yourusername/ai-health-screening.git
cd ai-health-screening
# Create virtual environment
python -m venv venv
source venv/bin/activate # On Windows: venv\Scripts\activate
# Install dependencies
pip install -r requirements.txt
# Setup environment variables
cp .env.example .env
# Edit .env with your API keys and database URL
# Initialize database
python -c "from database.database import init_db; import asyncio; asyncio.run(init_db())"
# Run backend
uvicorn main:app --reload --host 0.0.0.0 --port 8000# Setup frontend
cd frontend
npm install
# Setup environment variables
cp .env.local.example .env.local
# Edit with your backend URL
# Run frontend
npm run dev# Security tests
python -m pytest tests/security/ -v
# Database tests
python -m pytest tests/test_database.py -v
# All tests
python -m pytest -v- Administrative Safeguards: Role-based access controls, security training documentation
- Physical Safeguards: Application-level security controls and data protection
- Technical Safeguards: Access control, audit controls, integrity protection, transmission security
βββββββββββββββββββ ββββββββββββββββββββ βββββββββββββββββββ
β Frontend UI β β Security β β Database β
β β β Middleware β β β
β β’ Input Valid. βββββΆβ β’ Authentication βββββΆβ β’ Encrypted β
β β’ Rate Limiting β β β’ Authorization β β β’ Audit Logs β
β β’ CSRF Protect. β β β’ Rate Limiting β β β’ Relationships β
βββββββββββββββββββ ββββββββββββββββββββ βββββββββββββββββββ
- Encryption: AES-256 for sensitive data, RSA-2048 for key exchange
- Anonymization: Automatic PII detection and anonymization
- Audit Trail: Complete access logging for compliance
- Data Retention: Configurable retention policies (7 years default)
ai-health-screening/
βββ π security/ # Enterprise security modules
β βββ auth.py # JWT, RBAC, MFA
β βββ privacy.py # Encryption, HIPAA compliance
β βββ api_security.py # Input validation, rate limiting
β βββ middleware.py # FastAPI security middleware
β βββ routes.py # Secure API endpoints
β
βββ ποΈ database/ # Database layer
β βββ database.py # Async database connection
β βββ models.py # SQLAlchemy models
β βββ migrations/ # Database migrations
β
βββ π§ ml_services/ # Machine learning
β βββ health_ml_service.py # Risk assessment models
β
βββ π§ services/ # Business logic
β βββ ai_health_service.py # AI integration service
β
βββ π§ͺ tests/ # Comprehensive testing
β βββ security/ # Security test suite (27 tests)
β βββ test_database.py # Database tests (14 tests)
β
βββ π¨ frontend/ # Next.js frontend
β βββ src/app/ # App router
β βββ src/components/ # React components
β βββ src/lib/ # Frontend utilities
β
βββ π api/ # Serverless API endpoints
βββ π docs/ # Documentation
βββ π§ .github/workflows/ # CI/CD pipelines
βββ π monitoring/ # Health checks & metrics
GET /health- System health checkPOST /assess-health- Health assessment (rate limited)
POST /auth/login- User login with JWTPOST /auth/logout- Session terminationPOST /auth/mfa/verify- Multi-factor authenticationPOST /auth/refresh- Token refresh
GET /assessment/history- User's assessment historyPOST /assessment/submit- Submit new assessmentGET /admin/users- User management (admin only)GET /audit/logs- Audit trail access (auditor role)
GET /health- Application health statusGET /metrics- Performance metricsGET /security/status- Security monitoring
# Database
DATABASE_URL=postgresql://user:pass@host:5432/db
# AI Services
GEMINI_API_KEY=your_gemini_api_key
# Security
JWT_SECRET_KEY=your_super_secure_secret_key
JWT_ALGORITHM=HS256
JWT_EXPIRATION_HOURS=24
# API Security
RATE_LIMIT_REQUESTS_PER_MINUTE=100
API_KEY_EXPIRATION_DAYS=30
# HIPAA Compliance
AUDIT_LOG_RETENTION_DAYS=2555 # 7 years
ENCRYPTION_KEY=your_encryption_key# Production database settings
DATABASE_SETTINGS = {
"pool_size": 20,
"max_overflow": 0,
"pool_pre_ping": True,
"pool_recycle": 300,
"echo": False # Set True for SQL debugging
}# Database migration
alembic upgrade head
# Security check
python -m pytest tests/security/ -v
# Deploy to production
git push origin main # Triggers CI/CD pipeline# Build container
docker build -t ai-health-screening .
# Run with environment
docker run -d \
-p 8000:8000 \
-e DATABASE_URL=$DATABASE_URL \
-e GEMINI_API_KEY=$GEMINI_API_KEY \
--name health-app \
ai-health-screening- Response Time: <200ms for health assessments
- Throughput: 1000+ requests/minute with rate limiting
- Uptime: 99.9% availability target
- Security: Real-time threat monitoring
- Health Checks: Automated endpoint monitoring
- Security Alerts: Real-time threat detection
- Performance Metrics: Request timing and throughput
- Audit Logging: Complete compliance tracking
- Fork the repository
- Create feature branch:
git checkout -b feature/amazing-feature - Run tests:
python -m pytest -v - Commit changes:
git commit -m 'Add amazing feature' - Push to branch:
git push origin feature/amazing-feature - Open Pull Request
- All new features must include tests
- Security tests must pass:
pytest tests/security/ - Database tests must pass:
pytest tests/test_database.py - Code coverage must remain above 90%
This project is licensed under the MIT License - see the LICENSE file for details.
- β Phase 8: Professional Healthcare UI
- β Phase 9: Database Integration & Data Management
- β Phase 10: Enterprise Security & HIPAA Compliance
- β 41+ Tests: Comprehensive testing suite
- β Security: 27/27 tests passing
- β Database: 14/14 tests passing
- β 90%+ Coverage: High code coverage standards
- β HIPAA Compliant: Healthcare security standards
- β Enterprise Security: JWT, MFA, encryption, audit logging
- β Scalable Database: PostgreSQL with async operations
- β Professional UI: Healthcare-grade interface design
Built with β€οΈ for healthcare innovation