A modern full-stack doctor-patient communication platform built with React, TypeScript, and Flask.
- Overview
- Features
- Tech Stack
- Project Structure
- Getting Started
- Environment Variables
- Demo Credentials
- API Reference
- Screenshots
- Contributing
- License
MediConnect bridges the communication gap between doctors and patients through a unified digital platform. It enables seamless appointment scheduling, digital prescription management, real-time emergency chat, health vitals tracking, and AI-powered medical assistance β all in one place.
π Live Demo: https://lovable.dev/projects/44271c15-65b7-4b2e-88b8-74a9d48f3f84
- Dashboard β View today's, upcoming, and past appointments at a glance
- Patient Management β Access patient profiles, vitals, medical history, and notes
- Voice Transcription β Record consultations with real-time voice-to-text transcription
- Prescription Management β Create, manage, and print digital prescriptions
- Emergency Chat β Respond to urgent patient messages with quick-reply templates
- Appointment Booking β Browse available time slots and schedule appointments
- Health Vitals β Track blood pressure, heart rate, temperature, and oxygen levels
- Prescriptions β View active and past prescriptions with full medication details
- Emergency Help β Direct line to your doctor for urgent queries
- AI Chat Assistant β Medical Q&A powered by GPT-4
- First Aid Assistant β Step-by-step emergency guidance with video suggestions
- Symptom Analyzer β AI-driven symptom-to-condition analysis with severity rating
- Medication Information β Detailed drug info including side effects and interactions
- Voice Commands β Navigate the app hands-free using speech recognition
- Multilingual Support β English, Spanish, French, German, Chinese (i18n via i18next)
- Real-time Notifications β Socket.IO-powered push alerts for appointments and messages
- PDF Export β Download appointment summaries and invoices as PDFs
- PWA Support β Installable progressive web app with service worker caching
- Responsive Design β Fully optimized for mobile, tablet, and desktop
| Technology | Purpose |
|---|---|
| React 18 + TypeScript | UI framework |
| Vite | Build tool |
| Tailwind CSS | Styling |
| shadcn/ui + Radix UI | Component library |
| React Router v6 | Client-side routing |
| TanStack Query | Server state management |
| Socket.IO Client | Real-time communication |
| i18next | Internationalization |
| jsPDF + jspdf-autotable | PDF generation |
| date-fns | Date utilities |
| Technology | Purpose |
|---|---|
| Flask | Web framework |
| Flask-SQLAlchemy | ORM / Database |
| Flask-SocketIO | Real-time WebSocket events |
| Flask-JWT-Extended | Authentication |
| Flask-CORS | Cross-origin support |
| OpenAI API (GPT-4) | AI features |
| SQLite | Database (dev) |
medconnect/
βββ backend/
β βββ app.py # Flask app factory
β βββ config.py # Environment configuration
β βββ extensions.py # SQLAlchemy & SocketIO instances
β βββ models.py # Database models
β βββ requirements.txt # Python dependencies
β βββ routes/
β β βββ auth.py # Register, login, profile
β β βββ appointments.py # CRUD for appointments
β β βββ prescriptions.py # CRUD for prescriptions
β β βββ chat.py # Messaging + AI fallback
β β βββ notifications.py # Real-time notifications
β β βββ voice.py # Voice command processing
β βββ utils/
β βββ auth.py # JWT middleware decorators
β
βββ src/
β βββ components/
β β βββ appointments/ # AppointmentList, Form, Details
β β βββ chat/ # AIChatAssistant
β β βββ first-aid/ # FirstAidAssistant
β β βββ health/ # SymptomAnalyzer, MedicationInfo, HealthTips
β β βββ layout/ # Header, Sidebar, Layout
β β βββ prescriptions/ # PrescriptionBilling
β β βββ voice/ # VoiceAssistant
β β βββ ui/ # shadcn/ui primitives
β βββ contexts/
β β βββ AuthContext.tsx # Auth state management
β βββ data/ # Mock data (appointments, patients, etc.)
β βββ hooks/ # Custom hooks (use-toast, use-mobile)
β βββ i18n/ # Translations (en, es)
β βββ pages/
β β βββ doctor/ # DoctorDashboard, Transcription, Prescriptions, Patients
β β βββ patient/ # PatientDashboard, Booking, Vitals, Prescriptions
β β βββ EmergencyChat.tsx
β β βββ LoginPage.tsx
β β βββ Index.tsx
β βββ services/ # aiService, prescriptionService, voiceAssistantService
β βββ types/ # TypeScript type definitions
β
βββ public/
β βββ manifest.json # PWA manifest
β βββ service-worker.js # Offline caching
βββ package.json
- Node.js >= 18
- Python >= 3.10
- npm or yarn
git clone https://github.com/your-username/medconnect.git
cd medconnectnpm install
npm run devThe frontend will start at http://localhost:5173.
cd backend
python -m venv venv
source venv/bin/activate # Windows: venv\Scripts\activate
pip install -r requirements.txt
python app.pyThe backend API will start at http://localhost:5000.
Create a .env file in the backend/ directory:
OPENAI_API_KEY=your_openai_api_key
JWT_SECRET_KEY=your_jwt_secret
FLASK_SECRET_KEY=your_flask_secret
SOCKETIO_MESSAGE_QUEUE=redis://localhost:6379/
CORS_ORIGINS=http://localhost:5173
API_BASE_URL=http://localhost:5000/api
JWT_ACCESS_TOKEN_EXPIRES=3600
JWT_REFRESH_TOKEN_EXPIRES=604800Create a .env file in the root (frontend) directory:
VITE_API_BASE_URL=http://localhost:5000/api
VITE_OPENAI_API_KEY=your_openai_api_keyThe frontend uses mock authentication for demo purposes. No backend required to explore the UI.
| Role | Password | License ID | |
|---|---|---|---|
| Doctor | doctor@example.com |
password |
DOC12345 |
| Patient | patient@example.com |
password |
β |
| Method | Endpoint | Description |
|---|---|---|
| POST | /auth/register |
Register a new user |
| POST | /auth/login |
Login and receive JWT |
| GET | /auth/profile |
Get current user profile |
| PUT | /auth/profile |
Update user profile |
| Method | Endpoint | Description |
|---|---|---|
| GET | /appointments |
List appointments (role-filtered) |
| POST | /appointments |
Create appointment |
| GET | /appointments/:id |
Get appointment details |
| PUT | /appointments/:id |
Update appointment |
| DELETE | /appointments/:id |
Delete appointment |
| Method | Endpoint | Description |
|---|---|---|
| GET | /prescriptions |
List prescriptions |
| POST | /prescriptions |
Create prescription (doctor only) |
| GET | /prescriptions/:id |
Get prescription |
| GET | /prescriptions/:id/invoice |
Download invoice |
| Method | Endpoint | Description |
|---|---|---|
| GET | /chat/messages |
Get messages between two users |
| POST | /first-aid |
Get first aid guidance |
| POST | /voice/process-command |
Process voice command |
| Method | Endpoint | Description |
|---|---|---|
| GET | /notifications |
List notifications |
| PUT | /notifications/:id/read |
Mark as read |
| PUT | /notifications/read-all |
Mark all as read |
| GET | /notifications/unread-count |
Get unread count |
Contributions are welcome! Here's how to get started:
- Fork the repository
- Create a feature branch:
git checkout -b feature/your-feature-name - Commit your changes:
git commit -m 'feat: add your feature' - Push to the branch:
git push origin feature/your-feature-name - Open a Pull Request
Please follow Conventional Commits for commit messages.
This project is licensed under the MIT License. See the LICENSE file for details.
Built with β€οΈ using React, TypeScript, and Flask
Live Demo β’ Report Bug β’ Request Feature