MediConnect is a full-stack web application built with React for the frontend, Express.js for the backend, and PostgreSQL for the database. The system is designed to connect patients, doctors, and admins in a healthcare environment, allowing users to manage appointments, prescriptions, profiles, and communications through real-time chat. It implements Role-Based Access Control (RBAC) for different user roles (patient, doctor, admin) with secure authentication and profile management.
- Authentication & Authorization: Users can register, log in, and securely manage their sessions. The app uses JWT for authentication and role-based access control (RBAC).
- Profile Setup & Management: Users must complete their profiles based on their role (patient, doctor, or admin) before they are fully registered.
- Appointments: Patients can book appointments with doctors, and doctors can view their schedules.
- Prescription Management: Doctors can add prescriptions for patients, which include the medication details, dosage, and instructions.
- Real-time Chat: Users (patients and doctors) can communicate in real-time through a live bidirectional chat system powered by Socket.IO.
- Admin Dashboard: Admins can manage users, view statistics, and monitor the platform's health.
- Summary: Get recent activity logs
- Security:
bearerAuth
- Responses:
200– Recent activities
- Summary: Get admin dashboard summary
- Security:
bearerAuth
- Responses:
200– Admin summary
- Summary: Get all users
- Security:
bearerAuth
- Responses:
200– List of all users
- Summary: Get all doctors
- Security:
bearerAuth
- Responses:
200– List of doctors
- Summary: Get all patients
- Security:
bearerAuth
- Responses:
200– List of patients
- Summary: Get all admins
- Security:
bearerAuth
- Responses:
200– List of admins
- Summary: Delete a user by ID
- Path Parameters:
userId(string, required)
- Security:
bearerAuth
- Responses:
200– User deleted
- Summary: Doctor adds availability
- Security:
bearerAuth
- Responses:
201– Availability added
- Summary: Get all doctor availabilities
- Security:
bearerAuth
- Responses:
200– List of availability
- Summary: Doctor’s own availability
- Security:
bearerAuth
- Responses:
200– Doctor’s availability
- Summary: Doctor deletes availability by ID
- Path Parameters:
id(string, required)
- Security:
bearerAuth
- Responses:
200– Availability deleted
- Summary: Patient books appointment
- Security:
bearerAuth
- Responses:
201– Appointment booked
- Summary: Patient’s own appointments
- Security:
bearerAuth
- Responses:
200– List of patient’s appointments
- Summary: Doctor’s own appointments
- Security:
bearerAuth
- Responses:
200– List of doctor’s appointments
- Summary: Doctor approves appointment
- Path Parameters:
id(string, required)
- Security:
bearerAuth
- Responses:
200– Appointment approved
- Summary: Cancel appointment (Doctor or Patient)
- Path Parameters:
id(string, required)
- Security:
bearerAuth
- Responses:
200– Appointment cancelled
- Summary: User registration
- Responses:
201– User registered
- Summary: User login
- Responses:
200– User logged in
- Summary: User logout
- Security:
bearerAuth
- Responses:
200– User logged out
- Summary: Get registration role info
- Responses:
200– Registration role info
- Summary: Get available doctors for patient
- Security:
bearerAuth
- Responses:
200– List of doctors
- Summary: Get doctors patient chatted with
- Security:
bearerAuth
- Responses:
200– List of chatted doctors
- Summary: Get patients for doctor
- Security:
bearerAuth
- Responses:
200– List of patients
- Summary: Get patients doctor chatted with
- Security:
bearerAuth
- Responses:
200– List of chatted patients
- Summary: Get chat history by room ID
- Path Parameters:
roomId(string, required)
- Security:
bearerAuth
- Responses:
200– Chat history
- Summary: Get unread messages
- Security:
bearerAuth
- Responses:
200– List of unread messages
- Summary: Get all drugs
- Responses:
200– List of drugs
- Summary: Search for drugs
- Responses:
200– Search results
- Summary: Add a prescription
- Security:
bearerAuth
- Responses:
201– Prescription added
- Summary: Get prescriptions for patient
- Security:
bearerAuth
- Responses:
200– List of prescriptions
- Summary: Get prescriptions written by doctor
- Security:
bearerAuth
- Responses:
200– List of prescriptions
- Summary: End a prescription
- Path Parameters:
id(string, required)
- Security:
bearerAuth
- Responses:
200– Prescription ended
- Summary: Setup user profile
- Security:
bearerAuth
- Responses:
200– Profile setup completed
- Summary: Access protected route
- Security:
bearerAuth
- Responses:
200– Access granted
- Summary: Log patient symptom
- Security:
bearerAuth
- Responses:
201– Symptom logged
- Summary: Get symptom history for patient
- Security:
bearerAuth
- Responses:
200– Symptom history
-
Frontend:
- React.js
- React Router for routing
- Zod
- Socket.IO client
-
Backend:
- Express.js for handling HTTP requests
- JWT for user authentication
- Socket.IO for real-time communication
- PostgreSQL database for data storage
- bcryptjs for password hashing
- Zod for schema validation
-
Deployment:
- Deployed on Vercel for frontend
- Backend hosted on Render
- PostgreSQL database on Render
To get this project up and running, you will need the following:
- Node.js (version >= 14.x)
- PostgreSQL instance for the database
- npm for managing dependencies
To run the MediConnect application locally, clone this repository.
Then, run npm install to install all of the necessary packages, first in the backend folder and then in the frontend folder.
Afterwords, the project may be started using the npm start command, once again starting in the backend folder and then the frontend.
Tests can be run using npm run tests and npm run tests:integration.