HealthConnect is a full-featured telemedicine platform designed to simulate real-world scenarios where pharmacy devices connect patients with available doctors in real time. It includes powerful tools for Admins, Doctors, and Pharmacy Devices to streamline remote consultations, manage availability, and ensure smooth communication.
Admins have access to a powerful dashboard to oversee platform operations:
-
β Monitor Real-Time Doctor Availability
- View doctors currently online with status:
Available,Busy, orOffline. - Monitor their last activity timestamps.
- View doctors currently online with status:
-
π§ Track Active Sessions
- Live tracking of chat sessions between pharmacy devices and doctors.
- View session duration and message flow in real time.
-
π Manage Connected Pharmacy Devices
- View all registered pharmacy devices.
- Monitor real-time device activity and geolocation.
-
ποΈ User Account Management
- Approve, suspend, or remove doctor and pharmacy accounts.
- View registration details and manage credentials.
-
π Dashboard Analytics
- Key metrics like total active users, session frequency, doctor availability trends, and most active devices.
Doctors are essential users who can manage their availability and connect with patients via chat:
-
βοΈ Register & Manage Profile
- Secure account creation.
- Edit name, specialization, contact info, etc.
-
π’ Set Availability Status
- Toggle between
Available,Busy, orOffline. - Devices can only contact doctors marked as
Available.
- Toggle between
-
π¬ Real-Time Chat with Pharmacy Devices
- Chat with patients through connected pharmacy systems.
- Multiple conversations can be handled efficiently.
-
π Session Logs
- Access history of all consultations.
- View chat transcripts, timestamps, and device info.
Pharmacy devices act as entry points for patients to initiate remote consultations:
-
π₯οΈ Device Registration
- Register securely using a unique Device ID.
- Pharmacy info linked to each device.
-
π View Available Doctors
- Instantly fetch a list of doctors who are currently
Available.
- Instantly fetch a list of doctors who are currently
-
π² Start Real-Time Chat
- Initiate chat with selected doctors.
- Designed for low-latency, high-reliability communication.
-
π Chat History
- Maintain recent session history for continuity.
- Access previous consultations made through the device.
π‘ This platform enables a seamless healthcare communication bridge between pharmacies and doctors, while giving admins full visibility and control over the ecosystem.
- Node.js + Express.js
- MongoDB with Mongoose ORM
- Socket.IO for real-time communication
- JWT-based Authentication
- React.js with Tailwind CSS
- Axios for API requests
- Socket.IO-client for real-time UI updates
-
Pharmacy Device Registration
Register a device with GPS coordinates and a unique ID. -
Doctor Authentication
Login/Logout APIs with the ability to toggle availability. -
Session Management
Devices can initiate a session with available doctors based on a matching algorithm.
- π΅ Live status of online doctors
- π Mocked device activity map
- π§ββοΈ Active doctor-patient sessions
- βοΈ Device registration and doctor onboarding
- Real-time doctor status updates using WebSocket (Socket.IO)
- Persistent chat messaging between doctor and device
- Basic logging of device connections and session events
- Protected routes secured using JWT
- Role-based access controls for
doctor,device, andadmin
HEALTHCONNECT PRO/
βββ backend/
β βββ Config/ # DB connection and environment setup
β βββ Controllers/ # Request handlers for each route
β βββ Middlewares/ # Authentication and other middleware
β βββ Models/ # Mongoose schema definitions
β βββ Routes/ # Helper functions (if any)
β βββ index.js # Entry point for backend
β βββ .env # Environment variables
β
βββ frontend/
β βββ public/ # Static assets
β βββ src/
β β βββ Components/ # Reusable UI components
β β βββ Pages/ # Page-level components
β β βββ Redux/ # Redux slices and store setup
β β βββ Services/ # API service calls (e.g., axios)
β β βββ App.jsx # Main App component
β β βββ main.jsx # React entry point
β βββ .env # Frontend environment variables
β
βββ README.md # Project documentation
βββ package.json # Project dependencies and scripts
- Navigate to the backend folder:
cd backend - Install dependencies:
npm install
- Create a .env file and add:
PORT=4000 MONGODB_URI=your_mongo_uri JWT_SECRET=your_secret_key NODE_ENV = "development" - Start the server:
npm run dev
- Navigate to the frontend folder:
cd frontend - Install dependencies:
npm install
- Start the app:
npm run dev
All secure routes require a valid JWT token in the cookies as:
| Method | Endpoint | Description |
|---|---|---|
| POST | /api/signup |
Register a new user (doctor/device/admin) |
| POST | /api/login |
Authenticate user and return JWT token |
| POST | /api/logout |
Logout current user (clears cookie or token) |
| GET | /api/get-user-details |
Get authenticated user details |
| Method | Endpoint | Description |
|---|---|---|
| GET | /api/get-all-doctors |
Get list of all doctors |
| PUT | /api/update-doctor-availability |
Update doctorβs availability status |
| GET | /api/get-doctor-chats/:deviceId |
Get all chat messages between doctor and specific device |
| Method | Endpoint | Description |
|---|---|---|
| GET | /api/get-all-devices |
Get list of all registered pharmacy devices |
| Method | Endpoint | Description |
|---|---|---|
| GET | /:userId/:peerId |
Fetch chat messages between a user and their peer (doctor or device) |
π Note: All endpoints that modify or view sensitive data are protected and require authentication.
Below are the core Mongoose models used in the HealthConnect platform:
{
_id: ObjectId,
name: String, // Admin full name
email: String, // Unique email address
role: "admin", // Default: "admin"
password: String, // Hashed password
createdAt: Date // Auto-generated on registration
}{
_id: ObjectId,
name: String, // Doctor's full name
email: String, // Unique email address
password: String, // Hashed password
role: "doctor", // Default: "doctor"
specialization: String, // e.g. "Cardiologist", Default: "General"
isAvailable: Boolean, // Indicates availability status
lastLogin: Date, // Timestamp of last login
createdAt: Date, // Auto-generated
updatedAt: Date // Auto-updated on each save
}{
_id: ObjectId,
deviceId: String, // Unique ID of the pharmacy device
password: String, // Hashed password
latitude: Number, // GPS Latitude
longitude: Number, // GPS Longitude
role: "device", // Default: "device"
registeredAt: Date, // When device was registered
lastActive: Date // Last active timestamp
}{
_id: ObjectId,
sender: String, // Sender ID (doctorId or deviceId)
receiver: String, // Receiver ID (doctorId or deviceId)
message: String, // Chat message content
timestamp: Date // Time message was sent
}- Frontend: https://healthconnect-frontend.vercel.app
- Backend API: https://healthconnect-api.onrender.com
- CORS should be configured correctly.
.envfiles are required for deployment (add secrets to your host).