A comprehensive web application for analyzing and managing health laboratory reports with OCR capabilities, family profile management, and data visualization.
π Live Demo: https://health-lab-report-analyzer.vercel.app
π API Docs: https://health-lab-report-analyzer.onrender.com/docs
Features β’ Live Demo β’ Installation β’ API Documentation β’ Contributing
- Live Demo
- Features
- Technology Stack
- Project Structure
- Installation
- Usage
- API Documentation
- Deployment
- Testing
- Contributing
- License
URL: https://health-lab-report-analyzer.vercel.app
Experience the full HLRA application with:
- User registration and authentication
- Family profile management
- Health report upload and OCR processing
- Data visualization and trends
- Report sharing capabilities
URL: https://health-lab-report-analyzer.onrender.com
Interactive Docs: https://health-lab-report-analyzer.onrender.com/docs
Explore the complete API documentation with:
- All available endpoints
- Request/response schemas
- Interactive testing interface
- Authentication examples
- Visit: https://health-lab-report-analyzer.vercel.app
- Register a new account or login
- Create a family profile
- Upload a sample health report (PDF/image)
- View the processed data and insights
Note: The backend may take a few seconds to wake up on first request (Render free tier)
- π Document Processing: Upload and analyze PDF, JPG, PNG health reports using OCR
- π₯ Family Profile Management: Create and manage multiple family member profiles
- π Data Visualization: Interactive charts and trends for health metrics
- π Report Sharing: Secure sharing of health reports with customizable access
- π Notifications: Real-time notifications for report updates and sharing
- π Dark/Light Mode: Toggle between dark and light themes
- π± Responsive Design: Mobile-friendly interface
- π JWT Authentication: Secure user authentication and authorization
- π File Upload: Drag-and-drop file upload with progress tracking
- π OCR Integration: Extract text from medical documents using Tesseract
- πΎ MongoDB Integration: Robust data storage and retrieval
- β‘ Real-time Updates: Live data synchronization
- π― Type Safety: Full TypeScript implementation
- π§ͺ Comprehensive Testing: Unit and integration tests
- Framework: FastAPI 0.104+
- Language: Python 3.11+
- Database: MongoDB with Motor (async driver)
- Authentication: JWT with python-jose
- OCR: Tesseract with pytesseract
- PDF Processing: PyPDF2, pdfplumber, pdf2image
- Testing: pytest, pytest-asyncio
- Framework: React 19+ with TypeScript
- Build Tool: Vite
- Styling: Tailwind CSS
- UI Components: Radix UI
- State Management: TanStack Query, React Context
- Form Handling: React Hook Form with Zod validation
- Charts: Recharts
- Testing: Vitest, React Testing Library
- Backend Hosting: Render
- Frontend Hosting: Vercel
- Containerization: Docker
- CI/CD: GitHub Actions (optional)
Health-Lab-Report-Analyzer/
βββ HLRA-backend/ # FastAPI Backend
β βββ app/
β β βββ api/v1/ # API endpoints
β β βββ core/ # Core configurations
β β βββ database/ # Database connection
β β βββ models/ # Pydantic models
β β βββ schemas/ # Request/Response schemas
β β βββ services/ # Business logic
β β βββ utils/ # Utility functions
β βββ tests/ # Backend tests
β βββ uploads/ # File upload directory
β βββ requirements.txt # Python dependencies
β βββ Dockerfile # Container configuration
β βββ render.yaml # Render deployment config
βββ HLRA-frontend/ # React Frontend
β βββ src/
β β βββ components/ # React components
β β βββ pages/ # Page components
β β βββ contexts/ # React contexts
β β βββ hooks/ # Custom hooks
β β βββ services/ # API services
β β βββ types/ # TypeScript types
β β βββ utils/ # Utility functions
β βββ public/ # Static assets
β βββ package.json # Node dependencies
β βββ vercel.json # Vercel deployment config
β βββ vite.config.ts # Vite configuration
βββ DEPLOYMENT.md # Deployment guide
βββ README.md # This file
- Python 3.11+
- Node.js 18+
- MongoDB (local or Atlas)
- Tesseract OCR (for document processing)
-
Clone the repository
git clone https://github.com/nikkvijay/Health-Lab-Report-Analyzer.git cd Health-Lab-Report-Analyzer/HLRA-backend -
Create virtual environment
python -m venv venv source venv/bin/activate # On Windows: venv\Scripts\activate
-
Install dependencies
pip install -r requirements.txt
-
Set up environment variables
cp .env.example .env # Edit .env with your configuration -
Install Tesseract OCR
- Ubuntu/Debian:
sudo apt-get install tesseract-ocr - macOS:
brew install tesseract - Windows: Download from GitHub releases
- Ubuntu/Debian:
-
Run the backend
python main.py
-
Navigate to frontend directory
cd ../HLRA-frontend -
Install dependencies
npm install
-
Set up environment variables
cp .env.example .env # Edit .env with your backend URL -
Run the frontend
npm run dev
- Frontend: https://health-lab-report-analyzer.vercel.app
- Backend API: https://health-lab-report-analyzer.onrender.com
- API Documentation: https://health-lab-report-analyzer.onrender.com/docs
- Frontend: http://localhost:5173
- Backend API: http://localhost:8000
- API Documentation: http://localhost:8000/docs
- Register/Login: Create an account or login with existing credentials
- Create Family Profiles: Add family members for organized health tracking
- Upload Reports: Drag and drop health reports (PDF, JPG, PNG)
- View Analysis: Review extracted data and health metrics
- Share Reports: Generate shareable links for specific reports
- Track Trends: Monitor health metrics over time with interactive charts
- Supported formats: PDF, JPG, JPEG, PNG
- Maximum file size: 10MB
- Best practices:
- Ensure clear, high-resolution images
- PDF files should have readable text or clear scanned images
- Avoid blurry or low-contrast documents
- Create separate profiles for each family member
- Assign reports to specific profiles
- View consolidated health data per profile
- Share profile-specific reports
POST /api/v1/auth/register # User registration
POST /api/v1/auth/login # User login
POST /api/v1/auth/refresh # Refresh access token
POST /api/v1/upload/file # Upload health report
GET /api/v1/upload/files # List user files
GET /api/v1/upload/file/{id} # Get specific file
GET /api/v1/family-profiles # List profiles
POST /api/v1/family-profiles # Create profile
PUT /api/v1/family-profiles/{id} # Update profile
DELETE /api/v1/family-profiles/{id} # Delete profile
POST /api/v1/extraction/process # Process uploaded file
GET /api/v1/extraction/results # Get extraction results
POST /api/v1/shared-reports # Create shareable link
GET /api/v1/shared-reports/{id} # Access shared report
For complete API documentation, visit /docs endpoint when running the backend.
Frontend (Vercel): https://health-lab-report-analyzer.vercel.app
Backend (Render): https://health-lab-report-analyzer.onrender.com
API Documentation: https://health-lab-report-analyzer.onrender.com/docs
- β Push code to GitHub
- β Create new Web Service on Render
- β
Connect repository, select
HLRA-backenddirectory - β Set environment variables
- β Deploy successful
Current Status: Live at https://health-lab-report-analyzer.onrender.com
- β Create new project on Vercel
- β
Import repository, select
HLRA-frontenddirectory - β
Set
VITE_API_BASE_URLenvironment variable - β Deploy successful
Current Status: Live at https://health-lab-report-analyzer.vercel.app
- Backend CORS: Updated to allow frontend domain
- Frontend API URL: Points to Render backend
- Database: MongoDB Atlas integration active
For detailed deployment instructions, see DEPLOYMENT.md.
cd HLRA-backend
pytest tests/ -v --cov=appcd HLRA-frontend
npm test
npm run test:ui # UI mode
npm run test:coverage- Unit Tests: Individual component/function testing
- Integration Tests: API endpoint testing
- E2E Tests: Full application flow testing (planned)
- Async/await: Non-blocking operations
- Connection pooling: Efficient database connections
- File streaming: Memory-efficient file handling
- Caching: Redis integration (planned)
- Code splitting: Lazy loading of components
- Image optimization: WebP format support
- Bundle optimization: Tree shaking and minification
- Caching strategies: Service worker integration (planned)
- JWT Authentication: Secure token-based auth
- Password hashing: bcrypt implementation
- CORS configuration: Restricted origins
- File validation: Type and size restrictions
- SQL injection prevention: Parameterized queries
- XSS protection: Content sanitization
- CSRF protection: Token validation
- Secure storage: httpOnly cookies for tokens
- Input validation: Zod schema validation
We welcome contributions! Please see our Contributing Guidelines.
- Fork the repository
- Create feature branch (
git checkout -b feature/amazing-feature) - Commit changes (
git commit -m 'Add amazing feature') - Push to branch (
git push origin feature/amazing-feature) - Open Pull Request
- Backend: Follow PEP 8, use black formatter
- Frontend: ESLint + Prettier configuration
- Commits: Conventional commit messages
- Documentation: Update relevant docs with changes
This project is licensed under the MIT License - see the LICENSE file for details.
- FastAPI - Modern, fast web framework for APIs
- React - User interface library
- Tesseract OCR - Open source OCR engine
- MongoDB - Document database
- Tailwind CSS - Utility-first CSS framework
- Radix UI - Low-level UI primitives
- Documentation: Check the docs in
/docsfolders - Issues: GitHub Issues
- Discussions: GitHub Discussions