Your comprehensive, AI-driven companion for pharmacy education and clinical practice.
Built for the Google AI Studio Hackathon.
PharmAId is a modern, responsive web application designed to assist pharmacy students and professionals. Powered by the Google Gemini API (2.5 Flash), it offers intelligent study tools, clinical safety checks, and an interactive, gamified patient counseling simulator.
A smart clinical notebook designed to accelerate learning.
- PDF Extraction: Upload text-based PDFs and instantly extract clinical guidelines or study materials into your notes.
- Grounded AI Q&A: Ask Gemini context-aware questions about your specific notes. The AI will strictly use your note content to answer, preventing hallucinations.
- Cloud Sync: Optional Google Sign-In via Firebase to securely save your notes across sessions. Seamless ephemeral use for quick testing!
A precision tool for drug safety analysis.
- Interaction Checker: Input multiple drugs to generate a comprehensive AI analysis of potential drug-drug interactions.
- Structured Risk Assessment: Returns strict JSON-structured data displaying the overall risk level, severity per interaction, and actionable clinical management recommendations.
A gamified patient counseling simulator to practice communication skills.
- Dynamic Scenarios: Automatically generates realistic patient profiles and clinical scenarios.
- Real-Time Roleplay: Chat with an AI-driven patient that responds dynamically to your counseling approach.
- Gamified Feedback: End the session to receive a comprehensive evaluation including an overall score, badges earned (e.g., Active Listener, Empathy Expert), and detailed feedback on clinical accuracy, empathy, and areas to improve.
- Framework: Next.js 15+ (App Router) & React 19
- Language: TypeScript
- Styling: Tailwind CSS v4
- AI Integration: @google/genai SDK (Gemini 2.5 Flash)
- Backend & Auth: Firebase (Firestore, Google Auth)
- Document Parsing: pdfjs-dist
- Icons: Lucide React
To run PharmAId locally, follow these steps:
git clone <repository-url>
cd pharmaidnpm installCreate a .env.local file in the root directory and add the following keys. (See .env.example for reference).
# Gemini API Setup
# Get your key at: https://aistudio.google.com/
NEXT_PUBLIC_GEMINI_API_KEY=your_gemini_api_key_hereNote: Firebase configuration is automatically handled via the included firebase-applet-config.json if you are using the pre-configured project, or you can supply your own standard Firebase web credentials if decoupling from the provided backend.
npm run devOpen http://localhost:3000 with your browser to see the result.
/app- Next.js App Router entry points and global styling./components- Reusable React components containing the core module logic (LearnDashboard,ClinicalPage,SimulatePage)./services- Integrations for external APIs:geminiService.ts: Core AI logic, prompt engineering, and structured JSON parsing.firestoreService.ts: Database CRUD operations.
/contexts- Global state management (e.g.,AuthContext.tsx)./lib- Utility functions (e.g., PDF extraction helper).
- Database interactions are secured with hardened Firestore Security Rules ensuring users can only read, list, update, and delete their own clinical notes.
- Ephemeral state handling is implemented to allow guest users to fully test standard app functionality (like AI Simulation and Note Extraction) without creating an account.
MIT License