A medication management system with a React frontend and Flask backend. Track prescriptions, set reminders, and get instant answers about your medications.
-
Setup Backend:
setup_backend.bat
-
Setup Frontend:
setup_frontend.bat
-
Start Backend (in one terminal):
start_backend.bat
-
Start Frontend (in another terminal):
start_frontend.bat
See detailed instructions in SETUP_GUIDE.md
Frontend (React + Vite) → http://localhost:5173
↓ API calls
Backend (Flask) → http://localhost:5000
↓
Services (PDF Parser, QA, Voice, Scheduler)
↓
medications.json (data storage)
- Python 3.8+
- pip
- Install dependencies:
pip install flask-cors
pip install -r requirements.txt- Start the backend:
python app.pyBackend runs on: http://localhost:5000
- Node.js 18+ (includes
npm)
Quick start (npm)
- Open a terminal in the repo root and change to the frontend folder:
cd frontend- Install dependencies (use the legacy-peer-deps flag if you hit peer dependency errors) and start the dev server:
npm install --legacy-peer-deps
npm run devAlternatives
- Using pnpm:
pnpm install
pnpm dev- Using yarn:
yarn
yarn devOpen: http://localhost:5173/ (Vite default)
Notes
- If PowerShell reports that running scripts is disabled when invoking
npm, run:
Set-ExecutionPolicy RemoteSigned -Scope CurrentUser -Force- Alternatively, invoke the npm wrapper directly (no policy change required):
& 'C:\Program Files\nodejs\npm.cmd' install --legacy-peer-deps
& 'C:\Program Files\nodejs\npm.cmd' run dev- The dev script is defined in
frontend/package.json("dev": "vite").
The frontend uses these REST API endpoints:
GET /api/medications- Get all medicationsPOST /api/medications- Add new medicationPOST /api/upload- Upload prescription filePOST /api/medications/:id/take- Mark medication as takenPOST /api/chat- Chat with the medication assistantGET /api/me- Get user profilePOST /api/onboarding/reset- Reset onboarding
- Login
Method: POST URL: /login Body:
json{ "patient_name": "John Smith" }
Response:
json{ "message": "Welcome John Smith! Your reminders have been scheduled!", "data": {...} }
- Upload Prescription
Method: POST URL: /upload-prescription Body: form-data
file → PDF, TXT, DOCX or Excel file
Response:
json{ "message": "Prescription uploaded!", "data": { "patient_name": "John Smith", "doctor_name": "Dr. Sarah Johnson", "allergies": ["Penicillin"], "medications": [...], "next_appointment": "April 10, 2026" } }
- Add Manual Data
Method: POST URL: /add-manual Body:
json{ "patient_name": "John Smith", "doctor_name": "Dr. Sarah Johnson", "next_appointment": "April 10, 2026", "allergies": ["Penicillin"], "medications": [ { "name": "Amoxicillin", "dosage": "500mg", "frequency": "twice daily", "times": ["09:00", "21:00"] } ] }
Response:
json{ "message": "Patient data added successfully!", "data": {...} }
- Ask a Question (Text)
Method: POST URL: /ask Body:
json{ "patient_name": "John Smith", "question": "What medications am I taking?" }
Response:
json{ "answer": "You are currently taking..." }
- Ask a Question (Voice File)
Method: POST URL: /ask-voice Body: form-data
audio → WAV or MP3 file patient_name → Text
Response: Returns MP3 audio file — play it directly!
- Live Voice Conversation
Method: POST URL: /ask-live Body:
json{ "patient_name": "John Smith" }
Response: Returns MP3 audio file — play it directly!
- Get All Medications
Method: GET URL: /get-medications Response: Returns list of all patients and medications
- Get Patient Medications
Method: GET URL: /get-medications/John Smith Response: Returns medications for specific patient