Skip to content

ishika24755/SwasthyaAI

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Medic

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.

Features

  • 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)

Tech Stack

  • Expo + React Native
  • Node.js API (Vercel-compatible)
  • Tesseract.js for image OCR
  • pdf-parse for text-based PDFs

Project Structure

  • App.tsx - Main app UI and screens
  • api/ocr.js - Serverless OCR endpoint (Vercel)
  • server.js - Local dev server for /api/ocr
  • assets/ - App assets

Setup

Install dependencies:

npm install

Environment Variables

Create a .env file:

EXPO_PUBLIC_OCR_ENDPOINT=http://localhost:3000/api/ocr

For production, set:

EXPO_PUBLIC_OCR_ENDPOINT=https://your-vercel-app.vercel.app/api/ocr

Run the App

Start Expo:

npm start

Run the OCR API Locally

This starts a simple Node server that exposes /api/ocr:

npm run server

OCR API

Endpoint: POST /api/ocr
Body: JSON

{
  "filename": "report.pdf",
  "mimeType": "application/pdf",
  "dataBase64": "<base64 string>"
}

Response:

{
  "text": "extracted text ...",
  "provider": "tesseract | pdf-parse",
  "pages": 1
}

Notes and Limitations

  • OCR runs on the server; the client never processes text.
  • Files are not persisted; processing is temporary.
  • pdf-parse only extracts text from text-based PDFs.
  • Scanned PDFs require image conversion (not yet implemented).
  • With no auth, the OCR endpoint is public.

Deployment (Vercel)

Deploy the repo to Vercel. The OCR API is available at:

/api/ocr

Then update EXPO_PUBLIC_OCR_ENDPOINT in .env.

Next Steps

If you want, I can:

  1. Add basic auth or signed tokens for /api/ocr
  2. Support scanned PDFs by converting pages to images before OCR
  3. Add structured parsing for lab results and dates
  4. Persist OCR output securely in a database

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors