Your intelligent companion for medication management, drug interactions, and medical guidance
- Check potential interactions between multiple medications
- Real-time database queries with 50,000+ drug interactions
- Color-coded severity levels (Major, Moderate, Minor)
- Beautiful, intuitive interface
- QR code and barcode scanning
- Automatic expiry date tracking
- Google Calendar integration for reminders
- Camera-based detection
- Powered by GROQ AI
- Instant medical guidance
- Chat history stored in Firebase
- Natural language processing
- Medicine expiry overview
- Risk assessment charts
- Usage statistics
- Modern, responsive design
- Frontend: Next.js 16, React 19, TailwindCSS
- Backend: Next.js API Routes
- Database: MongoDB Atlas, Firebase Firestore
- AI: GROQ API
- Scanner: @zxing/browser
- Charts: Chart.js, React-Chartjs-2
- Calendar: Google Calendar API
- Node.js 18+ and npm
- MongoDB Atlas account
- Firebase project
- GROQ API key
- Google Calendar API credentials (optional)
git clone <your-repo-url>
cd smartpillappnpm installCreate .env.local file in the root directory:
# GROQ API
GROQ_API_KEY=your_groq_api_key_here
# Firebase Admin
FIREBASE_PROJECT_ID=your_firebase_project_id
FIREBASE_CLIENT_EMAIL=your_firebase_client_email
FIREBASE_PRIVATE_KEY="-----BEGIN PRIVATE KEY-----\n...\n-----END PRIVATE KEY-----\n"
# MongoDB Atlas
MONGODB_URI=mongodb+srv://username:password@cluster.mongodb.net/
DB_NAME=smartpilladvisor
# Google Calendar (Optional)
GOOGLE_SERVICE_ACCOUNT_EMAIL=your_service_account_email
GOOGLE_PRIVATE_KEY="-----BEGIN PRIVATE KEY-----\n...\n-----END PRIVATE KEY-----\n"
GOOGLE_CALENDAR_ID=your_calendar_id@group.calendar.google.comUpload CSV files to MongoDB Atlas using MongoDB Compass:
- Connect to your MongoDB Atlas cluster
- Create database:
smartpilladvisor - Create collection:
interactions - Import all 8 CSV files from
ddinterpy/folder
npm run devsmartpillapp/
βββ app/
β βββ api/ # API routes
β β βββ chat/ # AI chatbot endpoint
β β βββ interactions/ # Drug interaction checker
β β βββ medicines/ # Medicine scanner
β βββ chat/ # Chat page
β βββ interactions/ # Interactions page
β βββ scan/ # Scanner page
β βββ layout.tsx # Root layout
β βββ page.tsx # Dashboard
βββ lib/
β βββ firebaseAdmin.ts # Firebase admin config
β βββ mongodb.ts # MongoDB connection
βββ ddinterpy/ # Drug interaction CSV files
βββ scripts/ # Import scripts
βββ public/ # Static assets
- Full-width responsive layout
- Purple gradient theme throughout
- Modern card-based UI
- Smooth animations and transitions
- Color-coded severity indicators
- Mobile-first design
- Environment variables for sensitive data
- Firebase service account keys excluded from git
- MongoDB connection strings secured
- API keys protected
- Navigate to
/interactions - Add medicine names
- Click "Check Interactions"
- View results with severity levels
- Navigate to
/scan - Allow camera access
- Scan QR code or barcode
- Fill in details and save
- Navigate to
/chat - Ask medical questions
- Get instant AI-powered responses
npm run build
vercel deployAdd all .env.local variables to your deployment platform
- Fork the repository
- Create feature branch (
git checkout -b feature/AmazingFeature) - Commit changes (
git commit -m 'Add AmazingFeature') - Push to branch (
git push origin feature/AmazingFeature) - Open Pull Request
This project is licensed under the MIT License.
- Your Name - Initial work
- GROQ for AI capabilities
- MongoDB Atlas for database
- Firebase for backend services
- Next.js team for the framework
Made with β€οΈ for better medication management