An AI-powered platform for analyzing blood test reports using advanced machine learning and natural language processing.
- 🤖 AI-Powered Analysis: Advanced OpenAI GPT-4 analysis of blood test results
- 📊 Comprehensive Reports: Detailed health insights and recommendations
- 🔐 Secure Authentication: JWT-based user authentication system
- 📱 Responsive Design: Works seamlessly on desktop and mobile devices
- 🔑 User-Controlled API Keys: Users provide their own OpenAI API keys for security
- 📄 Multiple File Formats: Supports PDF, JPG, and PNG uploads
- 💾 Report History: Track and manage your health reports over time
- 🎯 Personalized Insights: Tailored recommendations based on your results
- Node.js 18+ and npm
- MongoDB database
- OpenAI API key (users provide their own)
-
Clone the repository:
git clone https://github.com/yourusername/medscan-ai.git cd medscan-ai -
Install dependencies:
npm run install:all
-
Set up environment variables:
# Backend cp backend/.env.example backend/.env # Edit backend/.env with your MongoDB URI and JWT secret # Frontend cp frontend/.env.example frontend/.env # Edit frontend/.env if needed
-
Start development servers:
npm run dev
-
Access the application:
- Frontend: http://localhost:5173
- Backend API: http://localhost:5000
This application is optimized for Vercel deployment with both frontend and backend.
-
Push to GitHub: Ensure your code is in a GitHub repository
-
Deploy via Vercel Dashboard:
- Go to vercel.com
- Import your GitHub repository
- Configure build settings (see DEPLOYMENT.md)
- Add environment variables
- Deploy
-
Deploy via CLI:
npm install -g vercel npm run deploy
For detailed deployment instructions, see DEPLOYMENT.md.
medscan-ai/
├── frontend/ # React frontend application
│ ├── src/
│ │ ├── components/ # Reusable UI components
│ │ ├── pages/ # Page components
│ │ ├── contexts/ # React contexts
│ │ ├── services/ # API services
│ │ └── styles/ # CSS styles
│ ├── public/ # Static assets
│ └── package.json
├── backend/ # Node.js backend API
│ ├── src/
│ │ ├── controllers/ # Route controllers
│ │ ├── models/ # Database models
│ │ ├── routes/ # API routes
│ │ ├── services/ # Business logic
│ │ ├── middleware/ # Express middleware
│ │ ├── ai/ # AI processing services
│ │ └── config/ # Configuration files
│ ├── uploads/ # File upload directory
│ └── package.json
├── vercel.json # Vercel deployment config
├── DEPLOYMENT.md # Detailed deployment guide
└── README.md
- React 18 - Modern React with hooks
- Vite - Fast build tool and dev server
- Tailwind CSS - Utility-first CSS framework
- React Router - Client-side routing
- Axios - HTTP client for API calls
- Node.js - JavaScript runtime
- Express.js - Web application framework
- MongoDB - NoSQL database
- Mongoose - MongoDB object modeling
- JWT - JSON Web Token authentication
- Multer - File upload handling
- Tesseract.js - OCR text extraction
- OpenAI GPT-4 - Advanced language model for analysis
- PDF Parse - PDF text extraction
- Image OCR - Text extraction from images
- Vercel - Serverless deployment platform
- MongoDB Atlas - Cloud database hosting
MONGODB_URI=mongodb+srv://username:password@cluster.mongodb.net/medscan-ai
JWT_SECRET=your-super-secret-jwt-key-here
NODE_ENV=production
FRONTEND_URL=https://your-app-name.vercel.app
MAX_FILE_SIZE=10485760VITE_API_URL=http://localhost:5000/api # For development only
VITE_APP_NAME=Medscan AI- JWT Authentication: Secure user sessions
- API Key Management: Users control their own OpenAI API keys
- File Validation: Strict file type and size validation
- CORS Protection: Configured for secure cross-origin requests
- Input Sanitization: Protection against injection attacks
- Rate Limiting: API rate limiting for abuse prevention
POST /api/auth/register- User registrationPOST /api/auth/login- User loginGET /api/auth/me- Get current user
POST /api/blood-test/upload- Upload blood test fileGET /api/blood-test/reports- Get user's reportsGET /api/blood-test/reports/:id- Get specific reportGET /api/blood-test/reports/:id/analysis- Get analysis resultsGET /api/blood-test/dashboard- Get dashboard statistics
GET /api/health- API health status
# Backend tests
cd backend && npm test
# Frontend tests
cd frontend && npm test- Register a new account
- Configure OpenAI API key
- Upload a blood test report (PDF/JPG/PNG)
- Wait for AI analysis completion
- Review generated insights and recommendations
Made with ❤️ by the Medscan AI Team