Skip to content

Yugenjr/SmartPillAdvisor

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

19 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

πŸ₯ Smart Pill Advisory System

Your intelligent companion for medication management, drug interactions, and medical guidance

Next.js React TypeScript TailwindCSS

✨ Features

πŸ’Š Drug Interaction Checker

  • 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

πŸ“± Medicine Scanner

  • QR code and barcode scanning
  • Automatic expiry date tracking
  • Google Calendar integration for reminders
  • Camera-based detection

πŸ€– AI Medical Assistant

  • Powered by GROQ AI
  • Instant medical guidance
  • Chat history stored in Firebase
  • Natural language processing

πŸ“Š Dashboard & Analytics

  • Medicine expiry overview
  • Risk assessment charts
  • Usage statistics
  • Modern, responsive design

πŸš€ Tech Stack

  • 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

πŸ“‹ Prerequisites

  • Node.js 18+ and npm
  • MongoDB Atlas account
  • Firebase project
  • GROQ API key
  • Google Calendar API credentials (optional)

πŸ› οΈ Installation

1. Clone the Repository

git clone <your-repo-url>
cd smartpillapp

2. Install Dependencies

npm install

3. Environment Setup

Create .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.com

4. Import Drug Interaction Data

Upload CSV files to MongoDB Atlas using MongoDB Compass:

  1. Connect to your MongoDB Atlas cluster
  2. Create database: smartpilladvisor
  3. Create collection: interactions
  4. Import all 8 CSV files from ddinterpy/ folder

5. Run Development Server

npm run dev

Open http://localhost:3000

πŸ“ Project Structure

smartpillapp/
β”œβ”€β”€ 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

🎨 Design Features

  • Full-width responsive layout
  • Purple gradient theme throughout
  • Modern card-based UI
  • Smooth animations and transitions
  • Color-coded severity indicators
  • Mobile-first design

πŸ”’ Security

  • Environment variables for sensitive data
  • Firebase service account keys excluded from git
  • MongoDB connection strings secured
  • API keys protected

πŸ“ Usage

Drug Interaction Checker

  1. Navigate to /interactions
  2. Add medicine names
  3. Click "Check Interactions"
  4. View results with severity levels

Medicine Scanner

  1. Navigate to /scan
  2. Allow camera access
  3. Scan QR code or barcode
  4. Fill in details and save

AI Chat

  1. Navigate to /chat
  2. Ask medical questions
  3. Get instant AI-powered responses

🚒 Deployment

Vercel (Recommended)

npm run build
vercel deploy

Environment Variables

Add all .env.local variables to your deployment platform

🀝 Contributing

  1. Fork the repository
  2. Create feature branch (git checkout -b feature/AmazingFeature)
  3. Commit changes (git commit -m 'Add AmazingFeature')
  4. Push to branch (git push origin feature/AmazingFeature)
  5. Open Pull Request

πŸ“„ License

This project is licensed under the MIT License.

πŸ‘₯ Authors

  • Your Name - Initial work

πŸ™ Acknowledgments

  • GROQ for AI capabilities
  • MongoDB Atlas for database
  • Firebase for backend services
  • Next.js team for the framework

Made with ❀️ for better medication management

About

No description, website, or topics provided.

Resources

Code of conduct

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 2

  •  
  •