| [99ab276] | 1 | # Medora - Medical Records Management System
|
|---|
| 2 |
|
|---|
| 3 | Medora is a comprehensive healthcare management platform designed to streamline patient medical records, appointments, laboratory tests, prescriptions, and billing operations.
|
|---|
| 4 |
|
|---|
| 5 | ## Features
|
|---|
| 6 |
|
|---|
| 7 | - **Patient Management** - Create and manage patient profiles with EMBG (personal identification number)
|
|---|
| 8 | - **Medical Records** - Access comprehensive patient medical histories including diagnoses, symptoms, allergies, and prescriptions
|
|---|
| 9 | - **Appointments** - Schedule and manage doctor-patient appointments
|
|---|
| 10 | - **Lab Tests** - Request and track laboratory test results
|
|---|
| 11 | - **Prescriptions** - Manage medication prescriptions for patients
|
|---|
| 12 | - **Doctor Management** - Manage doctor profiles and specializations
|
|---|
| 13 | - **Billing** - Generate and track billing records for medical services
|
|---|
| 14 | - **User Authentication** - Secure JWT-based authentication with role-based access control (Admin, Doctor, Patient, Lab Technician, Billing Admin)
|
|---|
| 15 |
|
|---|
| 16 | ## Tech Stack
|
|---|
| 17 |
|
|---|
| 18 | ### Backend
|
|---|
| 19 | - **Framework:** Spring Boot (Java)
|
|---|
| 20 | - **Database:** PostgreSQL
|
|---|
| 21 | - **ORM:** Hibernate/JPA
|
|---|
| 22 | - **Security:** Spring Security + JWT
|
|---|
| 23 | - **Build Tool:** Maven
|
|---|
| 24 |
|
|---|
| 25 | ### Frontend
|
|---|
| 26 | - **Library:** React 18+
|
|---|
| 27 | - **Routing:** React Router
|
|---|
| 28 | - **HTTP Client:** Axios
|
|---|
| 29 | - **Styling:** TailwindCSS
|
|---|
| 30 | - **Build Tool:** npm/Create React App
|
|---|
| 31 |
|
|---|
| 32 | ## 📋 Prerequisites
|
|---|
| 33 |
|
|---|
| 34 | Before you start, make sure you have installed:
|
|---|
| 35 |
|
|---|
| 36 | - **Java JDK 21+** - [Download](https://www.oracle.com/java/technologies/downloads/)
|
|---|
| 37 | - **Maven 3.8+** - [Download](https://maven.apache.org/download.cgi)
|
|---|
| 38 | - **Node.js 22+** - [Download](https://nodejs.org/)
|
|---|
| 39 | - **PostgreSQL 14+** - [Download](https://www.postgresql.org/download/)
|
|---|
| 40 |
|
|---|
| 41 | ## Quick Start
|
|---|
| 42 |
|
|---|
| 43 | ### 1. Setup Database
|
|---|
| 44 |
|
|---|
| 45 | Create a PostgreSQL database for the application:
|
|---|
| 46 |
|
|---|
| 47 | ```bash
|
|---|
| 48 | createdb medora
|
|---|
| 49 | ```
|
|---|
| 50 |
|
|---|
| 51 | **Note:** The database schema and tables are automatically created by Flyway migrations and Hibernate when the backend starts.
|
|---|
| 52 |
|
|---|
| 53 | ### 2. Start Backend
|
|---|
| 54 |
|
|---|
| 55 | Navigate to the backend directory and run:
|
|---|
| 56 |
|
|---|
| 57 | ```bash
|
|---|
| 58 | cd backend
|
|---|
| 59 | ./mvnw.cmd spring-boot:run
|
|---|
| 60 | ```
|
|---|
| 61 |
|
|---|
| 62 | The backend will start on `http://localhost:8080`
|
|---|
| 63 |
|
|---|
| 64 | **Wait for the message:** `Started Application in X seconds`
|
|---|
| 65 |
|
|---|
| 66 | ### 3. Start Frontend (in a new terminal)
|
|---|
| 67 |
|
|---|
| 68 | Navigate to the frontend directory and run:
|
|---|
| 69 |
|
|---|
| 70 | ```bash
|
|---|
| 71 | cd frontend
|
|---|
| 72 | npm install
|
|---|
| 73 | npm start
|
|---|
| 74 | ```
|
|---|
| 75 |
|
|---|
| 76 | The frontend will open automatically on `http://localhost:3000`
|
|---|
| 77 |
|
|---|
| 78 | ## Default Credentials & User Roles
|
|---|
| 79 |
|
|---|
| 80 | ### Admin User
|
|---|
| 81 | - **Username:** `admin`
|
|---|
| 82 | - **Password:** `admin123`
|
|---|
| 83 | - **Role:** ADMIN
|
|---|
| 84 | - **Permissions:** Full system access, user management, system configuration
|
|---|
| 85 |
|
|---|
| 86 | ### Doctor Users
|
|---|
| 87 | - **Username:** Doctor's email address (from the database)
|
|---|
| 88 | - **Password:** `doctor123`
|
|---|
| 89 | - **Role:** DOCTOR
|
|---|
| 90 | - **Permissions:** View/manage patient medical records, create prescriptions, manage appointments, request lab tests
|
|---|
| 91 |
|
|---|
| 92 | **Example:**
|
|---|
| 93 | ```
|
|---|
| 94 | Username: ivan.stojanov@medora.com
|
|---|
| 95 | Password: doctor123
|
|---|
| 96 | ```
|
|---|
| 97 |
|
|---|
| 98 | ### Patient Users
|
|---|
| 99 | - **Username:** Patient's EMBG (personal identification number)
|
|---|
| 100 | - **Password:** `password123`
|
|---|
| 101 | - **Role:** PATIENT
|
|---|
| 102 | - **Permissions:** View own medical records, view appointments, view prescriptions
|
|---|
| 103 |
|
|---|
| 104 | **Example:**
|
|---|
| 105 | ```
|
|---|
| 106 | Username: 1505993123477
|
|---|
| 107 | Password: password123
|
|---|
| 108 | ```
|
|---|
| 109 |
|
|---|
| 110 | ### Lab Technician Users
|
|---|
| 111 | - **Username:** Lab technician's email address (from the database)
|
|---|
| 112 | - **Password:** `lab123`
|
|---|
| 113 | - **Role:** LAB_TECHNICIAN
|
|---|
| 114 | - **Permissions:** Create and update lab test results, view assigned lab tests
|
|---|
| 115 |
|
|---|
| 116 | **Example:**
|
|---|
| 117 | ```
|
|---|
| 118 | Username: lab_marina
|
|---|
| 119 | Password: lab123
|
|---|
| 120 | ```
|
|---|
| 121 |
|
|---|
| 122 | ### Billing Admin Users
|
|---|
| 123 | - **Username:** Billing admin's email address (from the database)
|
|---|
| 124 | - **Password:** `adminmedora123`
|
|---|
| 125 | - **Role:** BILLING_ADMIN
|
|---|
| 126 | - **Permissions:** View billing records, generate billing reports, manage billing operations
|
|---|
| 127 |
|
|---|
| 128 | **Example:**
|
|---|
| 129 | ```
|
|---|
| 130 | Username: admin_ilija
|
|---|
| 131 | Password: adminmedora123
|
|---|
| 132 | ```
|
|---|
| 133 |
|
|---|
| 134 |
|
|---|
| 135 | ## Configuration
|
|---|
| 136 |
|
|---|
| 137 | ### Backend Configuration
|
|---|
| 138 |
|
|---|
| 139 | Edit `backend/src/main/resources/application.properties`:
|
|---|
| 140 |
|
|---|
| 141 | ```properties
|
|---|
| 142 | # Database
|
|---|
| 143 | spring.datasource.url=jdbc:postgresql://localhost:5432/medora
|
|---|
| 144 | spring.datasource.username=medora_app
|
|---|
| 145 | spring.datasource.password=postgres
|
|---|
| 146 |
|
|---|
| 147 | # JWT
|
|---|
| 148 | jwt.secret=your-secret-key
|
|---|
| 149 | jwt.expiration=86400000
|
|---|
| 150 |
|
|---|
| 151 | # Hibernate
|
|---|
| 152 | spring.jpa.hibernate.ddl-auto=update
|
|---|
| 153 | ```
|
|---|
| 154 |
|
|---|
| 155 |
|
|---|
| 156 | ## Role-Based Features
|
|---|
| 157 |
|
|---|
| 158 | ### ADMIN
|
|---|
| 159 | - ✅ Manage all users (create, update, delete)
|
|---|
| 160 | - ✅ Create and manage patients
|
|---|
| 161 | - ✅ Create and manage doctors
|
|---|
| 162 | - ✅ View all medical records
|
|---|
| 163 | - ✅ System configuration
|
|---|
| 164 | - ✅ View all appointments
|
|---|
| 165 | - ✅ Access backfill operations
|
|---|
| 166 |
|
|---|
| 167 | ### DOCTOR
|
|---|
| 168 | - ✅ View patient list
|
|---|
| 169 | - ✅ View patient medical records (diagnoses, symptoms, allergies)
|
|---|
| 170 | - ✅ Create prescriptions
|
|---|
| 171 | - ✅ Request laboratory tests
|
|---|
| 172 | - ✅ Manage appointments
|
|---|
| 173 | - ✅ Create medical reports
|
|---|
| 174 | - ❌ Cannot create new patients (admin only)
|
|---|
| 175 | - ❌ Cannot access billing information
|
|---|
| 176 |
|
|---|
| 177 | ### PATIENT
|
|---|
| 178 | - ✅ View own medical records
|
|---|
| 179 | - ✅ View own appointments
|
|---|
| 180 | - ✅ View own prescriptions
|
|---|
| 181 | - ✅ View own lab test results
|
|---|
| 182 | - ❌ Cannot view other patients' data
|
|---|
| 183 | - ❌ Cannot modify medical records
|
|---|
| 184 |
|
|---|
| 185 | ### LAB_TECHNICIAN
|
|---|
| 186 | - ✅ View assigned lab tests
|
|---|
| 187 | - ✅ Create and update lab test results
|
|---|
| 188 | - ✅ View patient information for assigned tests
|
|---|
| 189 | - ❌ Cannot create new lab tests (doctor only)
|
|---|
| 190 | - ❌ Cannot access medical records
|
|---|
| 191 | - ❌ Cannot access billing
|
|---|
| 192 |
|
|---|
| 193 | ### BILLING_ADMIN
|
|---|
| 194 | - ✅ View all billing records
|
|---|
| 195 | - ✅ Generate billing reports
|
|---|
| 196 | - ✅ Track revenue and payments
|
|---|
| 197 | - ✅ View patient information for billing purposes
|
|---|
| 198 | - ❌ Cannot access medical records
|
|---|
| 199 | - ❌ Cannot manage appointments
|
|---|
| 200 | - ❌ Cannot create prescriptions
|
|---|
| 201 |
|
|---|
| 202 | ---
|
|---|
| 203 |
|
|---|
| 204 | ## Security Features
|
|---|
| 205 |
|
|---|
| 206 | - JWT-based authentication
|
|---|
| 207 | - Role-based access control (RBAC)
|
|---|
| 208 | - Password hashing with BCrypt
|
|---|
| 209 | - CORS configuration for frontend-backend communication
|
|---|
| 210 | - SQL injection protection via parameterized queries
|
|---|
| 211 | - Request validation and error handling
|
|---|
| 212 |
|
|---|
| 213 | ## Database Migrations
|
|---|
| 214 |
|
|---|
| 215 | Database migrations are located in `backend/src/main/resources/db/migration/` and are automatically applied by Flyway on startup.
|
|---|