LabInsight AI-Powered Lab Report Analysis Platform
A full-stack healthcare web application that uses artificial intelligence to analyze lab reports, provide personalized health insights, and connect patients with doctors for professional medical guidance.
- Overview
- Features
- Technology Stack
- Architecture
- Installation
- Configuration
- Running the Application
- API Documentation
- User Roles & Flows
- Project Structure
- Team Members
- Screenshots
- License
LabInsight AI is a comprehensive healthcare platform designed to:
- Allow users to upload lab reports (PDF/images) and receive AI-generated analysis
- Provide an intelligent chatbot powered by RAG (Retrieval Augmented Generation) for health queries
- Connect patients with doctors for professional medical consultation
- Enable doctors to manage patients, view reports, and add professional comments
- Give administrators full control over users, doctors, and system reports
- Secure Authentication - Email/password login with Google OAuth 2.0
- Report Upload - Upload lab reports (PDF, JPEG, PNG) with 10MB limit
- AI Analysis - Get instant AI-generated insights including:
- Overall health summary
- Key findings & recommendations
- Severity assessment (low/medium/high)
- Individual test interpretations
- AI Chat Assistant - Ask health questions and get context-aware answers based on your reports
- Trends Visualization - Track health metrics over time with charts
- Doctor Connection - Send requests to connect with available doctors
- Profile Management - Manage personal and medical information
- Patient Management - View all connected patients
- Report Review - Access patient lab reports and AI analysis
- Professional Comments - Add medical comments and recommendations
- Connection Requests - Accept or reject patient connection requests
- Dashboard - Overview of patients, pending requests, and recent activity
- User Management - View, edit, suspend, or delete user accounts
- Doctor Management - Create and manage doctor accounts
- Report Oversight - View all reports across the platform
- System Dashboard - Statistics and analytics overview
| Technology | Purpose |
|---|---|
| React 18 | UI Framework |
| TypeScript | Type Safety |
| Vite | Build Tool |
| Tailwind CSS | Styling |
| Radix UI / shadcn | Component Library |
| React Router DOM | Routing |
| Recharts | Data Visualization |
| React Markdown | Markdown Rendering |
| Firebase Auth | Google OAuth 2.0 |
| Lucide React | Icons |
| Technology | Purpose |
|---|---|
| Node.js | Runtime Environment |
| Express.js | Web Framework |
| MongoDB | Database |
| Mongoose | ODM |
| JWT | Authentication Tokens |
| bcrypt | Password Hashing |
| Multer | File Upload |
| Swagger UI | API Documentation |
| CORS | Cross-Origin Requests |
| Technology | Purpose |
|---|---|
| Flask | Microservice Framework |
| Groq API | LLM (Llama 3.3 70B) |
| SentenceTransformers | Text Embeddings |
| LangChain | PDF Processing |
| PyMongo | MongoDB Connection |
| NumPy | Vector Operations |
┌─────────────────────────────────────────────────────────────────┐
│ CLIENT (Browser) │
│ React + TypeScript + Vite │
└─────────────────────────────┬───────────────────────────────────┘
│
▼
┌─────────────────────────────────────────────────────────────────┐
│ BACKEND (Node.js + Express) │
│ Port: 5000 │
│ ┌──────────┐ ┌──────────┐ ┌──────────┐ ┌──────────────────┐ │
│ │ Auth │ │ Upload │ │ Admin │ │ Doctor │ │
│ │ Routes │ │ Routes │ │ Routes │ │ Routes │ │
│ └──────────┘ └──────────┘ └──────────┘ └──────────────────┘ │
│ │ │
│ Swagger UI (/api-docs) │
└─────────────────────────────┬───────────────────────────────────┘
│
┌───────────────┼───────────────┐
▼ ▼ ▼
┌─────────────────┐ ┌───────────────┐ ┌─────────────────────────┐
│ MongoDB │ │ File Storage │ │ AI Service (Python) │
│ (Database) │ │ (uploads/) │ │ Port: 5001 │
│ │ │ │ │ ┌───────────────────┐ │
│ - Users │ │ - PDFs │ │ │ Groq LLM API │ │
│ - Profiles │ │ - Images │ │ │ (Llama 3.3 70B) │ │
│ - Reports │ │ │ │ └───────────────────┘ │
│ - Doctors │ │ │ │ ┌───────────────────┐ │
│ - Requests │ │ │ │ │ Embeddings │ │
│ │ │ │ │ │ (RAG System) │ │
└─────────────────┘ └───────────────┘ │ └───────────────────┘ │
└─────────────────────────┘
- Node.js v18+ (Download)
- Python 3.9+ (Download)
- MongoDB (Local or MongoDB Atlas)
- Git (Download)
git clone https://github.com/your-username/labinsight-ai.git
cd labinsight-ai# From project root
npm installcd Backend-Node
npm install
cd ..cd AI-Service
pip install -r requirements.txt
cd ..Create Backend-Node/.env:
# MongoDB Connection
MONGODB_URI=mongodb://localhost:27017/LabInsight
# JWT Configuration
JWT_SECRET=your-super-secret-jwt-key-change-this
JWT_EXPIRES_IN=7d
# Server Port
PORT=5000
# AI Service URL
AI_SERVICE_URL=http://localhost:5001Create AI-Service/.env:
# Groq API Key (Get from https://console.groq.com/)
GROQ_API_KEY=your-groq-api-key
# MongoDB Connection
MONGO_URI=mongodb://localhost:27017/LabInsightThe Firebase configuration is already set up in src/components/firebase.ts. If you want to use your own Firebase project:
- Go to Firebase Console
- Create a new project
- Enable Google Authentication
- Update the config in
firebase.ts
Open 3 terminal windows:
Terminal 1 - Frontend:
npm run devFrontend runs at: http://localhost:5173
Terminal 2 - Backend:
cd Backend-Node
node server.jsBackend runs at: http://localhost:5000
Terminal 3 - AI Service:
cd AI-Service
python ai_service.pyAI Service runs at: http://localhost:5001
You can set up a script to run all services together. Add to root package.json:
{
"scripts": {
"dev": "vite",
"backend": "cd Backend-Node && node server.js",
"ai": "cd AI-Service && python ai_service.py"
}
}Once the backend is running, access the interactive API documentation at:
http://localhost:5000/api-docs
| Method | Endpoint | Description |
|---|---|---|
| POST | /auth/signup |
Register new user |
| POST | /auth/login |
User login |
| POST | /auth/doctor-login |
Doctor login |
| POST | /auth/change-password |
Change password |
| Method | Endpoint | Description |
|---|---|---|
| GET | /profile/:email |
Get user profile |
| PUT | /profile/:email |
Update profile |
| POST | /upload-report |
Upload lab report |
| GET | /reports?email= |
Get user's reports |
| GET | /report/:id |
Get single report |
| DELETE | /delete-report/:id |
Delete report |
| Method | Endpoint | Description |
|---|---|---|
| GET | /doctors |
List all doctors |
| POST | /send-request |
Send connection request |
| GET | /doctor/patients/:email |
Get doctor's patients |
| PUT | /doctor/request/update/:id |
Accept/reject request |
| POST | /doctor/add-comment |
Add comment to report |
| Method | Endpoint | Description |
|---|---|---|
| GET | /admin/users |
Get all users |
| PUT | /admin/users/:email/status |
Update user status |
| DELETE | /admin/users/:email |
Delete user |
| POST | /admin/create-doctor |
Create doctor account |
| Method | Endpoint | Description |
|---|---|---|
| POST | /analyze |
Analyze PDF report |
| GET | /chat/latest-report?email= |
Get latest report info |
| POST | /chat/ask |
Ask AI a question |
Sign Up → Login → Upload Report → View AI Analysis → Chat with AI
Login → Browse Doctors → Send Request → (Doctor Accepts) → View Assigned Doctor
Login → View Dashboard → Check Requests → Accept/Reject → View Patients → Add Comments
Login → Dashboard → Manage Users → Manage Doctors → View Reports
Final_Web/
├── 📂 AI-Service/ # Python AI Microservice
│ ├── ai_service.py # Main Flask application
│ ├── requirements.txt # Python dependencies
│ ├── Embeddings/ # Generated embeddings (.pkl)
│ └── .env.example
│
├── 📂 Backend-Node/ # Node.js Backend
│ ├── server.js # Express entry point
│ ├── swagger.js # Swagger configuration
│ ├── config/
│ │ └── db.js # MongoDB connection
│ ├── middleware/
│ │ └── auth.js # JWT middleware
│ ├── models/ # Mongoose schemas
│ │ ├── User.js
│ │ ├── Profile.js
│ │ ├── Report.js
│ │ ├── DoctorProfile.js
│ │ ├── AssignedDoctor.js
│ │ └── ConnectionRequest.js
│ ├── routes/ # API routes
│ │ ├── auth.js
│ │ ├── profile.js
│ │ ├── upload.js
│ │ ├── admin.js
│ │ ├── doctorRoutes.js
│ │ └── ...
│ └── uploads/ # Uploaded files
│
├── 📂 src/ # React Frontend
│ ├── App.tsx # Main app with routes
│ ├── main.tsx # Entry point
│ ├── index.css # Global styles
│ ├── components/
│ │ ├── admin/ # Admin components
│ │ ├── doctor/ # Doctor components
│ │ ├── ui/ # Shared UI components
│ │ ├── Home.tsx
│ │ ├── SignIn.tsx
│ │ ├── Profile.tsx
│ │ ├── Chat.tsx
│ │ ├── ViewReports.tsx
│ │ └── ...
│ └── styles/
│
├── 📄 package.json # Frontend dependencies
├── 📄 vite.config.ts # Vite configuration
├── 📄 index.html # HTML entry point
├── 📄 README.md # This file
├── 📄 TEAM_WORKFLOW.md # Team collaboration guide
└── 📄 .gitignore
| Name | Role | Responsibilities |
|---|---|---|
| Anushika Balamurugan | Frontend - User Module | User authentication, dashboard, reports UI |
| Venkata Sriya Kamarsu | Frontend - Admin/Doctor | Admin panel, doctor portal |
| Akshay Madavalappil Ramesh | Backend Developer | Node.js APIs, database, authentication |
| Amrin Bushra Taj | AI & Documentation | AI service, chatbot, documentation |
- Password Hashing - bcrypt with salt rounds
- JWT Authentication - Secure token-based auth
- Role-Based Access Control - Admin, Doctor, User roles
- File Validation - Type and size restrictions
- Protected Routes - Middleware-based authorization
- Google OAuth 2.0 - Secure social login
This project is created for educational purposes as part of INFO 6150 - Fall 2025.
- Groq for LLM API
- Firebase for Authentication
- shadcn/ui for UI Components
- Tailwind CSS for Styling
This application is for educational purposes only. The AI-generated health insights should not replace professional medical advice. Always consult with healthcare providers for medical decisions.




