AI-Powered Healthcare Platform — A luxurious, glassmorphic web application that predicts medicine side effects and allergies, suggests safer alternatives, and provides personalized healthcare via explainable AI and an interactive RAG-powered chatbot.
NeoCure combines cutting-edge AI technology with a beautiful, modern UI to revolutionize how patients and healthcare providers manage medication safety and allergy risks.
- 🔐 Role-Based Authentication — Patient, Doctor, and Admin dashboards with JWT-based security
- 🧬 Personalized Onboarding — Collect genetic, environmental, and medical background data
- 📄 Medical Records Management — Secure upload with AI-powered text extraction and parsing
- 🤖 AI Allergy Detection — Explainable AI predicts allergy risks (Red/Amber/Green) with detailed reasoning
- 💊 Safer Medicine Alternatives — AI-powered suggestions with side-by-side comparisons
- 🩺 Symptom-Based Detection — Check symptoms for possible allergies with confidence scores
- 💬 RAG-Powered Chatbot — Contextual medical assistant with access to your complete medical history
- ⏰ Medicine Reminders — Smart notifications with email/push support
- 📊 Admin Analytics — System-wide insights and user management
- 🎨 Glassmorphic UI — Modern, responsive design with Tailwind CSS
- Framework: React 18 + TypeScript + Vite
- Styling: Tailwind CSS (Glassmorphism)
- Icons: Lucide React
- State: React Context API
- Location:
/(root directory)
- Runtime: Node.js 20+
- Framework: Express.js + TypeScript
- Database: PostgreSQL 16 + Prisma ORM
- Authentication: JWT + bcrypt
- AI/ML: OpenAI GPT-4 + LangChain + Pinecone/ChromaDB
- File Storage: Cloudinary / AWS S3
- API Docs: Swagger (OpenAPI 3.0)
- Testing: Jest + Supertest
- Location:
/backend
- Node.js 20+ and npm
- Docker and Docker Compose (recommended)
- PostgreSQL 16 (if running without Docker)
# Clone the repository
git clone <repository-url>
cd neocure
# Start backend services (PostgreSQL + API + pgAdmin)
cd backend
docker-compose up --build
# In a new terminal, start frontend
cd ..
npm install
npm run devServices:
- Frontend:
http://localhost:5173 - Backend API:
http://localhost:4000 - API Docs:
http://localhost:4000/api/docs - pgAdmin:
http://localhost:5050(admin@neocure.local / admin)
cd backend
# Install dependencies
npm install
# Configure environment
cp .env.example .env
# Edit .env with your credentials (DATABASE_URL, JWT_SECRET, API keys)
# Generate Prisma client
npm run prisma:generate
# Run database migrations
npm run prisma:migrate
# Seed database with sample data
npm run seed
# Start development server
npm run dev# From project root
npm install
npm run dev| Role | Password | |
|---|---|---|
| Patient | patient@neocure.com | patient123 |
| Doctor | doctor@neocure.com | doctor123 |
| Admin | admin@neocure.com | admin123 |
POST /api/auth/register— Register new userPOST /api/auth/login— Login and receive JWTPOST /api/auth/logout— LogoutPOST /api/auth/refresh— Refresh access token
GET /api/records— List user's recordsPOST /api/records— Upload new recordGET /api/records/:id— Get specific record
POST /api/ai/allergy-detection— Predict allergy riskPOST /api/ai/medicine-alternatives— Get safer alternativesPOST /api/ai/symptom-check— Symptom-based allergy detectionGET /api/ai/explain/:id— Get AI explanation
POST /api/chat— Chat with RAG-powered AI assistant
GET /api/reminders— List remindersPOST /api/reminders— Create reminderPUT /api/reminders/:id— Update reminderDELETE /api/reminders/:id— Delete reminder
GET /api/cures/:allergyType— Get treatment planPOST /api/cures/:allergyType— Create/update cure (Doctor/Admin)
GET /api/admin/users— List all usersGET /api/admin/analytics— System analytics
Full API Documentation: http://localhost:4000/api/docs
cd backend
npm test
# With coverage
npm test -- --coveragenpm test- Helmet.js — Security headers
- CORS — Configurable cross-origin policies
- Rate Limiting — 300 requests per 15 minutes
- HPP — HTTP Parameter Pollution protection
- JWT Authentication — Stateless, role-based access control
- bcrypt — Password hashing (10 rounds)
- Input Validation — Zod/Joi schemas
- SQL Injection Protection — Prisma ORM with parameterized queries
The backend includes placeholder stubs for AI services with mock responses. This allows the full application to run and be tested without API keys.
-
Set Environment Variables:
OPENAI_API_KEY=your-openai-key PINECONE_API_KEY=your-pinecone-key CLOUDINARY_CLOUD_NAME=your-cloudinary-name CLOUDINARY_API_KEY=your-cloudinary-key CLOUDINARY_API_SECRET=your-cloudinary-secret
-
Implement Services:
backend/src/services/ai.ts— OpenAI GPT-4 integrationbackend/src/services/ragPipeline.ts— LangChain + Pinecone RAGbackend/src/services/upload.ts— Cloudinary/S3 + OCR
-
RAG Pipeline:
- Chunk and embed medical records
- Store vectors in Pinecone
- Retrieve context during chat queries
- Generate explainable responses
Key models (see backend/prisma/schema.prisma):
- User — Authentication and roles
- UserProfile — Genetic, environmental data
- MedicalRecord — Uploaded records with extracted text
- AllergyRisk — AI predictions with explanations
- AlternativeMedicine — Safer alternatives database
- Cure — Treatment plans per allergy type
- Reminder — Medicine reminders
- ChatLog — Conversation history for RAG
# Backend
cd backend
docker build -t neocure-backend .
docker run -p 4000:4000 --env-file .env neocure-backend
# Frontend
docker build -t neocure-frontend .
docker run -p 80:80 neocure-frontendEnsure these are set securely:
NODE_ENV=productionJWT_SECRET— Strong random secret (32+ chars)DATABASE_URL— Production PostgreSQL connectionOPENAI_API_KEY,PINECONE_API_KEY— AI service credentialsCLOUDINARY_*orAWS_*— File storage credentials
neocure/
├── backend/ # Node.js + Express + TypeScript backend
│ ├── src/
│ │ ├── controllers/ # Request handlers
│ │ ├── routes/ # API routes
│ │ ├── services/ # Business logic (AI, RAG, uploads)
│ │ ├── middleware/ # Auth, validation
│ │ ├── server/ # Express app setup
│ │ └── __tests__/ # Jest tests
│ ├── prisma/
│ │ ├── schema.prisma # Database schema
│ │ └── seed.ts # Seed script
│ ├── Dockerfile
│ ├── docker-compose.yml
│ └── README.md
├── src/ # React frontend
│ ├── components/ # UI components
│ ├── context/ # React context
│ └── types.ts # TypeScript types
├── index.html
├── package.json
└── README.md # This file
This is a private project. For questions or contributions, contact the development team.
Proprietary — NeoCure: Healing Safely
- Modern Stack: React 18, TypeScript, Node.js 20, PostgreSQL 16
- Type Safety: Full TypeScript coverage (frontend + backend)
- API-First: RESTful API with Swagger documentation
- Containerized: Docker + Docker Compose for easy deployment
- Scalable: Modular architecture with clear separation of concerns
- Secure: Industry-standard security practices (JWT, bcrypt, Helmet, CORS)
- Testable: Jest + Supertest for backend, ready for frontend tests
- AI-Ready: Placeholder stubs for seamless AI integration
Just Integrated! The Python drug-interaction-checker module is now fully integrated into the backend:
- ✅ Automatic Safety Checking — New prescriptions checked against active medications
- ✅ FDA Data + RAG + LLM — Uses openFDA API with RAG pipeline and LLM analysis
- ✅ AI Explanations — Natural language interaction analysis with clinical recommendations
- ✅ Severity Levels — NONE, MILD, MODERATE, SEVERE, CRITICAL classifications
- ✅ Safer Alternatives — Suggests alternative medications when interactions detected
- ✅ Comprehensive Logging — All checks logged with response times and audit trail
# 1. Migrate database
cd backend
npm run prisma:migrate
# 2. Seed sample data
npm run seed
# 3. Setup Python module
cd ../drug-interaction-checker/drug-interaction-checker
pip install -r requirements.txt
# 4. Test the integration
curl -X POST http://localhost:4000/api/drug-interactions/check \
-H "Authorization: Bearer YOUR_TOKEN" \
-d '{"drugs":["Warfarin","Aspirin"]}'- 📘 Quick Start:
DRUG_INTERACTION_QUICKSTART.md— 5-minute setup - 📗 Integration Guide:
backend/DRUG_INTERACTION_INTEGRATION.md— Complete API reference - 📙 Migration Guide:
backend/MIGRATION_GUIDE.md— Database migration steps - 📕 Summary:
INTEGRATION_SUMMARY.md— Overview and architecture
{
"interactionDetected": true,
"severity": "SEVERE",
"description": "Combining Warfarin with Aspirin may increase bleeding risk...",
"saferAlternatives": ["Acetaminophen"],
"aiExplanation": "**Drug Interaction Analysis**\n\n**Medications Involved**: Warfarin, Aspirin\n\n**Severity Level**: SEVERE..."
}Built with ❤️ for safer, smarter healthcare.
