Medic is a React Native (Expo) mobile app for managing personal healthcare tasks. It includes an onboarding flow, a multi-tab dashboard, and a server-side OCR feature for extracting text from images and PDFs without client-side processing.
- Onboarding screen with quick value props
- Tabbed UI for Home, Appointments, Records, and Profile
- OCR upload flow in Records
- Server-side OCR using open-source tools (Tesseract + pdf-parse)
- No file persistence (temporary processing only)
- Expo + React Native
- Node.js API (Vercel-compatible)
- Tesseract.js for image OCR
- pdf-parse for text-based PDFs
App.tsx- Main app UI and screensapi/ocr.js- Serverless OCR endpoint (Vercel)server.js- Local dev server for/api/ocrassets/- App assets
Install dependencies:
npm installCreate a .env file:
EXPO_PUBLIC_OCR_ENDPOINT=http://localhost:3000/api/ocrFor production, set:
EXPO_PUBLIC_OCR_ENDPOINT=https://your-vercel-app.vercel.app/api/ocrStart Expo:
npm startThis starts a simple Node server that exposes /api/ocr:
npm run serverEndpoint: POST /api/ocr
Body: JSON
{
"filename": "report.pdf",
"mimeType": "application/pdf",
"dataBase64": "<base64 string>"
}Response:
{
"text": "extracted text ...",
"provider": "tesseract | pdf-parse",
"pages": 1
}- OCR runs on the server; the client never processes text.
- Files are not persisted; processing is temporary.
pdf-parseonly extracts text from text-based PDFs.- Scanned PDFs require image conversion (not yet implemented).
- With no auth, the OCR endpoint is public.
Deploy the repo to Vercel. The OCR API is available at:
/api/ocr
Then update EXPO_PUBLIC_OCR_ENDPOINT in .env.
If you want, I can:
- Add basic auth or signed tokens for
/api/ocr - Support scanned PDFs by converting pages to images before OCR
- Add structured parsing for lab results and dates
- Persist OCR output securely in a database