Prescriptly AI is a modern, AI-powered online pharmacy platform that revolutionizes the way users order medicines. Built with React, TypeScript, and powered by Google's Gemini AI, it offers an intelligent prescription analysis system, contextual chatbot assistance, and a seamless shopping experience.
- Upload prescription images (JPG, PNG, PDF)
- Automatic medicine extraction using Gemini AI
- Intelligent matching with inventory database
- Detailed prescription analysis (patient info, dosage, instructions)
- Dynamic medicine availability (all prescribed medicines guaranteed available)
- Prescription-aware conversations
- Voice input support (microphone integration)
- Medicine recommendations based on symptoms
- Dosage and usage instructions
- Cart management through natural language
- Medicine interaction warnings
- Alternative medicine suggestions
- Firebase Authentication integration
- Email/Password authentication
- Google Sign-In
- Protected routes for sensitive operations
- Mock authentication fallback for demo purposes
- Session persistence
- Add medicines from prescription scan
- Manual medicine browsing and selection
- Quantity management
- Real-time price calculation
- Prescription requirement validation
- Cart persistence across sessions
- 39+ medicines across 11 categories
- Detailed medicine information (dosage, form, price)
- Stock availability tracking
- Prescription requirement indicators
- Category-based filtering
- Search functionality
- Framework: React 19.2.4
- Language: TypeScript 5.8.2
- Build Tool: Vite 6.2.0
- Routing: React Router DOM 7.13.0
- Icons: Lucide React 0.563.0
- Styling: Tailwind CSS (utility-first)
- Authentication: Firebase Auth 12.8.0
- AI Engine: Google Gemini AI 1.39.0
- Image Analysis: Gemini Vision API
- Natural Language Processing: Gemini Chat API
- Context API:
AuthContext- User authentication stateCartContext- Shopping cart managementPrescriptionContext- Prescription data and analysis
prescriptly/
βββ components/ # Reusable UI components
β βββ Button.tsx # Custom button component
β βββ Chatbot.tsx # AI chatbot with voice input
β βββ Footer.tsx # Footer with legal links
β βββ MedicineCard.tsx # Medicine display card
β βββ Navbar.tsx # Navigation bar
β βββ ProtectedRoute.tsx # Route authentication wrapper
β
βββ config/
β βββ firebase.ts # Firebase configuration
β
βββ context/ # Global state management
β βββ AuthContext.tsx # Authentication state
β βββ CartContext.tsx # Shopping cart state
β βββ PrescriptionContext.tsx # Prescription data
β
βββ data/
β βββ medicines.ts # Medicine inventory database
β
βββ pages/ # Application pages
β βββ Cart.tsx # Shopping cart page
β βββ Checkout.tsx # Checkout process
β βββ Home.tsx # Landing page
β βββ Legal.tsx # Legal pages (Privacy, Terms, etc.)
β βββ Login.tsx # Login page
β βββ Medicines.tsx # Medicine catalog
β βββ Payment.tsx # Payment processing
β βββ Signup.tsx # User registration
β βββ Upload.tsx # Prescription upload & analysis
β
βββ public/ # Static assets
β βββ images/ # Medicine images
β
βββ App.tsx # Main application component
βββ index.tsx # Application entry point
βββ types.ts # TypeScript type definitions
βββ vite.config.ts # Vite configuration
βββ package.json # Dependencies and scripts
- Node.js (v18 or higher)
- npm or yarn
- Firebase account
- Google AI Studio API key (Gemini)
- Clone the repository
git clone https://github.com/warshit/Prescriptly-AI.git
cd Prescriptly-AI- Install dependencies
npm install- Configure environment variables
Create a .env.local file in the root directory:
# Gemini AI API Key
GEMINI_API_KEY=your_gemini_api_key_here
# Firebase Configuration
VITE_FIREBASE_API_KEY=your_firebase_api_key
VITE_FIREBASE_AUTH_DOMAIN=your_project.firebaseapp.com
VITE_FIREBASE_DATABASE_URL=https://your_project.firebasedatabase.app
VITE_FIREBASE_PROJECT_ID=your_project_id
VITE_FIREBASE_STORAGE_BUCKET=your_project.firebasestorage.app
VITE_FIREBASE_MESSAGING_SENDER_ID=your_sender_id
VITE_FIREBASE_APP_ID=your_app_id
VITE_FIREBASE_MEASUREMENT_ID=your_measurement_id- Start development server
npm run dev- Build for production
npm run build- User uploads prescription image
- Gemini AI analyzes image and extracts:
- Medicine names
- Dosage information
- Frequency instructions
- Doctor and patient details
- System matches medicines with inventory
- Creates dynamic entries for unavailable medicines
- Stores prescription context for chatbot
- User can add medicines to cart with one click
- Prescription Queries: "What medicines are in my prescription?"
- Dosage Information: "How much Paracetamol should I take?"
- Medicine Search: "Do you have medicine for headache?"
- Cart Management: "Add all my prescription medicines to cart"
- Interactions: "Can I take these medicines together?"
- Alternatives: "Do you have a generic version?"
- Voice Commands: Speak naturally to interact
- Secure email/password registration
- Google OAuth integration
- Protected routes for:
- Prescription upload
- Shopping cart
- Checkout process
- Automatic session management
- Mock authentication for testing
- Firebase Authentication for secure user management
- Protected routes with authentication checks
- Secure API key management via environment variables
- Input validation and sanitization
- HTTPS-only Firebase connections
- No sensitive data in client-side code
- Fever & Pain Relief - Paracetamol, Ibuprofen, Pain gels
- Antibiotics - Azithromycin, Amoxicillin (Prescription required)
- Cold & Cough - Syrups, Nasal drops, Tablets
- Digestive Health - Antacids, Digestive enzymes
- Allergy Care - Antihistamines, Allergy relief
- Skin Care - Antiseptic creams, Ointments
- Vitamins & Supplements - Multivitamins, Calcium, Vitamin C
- Diabetes Care - Metformin, Insulin (Prescription required)
- First Aid - Burn relief, Wound care
- Eye & Ear Care - Eye drops, Ear drops
- Other Categories - Specialized medicines
- Visit homepage β Browse medicines
- Sign up with email or Google
- Upload prescription (optional)
- Chat with AI for recommendations
- Add medicines to cart
- Proceed to checkout
- Login with credentials
- View previous prescriptions (context maintained)
- Quick reorder from prescription
- Chat with AI about medicine queries
- Complete purchase
# Start development server
npm run dev
# Build for production
npm run build
# Preview production build
npm run preview- TypeScript for type safety
- ESLint for code linting
- Component-based architecture
- Reusable utility functions
- Consistent naming conventions
Contributions are welcome! Please follow these steps:
- Fork the repository
- Create a feature branch (
git checkout -b feature/AmazingFeature) - Commit your changes (
git commit -m 'Add some AmazingFeature') - Push to the branch (
git push origin feature/AmazingFeature) - Open a Pull Request
This project is licensed under the MIT License.
- Developer: Warshit
- AI Integration: Google Gemini AI
- Authentication: Firebase
Built with β€οΈ using React, TypeScript, and AI
Prescriptly AI - Making healthcare accessible, one prescription at a time.