From c89fb91620c49026b15c0e4297926b9acc6db1c4 Mon Sep 17 00:00:00 2001 From: buggarajesh Date: Tue, 4 Mar 2025 12:12:15 +0530 Subject: [PATCH 01/48] update README.md --- README.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/README.md b/README.md index 621ee81..c63417b 100644 --- a/README.md +++ b/README.md @@ -11,3 +11,5 @@ Welcome to the **Hospital Management System** repository! This project is design ``` Hello: Myself Malti Bhokare + +Hai: Myself Rajesh Bugga \ No newline at end of file From 208e1ae8b36c9ac395036d083e8b2114c902eb96 Mon Sep 17 00:00:00 2001 From: buggarajesh Date: Wed, 5 Mar 2025 18:43:56 +0530 Subject: [PATCH 02/48] BookedAppointments added --- .../src/components/BookedAppointments.jsx | 60 +++++++++++++++++++ frontend/src/components/Dashboard.jsx | 2 + 2 files changed, 62 insertions(+) create mode 100644 frontend/src/components/BookedAppointments.jsx diff --git a/frontend/src/components/BookedAppointments.jsx b/frontend/src/components/BookedAppointments.jsx new file mode 100644 index 0000000..4ef8629 --- /dev/null +++ b/frontend/src/components/BookedAppointments.jsx @@ -0,0 +1,60 @@ +import React, { useState } from "react"; +import { FaTrash, FaEdit } from "react-icons/fa"; + +const initialAppointments = [ + { id: 1, name: "Shiva Kumar", doctor: "Dr. Sai Ahmed", date: "08/03/2025", time: "08:30" }, + { id: 2, name: "Shashank", doctor: "Dr. Dinesh Kumar", date: "13/03/2025", time: "09:30" }, + { id: 3, name: "Dakshitha Kumari", doctor: "Dr. Zain Ahmed", date: "14/03/2025", time: "10:30" }, + { id: 4, name: "Laila Mahmoud", doctor: "Dr. Vishal Pandey ", date: "14/03/2025", time: "08:30" }, +]; + +export default function BookedAppointments() { + const [appointments, setAppointments] = useState(initialAppointments); + + const handleDelete = (id) => { + setAppointments(appointments.filter((appointment) => appointment.id !== id)); + }; + + return ( +
+ {/* Header Section */} +
+

Booked Appointment

+ +
+ + {/* Responsive Table */} +
+ + + + + + + + + + + + + {appointments.map((appointment) => ( + + + + + + + + + ))} + +
SelectPatient NameAssigned DoctorDateTimeAction
{appointment.name}{appointment.doctor}{appointment.date}{appointment.time} + + handleDelete(appointment.id)} /> +
+
+
+ ); +} diff --git a/frontend/src/components/Dashboard.jsx b/frontend/src/components/Dashboard.jsx index dfb127c..c54de5d 100644 --- a/frontend/src/components/Dashboard.jsx +++ b/frontend/src/components/Dashboard.jsx @@ -1,12 +1,14 @@ import React from 'react' import DashboardCards from './DashboardCards' import Sidebar from './Sidebar' +import BookedAppointments from './BookedAppointments' const Dashboard = () => { return (
Dashboard +
) } From 25ce9589814d20e8cd5743e42e0160a4e6e97325 Mon Sep 17 00:00:00 2001 From: strivervishal Date: Wed, 5 Mar 2025 21:15:58 +0530 Subject: [PATCH 03/48] bhakti code --- frontend/src/components/Dashboard.jsx | 2 ++ frontend/src/components/Navbar.jsx | 48 +++++++++++++++++++++++++++ 2 files changed, 50 insertions(+) create mode 100644 frontend/src/components/Navbar.jsx diff --git a/frontend/src/components/Dashboard.jsx b/frontend/src/components/Dashboard.jsx index c54de5d..5de9f03 100644 --- a/frontend/src/components/Dashboard.jsx +++ b/frontend/src/components/Dashboard.jsx @@ -2,10 +2,12 @@ import React from 'react' import DashboardCards from './DashboardCards' import Sidebar from './Sidebar' import BookedAppointments from './BookedAppointments' +import Navbar from './Navbar' const Dashboard = () => { return (
Dashboard + diff --git a/frontend/src/components/Navbar.jsx b/frontend/src/components/Navbar.jsx new file mode 100644 index 0000000..f6d09d8 --- /dev/null +++ b/frontend/src/components/Navbar.jsx @@ -0,0 +1,48 @@ +import { FaSearch, FaBell, FaShoppingCart, FaUser } from "react-icons/fa"; + +const Navbar = () => { + return ( + + ); +}; + +export default Navbar; From e931020159743f391f494aba8c4827f1929bc024 Mon Sep 17 00:00:00 2001 From: buggarajesh Date: Wed, 5 Mar 2025 23:57:51 +0530 Subject: [PATCH 04/48] all changes done --- .../src/components/BookedAppointments.jsx | 8 ++++---- frontend/src/components/Dashboard.jsx | 4 +++- frontend/src/components/DashboardCards.jsx | 14 +++++++------ frontend/src/components/Sidebar.jsx | 20 +++++++++++++++---- 4 files changed, 31 insertions(+), 15 deletions(-) diff --git a/frontend/src/components/BookedAppointments.jsx b/frontend/src/components/BookedAppointments.jsx index 4ef8629..20f2b1d 100644 --- a/frontend/src/components/BookedAppointments.jsx +++ b/frontend/src/components/BookedAppointments.jsx @@ -16,11 +16,11 @@ export default function BookedAppointments() { }; return ( -
+
{/* Header Section */}

Booked Appointment

-
@@ -29,7 +29,7 @@ export default function BookedAppointments() {
- + @@ -40,7 +40,7 @@ export default function BookedAppointments() { {appointments.map((appointment) => ( - + diff --git a/frontend/src/components/Dashboard.jsx b/frontend/src/components/Dashboard.jsx index 5de9f03..a9b2d4c 100644 --- a/frontend/src/components/Dashboard.jsx +++ b/frontend/src/components/Dashboard.jsx @@ -6,9 +6,11 @@ import Navbar from './Navbar' const Dashboard = () => { return ( -
Dashboard +
+

Dashboard

+
diff --git a/frontend/src/components/DashboardCards.jsx b/frontend/src/components/DashboardCards.jsx index 5c37e72..652f38d 100644 --- a/frontend/src/components/DashboardCards.jsx +++ b/frontend/src/components/DashboardCards.jsx @@ -4,10 +4,12 @@ import { faCalendarCheck, faUserPlus, faProcedures, faDollarSign, faArrowUp } fr const DashboardCards = () => { return ( -
-
+
+ +
{/* Appointments Card */} -
+ +

Appointments

@@ -21,7 +23,7 @@ const DashboardCards = () => {
{/* New Patients Card */} -
+

New Patients

@@ -35,7 +37,7 @@ const DashboardCards = () => {
{/* Operations Card */} -
+

Operations

@@ -49,7 +51,7 @@ const DashboardCards = () => {
{/* HPL Earning Card */} -
+

HPL Earning

diff --git a/frontend/src/components/Sidebar.jsx b/frontend/src/components/Sidebar.jsx index 3f79561..549ec77 100644 --- a/frontend/src/components/Sidebar.jsx +++ b/frontend/src/components/Sidebar.jsx @@ -14,6 +14,16 @@ import { export default function Sidebar() { return (
+
+

+ You Medi + Medical Icon +

+
{/* Menu Items */}
); -} +}; -function MenuItem({ icon, label, active }) { - return ( -
- {icon} - {label} - -
- ); -} +export default Sidebar; From f47f6bff449d20a63e78d1b118d7e0bddcb6bd6b Mon Sep 17 00:00:00 2001 From: dinesh bharati Date: Thu, 6 Mar 2025 15:54:42 +0530 Subject: [PATCH 06/48] patient and chart added --- frontend/package-lock.json | 356 +++++++++++++++++++++++++++- frontend/package.json | 1 + frontend/src/components/Chart.jsx | 79 ++++++ frontend/src/components/Patient.jsx | 178 ++++++++++++++ 4 files changed, 613 insertions(+), 1 deletion(-) create mode 100644 frontend/src/components/Chart.jsx create mode 100644 frontend/src/components/Patient.jsx diff --git a/frontend/package-lock.json b/frontend/package-lock.json index cdc2ac5..2f18663 100644 --- a/frontend/package-lock.json +++ b/frontend/package-lock.json @@ -16,6 +16,7 @@ "react": "^19.0.0", "react-dom": "^19.0.0", "react-icons": "^5.5.0", + "recharts": "^2.15.1", "tailwindcss": "^4.0.9" }, "devDependencies": { @@ -268,6 +269,18 @@ "@babel/core": "^7.0.0-0" } }, + "node_modules/@babel/runtime": { + "version": "7.26.9", + "resolved": "https://registry.npmjs.org/@babel/runtime/-/runtime-7.26.9.tgz", + "integrity": "sha512-aA63XwOkcl4xxQa3HjPMqOP6LiK0ZDv3mUPYEFXkpHbaFjtGggE1A61FjFzJnB+p7/oy2gA8E+rcBNl/zC1tMg==", + "license": "MIT", + "dependencies": { + "regenerator-runtime": "^0.14.0" + }, + "engines": { + "node": ">=6.9.0" + } + }, "node_modules/@babel/template": { "version": "7.26.9", "resolved": "https://registry.npmjs.org/@babel/template/-/template-7.26.9.tgz", @@ -1573,6 +1586,69 @@ "@babel/types": "^7.20.7" } }, + "node_modules/@types/d3-array": { + "version": "3.2.1", + "resolved": "https://registry.npmjs.org/@types/d3-array/-/d3-array-3.2.1.tgz", + "integrity": "sha512-Y2Jn2idRrLzUfAKV2LyRImR+y4oa2AntrgID95SHJxuMUrkNXmanDSed71sRNZysveJVt1hLLemQZIady0FpEg==", + "license": "MIT" + }, + "node_modules/@types/d3-color": { + "version": "3.1.3", + "resolved": "https://registry.npmjs.org/@types/d3-color/-/d3-color-3.1.3.tgz", + "integrity": "sha512-iO90scth9WAbmgv7ogoq57O9YpKmFBbmoEoCHDB2xMBY0+/KVrqAaCDyCE16dUspeOvIxFFRI+0sEtqDqy2b4A==", + "license": "MIT" + }, + "node_modules/@types/d3-ease": { + "version": "3.0.2", + "resolved": "https://registry.npmjs.org/@types/d3-ease/-/d3-ease-3.0.2.tgz", + "integrity": "sha512-NcV1JjO5oDzoK26oMzbILE6HW7uVXOHLQvHshBUW4UMdZGfiY6v5BeQwh9a9tCzv+CeefZQHJt5SRgK154RtiA==", + "license": "MIT" + }, + "node_modules/@types/d3-interpolate": { + "version": "3.0.4", + "resolved": "https://registry.npmjs.org/@types/d3-interpolate/-/d3-interpolate-3.0.4.tgz", + "integrity": "sha512-mgLPETlrpVV1YRJIglr4Ez47g7Yxjl1lj7YKsiMCb27VJH9W8NVM6Bb9d8kkpG/uAQS5AmbA48q2IAolKKo1MA==", + "license": "MIT", + "dependencies": { + "@types/d3-color": "*" + } + }, + "node_modules/@types/d3-path": { + "version": "3.1.1", + "resolved": "https://registry.npmjs.org/@types/d3-path/-/d3-path-3.1.1.tgz", + "integrity": "sha512-VMZBYyQvbGmWyWVea0EHs/BwLgxc+MKi1zLDCONksozI4YJMcTt8ZEuIR4Sb1MMTE8MMW49v0IwI5+b7RmfWlg==", + "license": "MIT" + }, + "node_modules/@types/d3-scale": { + "version": "4.0.9", + "resolved": "https://registry.npmjs.org/@types/d3-scale/-/d3-scale-4.0.9.tgz", + "integrity": "sha512-dLmtwB8zkAeO/juAMfnV+sItKjlsw2lKdZVVy6LRr0cBmegxSABiLEpGVmSJJ8O08i4+sGR6qQtb6WtuwJdvVw==", + "license": "MIT", + "dependencies": { + "@types/d3-time": "*" + } + }, + "node_modules/@types/d3-shape": { + "version": "3.1.7", + "resolved": "https://registry.npmjs.org/@types/d3-shape/-/d3-shape-3.1.7.tgz", + "integrity": "sha512-VLvUQ33C+3J+8p+Daf+nYSOsjB4GXp19/S/aGo60m9h1v6XaxjiT82lKVWJCfzhtuZ3yD7i/TPeC/fuKLLOSmg==", + "license": "MIT", + "dependencies": { + "@types/d3-path": "*" + } + }, + "node_modules/@types/d3-time": { + "version": "3.0.4", + "resolved": "https://registry.npmjs.org/@types/d3-time/-/d3-time-3.0.4.tgz", + "integrity": "sha512-yuzZug1nkAAaBlBBikKZTgzCeA+k1uy4ZFwWANOfKw5z5LRhV0gNA7gNkKm7HoK+HRN0wX3EkxGk0fpbWhmB7g==", + "license": "MIT" + }, + "node_modules/@types/d3-timer": { + "version": "3.0.2", + "resolved": "https://registry.npmjs.org/@types/d3-timer/-/d3-timer-3.0.2.tgz", + "integrity": "sha512-Ps3T8E8dZDam6fUyNiMkekK3XUsaUEik+idO9/YjPtfj2qruF8tFBXS7XhtE4iIXBLxhmLjP3SXpLhVf21I9Lw==", + "license": "MIT" + }, "node_modules/@types/estree": { "version": "1.0.6", "resolved": "https://registry.npmjs.org/@types/estree/-/estree-1.0.6.tgz", @@ -1788,6 +1864,15 @@ "url": "https://github.com/chalk/chalk?sponsor=1" } }, + "node_modules/clsx": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/clsx/-/clsx-2.1.1.tgz", + "integrity": "sha512-eYm0QWBtUrBWZWG0d386OGAw16Z995PiOVo2B7bjWSbHedGl5e0ZWaq65kOGgUSNesEIDkB9ISbTg/JK9dhCZA==", + "license": "MIT", + "engines": { + "node": ">=6" + } + }, "node_modules/color-convert": { "version": "2.0.1", "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz", @@ -1841,9 +1926,129 @@ "version": "3.1.3", "resolved": "https://registry.npmjs.org/csstype/-/csstype-3.1.3.tgz", "integrity": "sha512-M1uQkMl8rQK/szD0LNhtqxIPLpimGm8sOBwU7lLnCpSbTyY3yeU1Vc7l4KT5zT4s/yOxHH5O7tIuuLOCnLADRw==", - "dev": true, "license": "MIT" }, + "node_modules/d3-array": { + "version": "3.2.4", + "resolved": "https://registry.npmjs.org/d3-array/-/d3-array-3.2.4.tgz", + "integrity": "sha512-tdQAmyA18i4J7wprpYq8ClcxZy3SC31QMeByyCFyRt7BVHdREQZ5lpzoe5mFEYZUWe+oq8HBvk9JjpibyEV4Jg==", + "license": "ISC", + "dependencies": { + "internmap": "1 - 2" + }, + "engines": { + "node": ">=12" + } + }, + "node_modules/d3-color": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/d3-color/-/d3-color-3.1.0.tgz", + "integrity": "sha512-zg/chbXyeBtMQ1LbD/WSoW2DpC3I0mpmPdW+ynRTj/x2DAWYrIY7qeZIHidozwV24m4iavr15lNwIwLxRmOxhA==", + "license": "ISC", + "engines": { + "node": ">=12" + } + }, + "node_modules/d3-ease": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/d3-ease/-/d3-ease-3.0.1.tgz", + "integrity": "sha512-wR/XK3D3XcLIZwpbvQwQ5fK+8Ykds1ip7A2Txe0yxncXSdq1L9skcG7blcedkOX+ZcgxGAmLX1FrRGbADwzi0w==", + "license": "BSD-3-Clause", + "engines": { + "node": ">=12" + } + }, + "node_modules/d3-format": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/d3-format/-/d3-format-3.1.0.tgz", + "integrity": "sha512-YyUI6AEuY/Wpt8KWLgZHsIU86atmikuoOmCfommt0LYHiQSPjvX2AcFc38PX0CBpr2RCyZhjex+NS/LPOv6YqA==", + "license": "ISC", + "engines": { + "node": ">=12" + } + }, + "node_modules/d3-interpolate": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/d3-interpolate/-/d3-interpolate-3.0.1.tgz", + "integrity": "sha512-3bYs1rOD33uo8aqJfKP3JWPAibgw8Zm2+L9vBKEHJ2Rg+viTR7o5Mmv5mZcieN+FRYaAOWX5SJATX6k1PWz72g==", + "license": "ISC", + "dependencies": { + "d3-color": "1 - 3" + }, + "engines": { + "node": ">=12" + } + }, + "node_modules/d3-path": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/d3-path/-/d3-path-3.1.0.tgz", + "integrity": "sha512-p3KP5HCf/bvjBSSKuXid6Zqijx7wIfNW+J/maPs+iwR35at5JCbLUT0LzF1cnjbCHWhqzQTIN2Jpe8pRebIEFQ==", + "license": "ISC", + "engines": { + "node": ">=12" + } + }, + "node_modules/d3-scale": { + "version": "4.0.2", + "resolved": "https://registry.npmjs.org/d3-scale/-/d3-scale-4.0.2.tgz", + "integrity": "sha512-GZW464g1SH7ag3Y7hXjf8RoUuAFIqklOAq3MRl4OaWabTFJY9PN/E1YklhXLh+OQ3fM9yS2nOkCoS+WLZ6kvxQ==", + "license": "ISC", + "dependencies": { + "d3-array": "2.10.0 - 3", + "d3-format": "1 - 3", + "d3-interpolate": "1.2.0 - 3", + "d3-time": "2.1.1 - 3", + "d3-time-format": "2 - 4" + }, + "engines": { + "node": ">=12" + } + }, + "node_modules/d3-shape": { + "version": "3.2.0", + "resolved": "https://registry.npmjs.org/d3-shape/-/d3-shape-3.2.0.tgz", + "integrity": "sha512-SaLBuwGm3MOViRq2ABk3eLoxwZELpH6zhl3FbAoJ7Vm1gofKx6El1Ib5z23NUEhF9AsGl7y+dzLe5Cw2AArGTA==", + "license": "ISC", + "dependencies": { + "d3-path": "^3.1.0" + }, + "engines": { + "node": ">=12" + } + }, + "node_modules/d3-time": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/d3-time/-/d3-time-3.1.0.tgz", + "integrity": "sha512-VqKjzBLejbSMT4IgbmVgDjpkYrNWUYJnbCGo874u7MMKIWsILRX+OpX/gTk8MqjpT1A/c6HY2dCA77ZN0lkQ2Q==", + "license": "ISC", + "dependencies": { + "d3-array": "2 - 3" + }, + "engines": { + "node": ">=12" + } + }, + "node_modules/d3-time-format": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/d3-time-format/-/d3-time-format-4.1.0.tgz", + "integrity": "sha512-dJxPBlzC7NugB2PDLwo9Q8JiTR3M3e4/XANkreKSUxF8vvXKqm1Yfq4Q5dl8budlunRVlUUaDUgFt7eA8D6NLg==", + "license": "ISC", + "dependencies": { + "d3-time": "1 - 3" + }, + "engines": { + "node": ">=12" + } + }, + "node_modules/d3-timer": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/d3-timer/-/d3-timer-3.0.1.tgz", + "integrity": "sha512-ndfJ/JxxMd3nw31uyKoY2naivF+r29V+Lc0svZxe1JvvIRmi8hUsrMvdOwgS1o6uBHmiz91geQ0ylPP0aj1VUA==", + "license": "ISC", + "engines": { + "node": ">=12" + } + }, "node_modules/debug": { "version": "4.4.0", "resolved": "https://registry.npmjs.org/debug/-/debug-4.4.0.tgz", @@ -1862,6 +2067,12 @@ } } }, + "node_modules/decimal.js-light": { + "version": "2.5.1", + "resolved": "https://registry.npmjs.org/decimal.js-light/-/decimal.js-light-2.5.1.tgz", + "integrity": "sha512-qIMFpTMZmny+MMIitAB6D7iVPEorVw6YQRWkvarTkT4tBeSLLiHzcwj6q0MmYSFCiVpiqPJTJEYIrpcPzVEIvg==", + "license": "MIT" + }, "node_modules/deep-is": { "version": "0.1.4", "resolved": "https://registry.npmjs.org/deep-is/-/deep-is-0.1.4.tgz", @@ -1881,6 +2092,16 @@ "node": ">=0.10" } }, + "node_modules/dom-helpers": { + "version": "5.2.1", + "resolved": "https://registry.npmjs.org/dom-helpers/-/dom-helpers-5.2.1.tgz", + "integrity": "sha512-nRCa7CK3VTrM2NmGkIy4cbK7IZlgBE/PYMn55rrXefr5xXDP0LdtfPnblFDoVdcAfslJ7or6iqAUnx0CCGIWQA==", + "license": "MIT", + "dependencies": { + "@babel/runtime": "^7.8.7", + "csstype": "^3.0.2" + } + }, "node_modules/electron-to-chromium": { "version": "1.5.111", "resolved": "https://registry.npmjs.org/electron-to-chromium/-/electron-to-chromium-1.5.111.tgz", @@ -2141,6 +2362,12 @@ "node": ">=0.10.0" } }, + "node_modules/eventemitter3": { + "version": "4.0.7", + "resolved": "https://registry.npmjs.org/eventemitter3/-/eventemitter3-4.0.7.tgz", + "integrity": "sha512-8guHBZCwKnFhYdHr2ysuRWErTwhoN2X8XELRlrRwpmfeY2jjuUN4taQMsULKUVo1K4DvZl+0pgfyoysHxvmvEw==", + "license": "MIT" + }, "node_modules/fast-deep-equal": { "version": "3.1.3", "resolved": "https://registry.npmjs.org/fast-deep-equal/-/fast-deep-equal-3.1.3.tgz", @@ -2148,6 +2375,15 @@ "dev": true, "license": "MIT" }, + "node_modules/fast-equals": { + "version": "5.2.2", + "resolved": "https://registry.npmjs.org/fast-equals/-/fast-equals-5.2.2.tgz", + "integrity": "sha512-V7/RktU11J3I36Nwq2JnZEM7tNm17eBJz+u25qdxBZeCKiX6BkVSZQjwWIr+IobgnZy+ag73tTZgZi7tr0LrBw==", + "license": "MIT", + "engines": { + "node": ">=6.0.0" + } + }, "node_modules/fast-json-stable-stringify": { "version": "2.1.0", "resolved": "https://registry.npmjs.org/fast-json-stable-stringify/-/fast-json-stable-stringify-2.1.0.tgz", @@ -2316,6 +2552,15 @@ "node": ">=0.8.19" } }, + "node_modules/internmap": { + "version": "2.0.3", + "resolved": "https://registry.npmjs.org/internmap/-/internmap-2.0.3.tgz", + "integrity": "sha512-5Hh7Y1wQbvY5ooGgPbDaL5iYLAPzMTUrjMulskHLH6wnv/A+1q5rgEaiuqEjB+oxGXIVZs1FF+R/KPN3ZSQYYg==", + "license": "ISC", + "engines": { + "node": ">=12" + } + }, "node_modules/is-extglob": { "version": "2.1.1", "resolved": "https://registry.npmjs.org/is-extglob/-/is-extglob-2.1.1.tgz", @@ -2689,6 +2934,12 @@ "url": "https://github.com/sponsors/sindresorhus" } }, + "node_modules/lodash": { + "version": "4.17.21", + "resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.21.tgz", + "integrity": "sha512-v2kDEe57lecTulaDIuNTPy3Ry4gLGJ6Z1O3vE1krgXZNrsQ+LFTGHVxVjcXPs17LhbZVGedAJv8XZ1tvj5FvSg==", + "license": "MIT" + }, "node_modules/lodash.merge": { "version": "4.6.2", "resolved": "https://registry.npmjs.org/lodash.merge/-/lodash.merge-4.6.2.tgz", @@ -2973,6 +3224,81 @@ "node": ">=0.10.0" } }, + "node_modules/react-smooth": { + "version": "4.0.4", + "resolved": "https://registry.npmjs.org/react-smooth/-/react-smooth-4.0.4.tgz", + "integrity": "sha512-gnGKTpYwqL0Iii09gHobNolvX4Kiq4PKx6eWBCYYix+8cdw+cGo3do906l1NBPKkSWx1DghC1dlWG9L2uGd61Q==", + "license": "MIT", + "dependencies": { + "fast-equals": "^5.0.1", + "prop-types": "^15.8.1", + "react-transition-group": "^4.4.5" + }, + "peerDependencies": { + "react": "^16.8.0 || ^17.0.0 || ^18.0.0 || ^19.0.0", + "react-dom": "^16.8.0 || ^17.0.0 || ^18.0.0 || ^19.0.0" + } + }, + "node_modules/react-transition-group": { + "version": "4.4.5", + "resolved": "https://registry.npmjs.org/react-transition-group/-/react-transition-group-4.4.5.tgz", + "integrity": "sha512-pZcd1MCJoiKiBR2NRxeCRg13uCXbydPnmB4EOeRrY7480qNWO8IIgQG6zlDkm6uRMsURXPuKq0GWtiM59a5Q6g==", + "license": "BSD-3-Clause", + "dependencies": { + "@babel/runtime": "^7.5.5", + "dom-helpers": "^5.0.1", + "loose-envify": "^1.4.0", + "prop-types": "^15.6.2" + }, + "peerDependencies": { + "react": ">=16.6.0", + "react-dom": ">=16.6.0" + } + }, + "node_modules/recharts": { + "version": "2.15.1", + "resolved": "https://registry.npmjs.org/recharts/-/recharts-2.15.1.tgz", + "integrity": "sha512-v8PUTUlyiDe56qUj82w/EDVuzEFXwEHp9/xOowGAZwfLjB9uAy3GllQVIYMWF6nU+qibx85WF75zD7AjqoT54Q==", + "license": "MIT", + "dependencies": { + "clsx": "^2.0.0", + "eventemitter3": "^4.0.1", + "lodash": "^4.17.21", + "react-is": "^18.3.1", + "react-smooth": "^4.0.4", + "recharts-scale": "^0.4.4", + "tiny-invariant": "^1.3.1", + "victory-vendor": "^36.6.8" + }, + "engines": { + "node": ">=14" + }, + "peerDependencies": { + "react": "^16.0.0 || ^17.0.0 || ^18.0.0 || ^19.0.0", + "react-dom": "^16.0.0 || ^17.0.0 || ^18.0.0 || ^19.0.0" + } + }, + "node_modules/recharts-scale": { + "version": "0.4.5", + "resolved": "https://registry.npmjs.org/recharts-scale/-/recharts-scale-0.4.5.tgz", + "integrity": "sha512-kivNFO+0OcUNu7jQquLXAxz1FIwZj8nrj+YkOKc5694NbjCvcT6aSZiIzNzd2Kul4o4rTto8QVR9lMNtxD4G1w==", + "license": "MIT", + "dependencies": { + "decimal.js-light": "^2.4.1" + } + }, + "node_modules/recharts/node_modules/react-is": { + "version": "18.3.1", + "resolved": "https://registry.npmjs.org/react-is/-/react-is-18.3.1.tgz", + "integrity": "sha512-/LLMVyas0ljjAtoYiPqYiL8VWXzUUdThrmU5+n20DZv+a+ClRoevUzw5JxU+Ieh5/c87ytoTBV9G1FiKfNJdmg==", + "license": "MIT" + }, + "node_modules/regenerator-runtime": { + "version": "0.14.1", + "resolved": "https://registry.npmjs.org/regenerator-runtime/-/regenerator-runtime-0.14.1.tgz", + "integrity": "sha512-dYnhHh0nJoMfnkZs6GmmhFknAGRrLznOu5nc9ML+EJxGvrx6H7teuevqVqCuPcPK//3eDrrjQhehXVx9cnkGdw==", + "license": "MIT" + }, "node_modules/resolve-from": { "version": "4.0.0", "resolved": "https://registry.npmjs.org/resolve-from/-/resolve-from-4.0.0.tgz", @@ -3110,6 +3436,12 @@ "node": ">=6" } }, + "node_modules/tiny-invariant": { + "version": "1.3.3", + "resolved": "https://registry.npmjs.org/tiny-invariant/-/tiny-invariant-1.3.3.tgz", + "integrity": "sha512-+FbBPE1o9QAYvviau/qC5SE3caw21q3xkvWKBtja5vgqOWIHHJ3ioaq1VPfn/Szqctz2bU/oYeKd9/z5BL+PVg==", + "license": "MIT" + }, "node_modules/type-check": { "version": "0.4.0", "resolved": "https://registry.npmjs.org/type-check/-/type-check-0.4.0.tgz", @@ -3164,6 +3496,28 @@ "punycode": "^2.1.0" } }, + "node_modules/victory-vendor": { + "version": "36.9.2", + "resolved": "https://registry.npmjs.org/victory-vendor/-/victory-vendor-36.9.2.tgz", + "integrity": "sha512-PnpQQMuxlwYdocC8fIJqVXvkeViHYzotI+NJrCuav0ZYFoq912ZHBk3mCeuj+5/VpodOjPe1z0Fk2ihgzlXqjQ==", + "license": "MIT AND ISC", + "dependencies": { + "@types/d3-array": "^3.0.3", + "@types/d3-ease": "^3.0.0", + "@types/d3-interpolate": "^3.0.1", + "@types/d3-scale": "^4.0.2", + "@types/d3-shape": "^3.1.0", + "@types/d3-time": "^3.0.0", + "@types/d3-timer": "^3.0.0", + "d3-array": "^3.1.6", + "d3-ease": "^3.0.1", + "d3-interpolate": "^3.0.1", + "d3-scale": "^4.0.2", + "d3-shape": "^3.1.0", + "d3-time": "^3.0.0", + "d3-timer": "^3.0.1" + } + }, "node_modules/vite": { "version": "6.2.0", "resolved": "https://registry.npmjs.org/vite/-/vite-6.2.0.tgz", diff --git a/frontend/package.json b/frontend/package.json index d8d5205..b58f75b 100644 --- a/frontend/package.json +++ b/frontend/package.json @@ -18,6 +18,7 @@ "react": "^19.0.0", "react-dom": "^19.0.0", "react-icons": "^5.5.0", + "recharts": "^2.15.1", "tailwindcss": "^4.0.9" }, "devDependencies": { diff --git a/frontend/src/components/Chart.jsx b/frontend/src/components/Chart.jsx new file mode 100644 index 0000000..9360305 --- /dev/null +++ b/frontend/src/components/Chart.jsx @@ -0,0 +1,79 @@ +import React from "react"; +import { PieChart, Pie, Cell, Tooltip, Legend } from "recharts"; + +const Chart = () => { + const data = [ + { name: "Dental", value: 125, color: "#00C49F" }, + { name: "Medicine", value: 25, color: "#FFA500" }, + { name: "Cardiology", value: 50, color: "#0088FE" }, + ]; + + const total = data.reduce((sum, entry) => sum + entry.value, 0); // Calculate total + + const processedData = data.map((entry) => ({ + ...entry, + percentage: ((entry.value / total) * 100).toFixed(1), // Calculate percentage + })); + + const renderCustomizedLabel = ({ cx, cy, midAngle, outerRadius, percent, name }) => { + const RADIAN = Math.PI / 180; + const x = cx + (outerRadius + 20) * Math.cos(-midAngle * RADIAN); + const y = cy + (outerRadius + 20) * Math.sin(-midAngle * RADIAN); + + return ( + cx ? "start" : "end"} fontSize={12}> + {name} + + {`${(percent * 100).toFixed(1)}%`} + + + ); + }; + + // Custom Legend Component + const renderLegend = (props) => { + const { payload } = props; + return ( +
    + {payload.map((entry, index) => ( +
  • + + {entry.value} {entry.payload.value} +
  • + ))} +
+ ); + }; + + + return ( +
+

Patients By Department

+ + + {processedData.map((entry, index) => ( + + ))} + + + + +

{total} Total

+
+ ); +}; + +export default Chart; diff --git a/frontend/src/components/Patient.jsx b/frontend/src/components/Patient.jsx new file mode 100644 index 0000000..227464e --- /dev/null +++ b/frontend/src/components/Patient.jsx @@ -0,0 +1,178 @@ +import React, { useState, useEffect } from "react"; + +const Patient = () => { + const [searchQuery, setSearchQuery] = useState(""); + const [currentPage, setCurrentPage] = useState(1); + const [patients, setPatients] = useState( + Array(20).fill(null).map((_, index) => ({ + id: index + 1, + name: "Patient " + (index + 1), + age: 20 + (index % 5), + gender: index % 2 === 0 ? "Male" : "Female", + appointment: "2024-08-13 08:30", + doctorAssigned: "Dr. Smith" + })) + ); + const [showForm, setShowForm] = useState(false); + const [newPatient, setNewPatient] = useState({ + name: "", + age: "", + gender: "Male", + appointment: "", + doctorAssigned: "" + }); + + const itemsPerPage = 10; + const filteredPatients = patients.filter((patient) => + patient.name.toLowerCase().includes(searchQuery.toLowerCase()) + ); + const totalPages = Math.ceil(filteredPatients.length / itemsPerPage); + const startIndex = (currentPage - 1) * itemsPerPage; + const paginatedPatients = filteredPatients.reverse().slice(startIndex, startIndex + itemsPerPage); + + const handleAddNew = () => { + setShowForm(true); + }; + + useEffect(() => { + setCurrentPage(1); + }, [searchQuery]); + + const handleSubmit = (e) => { + e.preventDefault(); + setPatients([...patients, { id: patients.length + 1, ...newPatient }]); + setShowForm(false); + setNewPatient({ name: "", age: "", gender: "Male", appointment: "", doctorAssigned: "" }); + }; + + return ( +
+
+
+

Patient List

+ +
+ +
+ setSearchQuery(e.target.value)} + /> + +
+ + {showForm && ( +
+
+ setNewPatient({ ...newPatient, name: e.target.value })} + required + /> + setNewPatient({ ...newPatient, age: e.target.value })} + required + /> + + setNewPatient({ ...newPatient, appointment: e.target.value })} + required + /> + setNewPatient({ ...newPatient, doctorAssigned: e.target.value })} + required + /> + + +
+ + )} + +
Select Patient Name Assigned Doctor
{appointment.name} {appointment.doctor}
+ + + + + + + + + + + + {paginatedPatients.length > 0 ? ( + paginatedPatients.map((patient, index) => ( + + + + + + + + + )) + ) : ( + + + + )} + +
IDPatient Name ⬇Age ⬇Gender ⬇Appointment ⬇Doctor Assigned ⬇
{patient.id}{patient.name}{patient.age}{patient.gender}{patient.appointment}{patient.doctorAssigned}
+ No results found. +
+ +
+ + {currentPage} of {totalPages} + +
+ +
+
+ ); +}; + +export default Patient; From 0463efefd3e6aa910387af772fecf0816b1dc983 Mon Sep 17 00:00:00 2001 From: dinesh bharati Date: Thu, 6 Mar 2025 17:03:41 +0530 Subject: [PATCH 07/48] patient page updated --- frontend/src/components/Patient.jsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/frontend/src/components/Patient.jsx b/frontend/src/components/Patient.jsx index 227464e..fdbd043 100644 --- a/frontend/src/components/Patient.jsx +++ b/frontend/src/components/Patient.jsx @@ -46,7 +46,7 @@ const Patient = () => { }; return ( -
+

Patient List

From 35c68c629f660f9a93b723b0adfd221bced06080 Mon Sep 17 00:00:00 2001 From: Samruddhi Malvankar Date: Thu, 6 Mar 2025 17:38:19 +0530 Subject: [PATCH 08/48] Initial commit --- frontend/src/App.jsx | 18 +++++++++++++----- frontend/src/components/Dashboard.jsx | 7 ++++--- frontend/src/components/Navbar.jsx | 11 ++++++++++- frontend/src/components/Sidebar.jsx | 6 +----- 4 files changed, 28 insertions(+), 14 deletions(-) diff --git a/frontend/src/App.jsx b/frontend/src/App.jsx index 6ad24ae..228e42e 100644 --- a/frontend/src/App.jsx +++ b/frontend/src/App.jsx @@ -4,11 +4,19 @@ import Dashboard from "./components/Dashboard"; function App() { return ( -
- -
- - +
+ {/* Navbar at the top */} + + + {/* Sidebar + Content */} +
+ {/* Sidebar takes space but does not overlap */} + + + {/* Main content with left margin to avoid overlap */} +
+ +
); diff --git a/frontend/src/components/Dashboard.jsx b/frontend/src/components/Dashboard.jsx index ab66487..d9b4230 100644 --- a/frontend/src/components/Dashboard.jsx +++ b/frontend/src/components/Dashboard.jsx @@ -3,10 +3,11 @@ import { FaUserPlus, FaProcedures, FaDollarSign, FaCalendarCheck, FaTrash, FaEdi const Dashboard = () => { return (
-

Dashboard

+

{/* Stats Cards */} -
+
+ {[ { icon: , title: "Appointments", count: 120, percent: 60, color: "teal" }, { icon: , title: "New Patients", count: 1500, percent: 50, color: "orange" }, @@ -39,7 +40,7 @@ const Dashboard = () => { - {['Patient Name', 'Assigned Doctor', 'Date', 'Time', 'Action'].map((header, index) => ( + {["Patient Name", "Assigned Doctor", "Date", "Time", "Action"].map((header, index) => ( ))} diff --git a/frontend/src/components/Navbar.jsx b/frontend/src/components/Navbar.jsx index 49726c6..1f22b40 100644 --- a/frontend/src/components/Navbar.jsx +++ b/frontend/src/components/Navbar.jsx @@ -2,7 +2,14 @@ import { FaBell, FaShoppingCart, FaSearch } from "react-icons/fa"; const Navbar = () => { return ( -
+
+ {/* Logo */} +
+ You + Medi +
+ + {/* Search Bar */}
{ />
+ + {/* Icons */}
diff --git a/frontend/src/components/Sidebar.jsx b/frontend/src/components/Sidebar.jsx index c75af55..b5cbbbc 100644 --- a/frontend/src/components/Sidebar.jsx +++ b/frontend/src/components/Sidebar.jsx @@ -2,11 +2,7 @@ import { FaHome, FaUserMd, FaCalendarCheck, FaUsers, FaPills, FaChartBar, FaCog, const Sidebar = () => { return ( -
-
- You - Medi -
+
  • From aaf8aa3910d8f700499757a6b39bd18c75ec4747 Mon Sep 17 00:00:00 2001 From: strivervishal Date: Fri, 7 Mar 2025 13:13:41 +0530 Subject: [PATCH 09/48] routing part successfully added and also ui issues fixed --- frontend/package-lock.json | 121 ++++++++------ frontend/package.json | 1 + frontend/src/App.jsx | 31 ++-- frontend/src/components/Appointment.jsx | 13 ++ frontend/src/components/Dashboard.jsx | 211 +++++++++++++++++------- frontend/src/components/Doctor.jsx | 12 ++ frontend/src/components/Patient.jsx | 13 ++ frontend/src/components/Pharmacy.jsx | 13 ++ frontend/src/components/Sidebar.jsx | 37 +++-- frontend/src/main.jsx | 11 +- 10 files changed, 307 insertions(+), 156 deletions(-) create mode 100644 frontend/src/components/Appointment.jsx create mode 100644 frontend/src/components/Doctor.jsx create mode 100644 frontend/src/components/Patient.jsx create mode 100644 frontend/src/components/Pharmacy.jsx diff --git a/frontend/package-lock.json b/frontend/package-lock.json index 5746a9b..5b5cb97 100644 --- a/frontend/package-lock.json +++ b/frontend/package-lock.json @@ -17,6 +17,7 @@ "react": "^19.0.0", "react-dom": "^19.0.0", "react-icons": "^5.5.0", + "react-router-dom": "^7.3.0", "tailwindcss": "^4.0.9" }, "devDependencies": { @@ -334,7 +335,6 @@ "cpu": [ "ppc64" ], - "dev": true, "license": "MIT", "optional": true, "os": [ @@ -351,7 +351,6 @@ "cpu": [ "arm" ], - "dev": true, "license": "MIT", "optional": true, "os": [ @@ -368,7 +367,6 @@ "cpu": [ "arm64" ], - "dev": true, "license": "MIT", "optional": true, "os": [ @@ -385,7 +383,6 @@ "cpu": [ "x64" ], - "dev": true, "license": "MIT", "optional": true, "os": [ @@ -402,7 +399,6 @@ "cpu": [ "arm64" ], - "dev": true, "license": "MIT", "optional": true, "os": [ @@ -419,7 +415,6 @@ "cpu": [ "x64" ], - "dev": true, "license": "MIT", "optional": true, "os": [ @@ -436,7 +431,6 @@ "cpu": [ "arm64" ], - "dev": true, "license": "MIT", "optional": true, "os": [ @@ -453,7 +447,6 @@ "cpu": [ "x64" ], - "dev": true, "license": "MIT", "optional": true, "os": [ @@ -470,7 +463,6 @@ "cpu": [ "arm" ], - "dev": true, "license": "MIT", "optional": true, "os": [ @@ -487,7 +479,6 @@ "cpu": [ "arm64" ], - "dev": true, "license": "MIT", "optional": true, "os": [ @@ -504,7 +495,6 @@ "cpu": [ "ia32" ], - "dev": true, "license": "MIT", "optional": true, "os": [ @@ -521,7 +511,6 @@ "cpu": [ "loong64" ], - "dev": true, "license": "MIT", "optional": true, "os": [ @@ -538,7 +527,6 @@ "cpu": [ "mips64el" ], - "dev": true, "license": "MIT", "optional": true, "os": [ @@ -555,7 +543,6 @@ "cpu": [ "ppc64" ], - "dev": true, "license": "MIT", "optional": true, "os": [ @@ -572,7 +559,6 @@ "cpu": [ "riscv64" ], - "dev": true, "license": "MIT", "optional": true, "os": [ @@ -589,7 +575,6 @@ "cpu": [ "s390x" ], - "dev": true, "license": "MIT", "optional": true, "os": [ @@ -606,7 +591,6 @@ "cpu": [ "x64" ], - "dev": true, "license": "MIT", "optional": true, "os": [ @@ -623,7 +607,6 @@ "cpu": [ "arm64" ], - "dev": true, "license": "MIT", "optional": true, "os": [ @@ -640,7 +623,6 @@ "cpu": [ "x64" ], - "dev": true, "license": "MIT", "optional": true, "os": [ @@ -657,7 +639,6 @@ "cpu": [ "arm64" ], - "dev": true, "license": "MIT", "optional": true, "os": [ @@ -674,7 +655,6 @@ "cpu": [ "x64" ], - "dev": true, "license": "MIT", "optional": true, "os": [ @@ -691,7 +671,6 @@ "cpu": [ "x64" ], - "dev": true, "license": "MIT", "optional": true, "os": [ @@ -708,7 +687,6 @@ "cpu": [ "arm64" ], - "dev": true, "license": "MIT", "optional": true, "os": [ @@ -725,7 +703,6 @@ "cpu": [ "ia32" ], - "dev": true, "license": "MIT", "optional": true, "os": [ @@ -742,7 +719,6 @@ "cpu": [ "x64" ], - "dev": true, "license": "MIT", "optional": true, "os": [ @@ -1089,7 +1065,6 @@ "cpu": [ "arm" ], - "dev": true, "license": "MIT", "optional": true, "os": [ @@ -1103,7 +1078,6 @@ "cpu": [ "arm64" ], - "dev": true, "license": "MIT", "optional": true, "os": [ @@ -1117,7 +1091,6 @@ "cpu": [ "arm64" ], - "dev": true, "license": "MIT", "optional": true, "os": [ @@ -1131,7 +1104,6 @@ "cpu": [ "x64" ], - "dev": true, "license": "MIT", "optional": true, "os": [ @@ -1145,7 +1117,6 @@ "cpu": [ "arm64" ], - "dev": true, "license": "MIT", "optional": true, "os": [ @@ -1159,7 +1130,6 @@ "cpu": [ "x64" ], - "dev": true, "license": "MIT", "optional": true, "os": [ @@ -1173,7 +1143,6 @@ "cpu": [ "arm" ], - "dev": true, "license": "MIT", "optional": true, "os": [ @@ -1187,7 +1156,6 @@ "cpu": [ "arm" ], - "dev": true, "license": "MIT", "optional": true, "os": [ @@ -1201,7 +1169,6 @@ "cpu": [ "arm64" ], - "dev": true, "license": "MIT", "optional": true, "os": [ @@ -1215,7 +1182,6 @@ "cpu": [ "arm64" ], - "dev": true, "license": "MIT", "optional": true, "os": [ @@ -1229,7 +1195,6 @@ "cpu": [ "loong64" ], - "dev": true, "license": "MIT", "optional": true, "os": [ @@ -1243,7 +1208,6 @@ "cpu": [ "ppc64" ], - "dev": true, "license": "MIT", "optional": true, "os": [ @@ -1257,7 +1221,6 @@ "cpu": [ "riscv64" ], - "dev": true, "license": "MIT", "optional": true, "os": [ @@ -1271,7 +1234,6 @@ "cpu": [ "s390x" ], - "dev": true, "license": "MIT", "optional": true, "os": [ @@ -1285,7 +1247,6 @@ "cpu": [ "x64" ], - "dev": true, "license": "MIT", "optional": true, "os": [ @@ -1299,7 +1260,6 @@ "cpu": [ "x64" ], - "dev": true, "license": "MIT", "optional": true, "os": [ @@ -1313,7 +1273,6 @@ "cpu": [ "arm64" ], - "dev": true, "license": "MIT", "optional": true, "os": [ @@ -1327,7 +1286,6 @@ "cpu": [ "ia32" ], - "dev": true, "license": "MIT", "optional": true, "os": [ @@ -1341,7 +1299,6 @@ "cpu": [ "x64" ], - "dev": true, "license": "MIT", "optional": true, "os": [ @@ -1617,11 +1574,16 @@ "@babel/types": "^7.20.7" } }, + "node_modules/@types/cookie": { + "version": "0.6.0", + "resolved": "https://registry.npmjs.org/@types/cookie/-/cookie-0.6.0.tgz", + "integrity": "sha512-4Kh9a6B2bQciAhf7FSuMRRkUWecJgJu9nPnx3yzpsfXX/c50REIqpHY4C82bXP90qrLtXtkDxTZosYO3UpOwlA==", + "license": "MIT" + }, "node_modules/@types/estree": { "version": "1.0.6", "resolved": "https://registry.npmjs.org/@types/estree/-/estree-1.0.6.tgz", "integrity": "sha512-AYnb1nQyY49te+VRAVgmzfcgjYS91mY5P0TKUDCLEM+gNnA+3T6rWITXRLYCpahpqSQbN5cE+gHpnPyXjHWxcw==", - "dev": true, "license": "MIT" }, "node_modules/@types/json-schema": { @@ -1867,6 +1829,15 @@ "dev": true, "license": "MIT" }, + "node_modules/cookie": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/cookie/-/cookie-1.0.2.tgz", + "integrity": "sha512-9Kr/j4O16ISv8zBBhJoi4bXOYNTkFLOqSL3UDB0njXxCXNezjeyVrJyGOWtgfs/q2km1gwBcfH8q1yEGoMYunA==", + "license": "MIT", + "engines": { + "node": ">=18" + } + }, "node_modules/cross-spawn": { "version": "7.0.6", "resolved": "https://registry.npmjs.org/cross-spawn/-/cross-spawn-7.0.6.tgz", @@ -1950,7 +1921,6 @@ "version": "0.25.0", "resolved": "https://registry.npmjs.org/esbuild/-/esbuild-0.25.0.tgz", "integrity": "sha512-BXq5mqc8ltbaN34cDqWuYKyNhX8D/Z0J1xdtdQ8UcIIIyJyz+ZMKUt58tF3SrZ85jcfN/PZYhjR5uDQAYNVbuw==", - "dev": true, "hasInstallScript": true, "license": "MIT", "bin": { @@ -2263,7 +2233,6 @@ "version": "2.3.3", "resolved": "https://registry.npmjs.org/fsevents/-/fsevents-2.3.3.tgz", "integrity": "sha512-5xoDfX+fL7faATnagmWPpbFtwh/R77WmMMqqHGS65C3vvB0YHrgF+B1YmZ3441tMj5n63k0212XNoJwzlhffQw==", - "dev": true, "hasInstallScript": true, "license": "MIT", "optional": true, @@ -2789,7 +2758,6 @@ "version": "3.3.8", "resolved": "https://registry.npmjs.org/nanoid/-/nanoid-3.3.8.tgz", "integrity": "sha512-WNLf5Sd8oZxOm+TzppcYk8gVOgP+l58xNy58D0nbUnOxOWRWvlcCV4kUF7ltmI6PsrLl/BgKEyS4mqsGChFN0w==", - "dev": true, "funding": [ { "type": "github", @@ -2914,14 +2882,12 @@ "version": "1.1.1", "resolved": "https://registry.npmjs.org/picocolors/-/picocolors-1.1.1.tgz", "integrity": "sha512-xceH2snhtb5M9liqDsmEw56le376mTZkEX/jEb/RxNFyegNul7eNslCXP9FDj/Lcu0X8KEyMceP2ntpaHrDEVA==", - "dev": true, "license": "ISC" }, "node_modules/postcss": { "version": "8.5.3", "resolved": "https://registry.npmjs.org/postcss/-/postcss-8.5.3.tgz", "integrity": "sha512-dle9A3yYxlBSrt8Fu+IpjGT8SY8hN0mlaA6GY8t0P5PjIOZemULz/E2Bnm/2dcUOena75OTNkHI76uZBNUUq3A==", - "dev": true, "funding": [ { "type": "opencollective", @@ -3023,6 +2989,46 @@ "node": ">=0.10.0" } }, + "node_modules/react-router": { + "version": "7.3.0", + "resolved": "https://registry.npmjs.org/react-router/-/react-router-7.3.0.tgz", + "integrity": "sha512-466f2W7HIWaNXTKM5nHTqNxLrHTyXybm7R0eBlVSt0k/u55tTCDO194OIx/NrYD4TS5SXKTNekXfT37kMKUjgw==", + "license": "MIT", + "dependencies": { + "@types/cookie": "^0.6.0", + "cookie": "^1.0.1", + "set-cookie-parser": "^2.6.0", + "turbo-stream": "2.4.0" + }, + "engines": { + "node": ">=20.0.0" + }, + "peerDependencies": { + "react": ">=18", + "react-dom": ">=18" + }, + "peerDependenciesMeta": { + "react-dom": { + "optional": true + } + } + }, + "node_modules/react-router-dom": { + "version": "7.3.0", + "resolved": "https://registry.npmjs.org/react-router-dom/-/react-router-dom-7.3.0.tgz", + "integrity": "sha512-z7Q5FTiHGgQfEurX/FBinkOXhWREJIAB2RiU24lvcBa82PxUpwqvs/PAXb9lJyPjTs2jrl6UkLvCZVGJPeNuuQ==", + "license": "MIT", + "dependencies": { + "react-router": "7.3.0" + }, + "engines": { + "node": ">=20.0.0" + }, + "peerDependencies": { + "react": ">=18", + "react-dom": ">=18" + } + }, "node_modules/resolve-from": { "version": "4.0.0", "resolved": "https://registry.npmjs.org/resolve-from/-/resolve-from-4.0.0.tgz", @@ -3037,7 +3043,6 @@ "version": "4.34.9", "resolved": "https://registry.npmjs.org/rollup/-/rollup-4.34.9.tgz", "integrity": "sha512-nF5XYqWWp9hx/LrpC8sZvvvmq0TeTjQgaZHYmAgwysT9nh8sWnZhBnM8ZyVbbJFIQBLwHDNoMqsBZBbUo4U8sQ==", - "dev": true, "license": "MIT", "dependencies": { "@types/estree": "1.0.6" @@ -3088,6 +3093,12 @@ "semver": "bin/semver.js" } }, + "node_modules/set-cookie-parser": { + "version": "2.7.1", + "resolved": "https://registry.npmjs.org/set-cookie-parser/-/set-cookie-parser-2.7.1.tgz", + "integrity": "sha512-IOc8uWeOZgnb3ptbCURJWNjWUPcO3ZnTTdzsurqERrP6nPyv+paC55vJM0LpOlT2ne+Ix+9+CRG1MNLlyZ4GjQ==", + "license": "MIT" + }, "node_modules/shebang-command": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/shebang-command/-/shebang-command-2.0.0.tgz", @@ -3115,7 +3126,6 @@ "version": "1.2.1", "resolved": "https://registry.npmjs.org/source-map-js/-/source-map-js-1.2.1.tgz", "integrity": "sha512-UXWMKhLOwVKb728IUtQPXxfYU+usdybtUrK/8uGE8CQMvrhOpwvzDBwj0QhSL7MQc7vIsISBG8VQ8+IDQxpfQA==", - "dev": true, "license": "BSD-3-Clause", "engines": { "node": ">=0.10.0" @@ -3162,6 +3172,12 @@ "node": ">=6" } }, + "node_modules/turbo-stream": { + "version": "2.4.0", + "resolved": "https://registry.npmjs.org/turbo-stream/-/turbo-stream-2.4.0.tgz", + "integrity": "sha512-FHncC10WpBd2eOmGwpmQsWLDoK4cqsA/UT/GqNoaKOQnT8uzhtCbg3EoUDMvqpOSAI0S26mr0rkjzbOO6S3v1g==", + "license": "ISC" + }, "node_modules/type-check": { "version": "0.4.0", "resolved": "https://registry.npmjs.org/type-check/-/type-check-0.4.0.tgz", @@ -3220,7 +3236,6 @@ "version": "6.2.0", "resolved": "https://registry.npmjs.org/vite/-/vite-6.2.0.tgz", "integrity": "sha512-7dPxoo+WsT/64rDcwoOjk76XHj+TqNTIvHKcuMQ1k4/SeHDaQt5GFAeLYzrimZrMpn/O6DtdI03WUjdxuPM0oQ==", - "dev": true, "license": "MIT", "dependencies": { "esbuild": "^0.25.0", diff --git a/frontend/package.json b/frontend/package.json index 93b8960..e1fae42 100644 --- a/frontend/package.json +++ b/frontend/package.json @@ -19,6 +19,7 @@ "react": "^19.0.0", "react-dom": "^19.0.0", "react-icons": "^5.5.0", + "react-router-dom": "^7.3.0", "tailwindcss": "^4.0.9" }, "devDependencies": { diff --git a/frontend/src/App.jsx b/frontend/src/App.jsx index 228e42e..72e9b92 100644 --- a/frontend/src/App.jsx +++ b/frontend/src/App.jsx @@ -1,24 +1,21 @@ -import Sidebar from "./components/Sidebar"; -import Navbar from "./components/Navbar"; +import { Route, Routes } from "react-router-dom"; import Dashboard from "./components/Dashboard"; +import Pharmacy from "./components/Pharmacy"; +import Doctor from "./components/Doctor"; +import Appointment from "./components/Appointment"; +import Patient from "./components/Patient"; function App() { return ( -
    - {/* Navbar at the top */} - - - {/* Sidebar + Content */} -
    - {/* Sidebar takes space but does not overlap */} - - - {/* Main content with left margin to avoid overlap */} -
    - -
    -
    -
    + <> + + } /> + } /> + } /> + } /> + } /> + + ); } diff --git a/frontend/src/components/Appointment.jsx b/frontend/src/components/Appointment.jsx new file mode 100644 index 0000000..d63a3ca --- /dev/null +++ b/frontend/src/components/Appointment.jsx @@ -0,0 +1,13 @@ +import React from 'react' +import Navbar from "./Navbar"; +import Sidebar from "./Sidebar"; +const Appointment = () => { + return ( +
    + + +
    + ); +} + +export default Appointment; \ No newline at end of file diff --git a/frontend/src/components/Dashboard.jsx b/frontend/src/components/Dashboard.jsx index d9b4230..94d8d16 100644 --- a/frontend/src/components/Dashboard.jsx +++ b/frontend/src/components/Dashboard.jsx @@ -1,76 +1,161 @@ -import { FaUserPlus, FaProcedures, FaDollarSign, FaCalendarCheck, FaTrash, FaEdit } from "react-icons/fa"; +import { + FaUserPlus, + FaProcedures, + FaDollarSign, + FaCalendarCheck, + FaTrash, + FaEdit, +} from "react-icons/fa"; +import Sidebar from "../components/Sidebar"; +import Navbar from "../components/Navbar"; const Dashboard = () => { return ( -
    -

    + <> +
    + {/* Navbar at the top */} + - {/* Stats Cards */} -
    + {/* Sidebar + Content */} +
    + {/* Sidebar remains fixed */} + - {[ - { icon: , title: "Appointments", count: 120, percent: 60, color: "teal" }, - { icon: , title: "New Patients", count: 1500, percent: 50, color: "orange" }, - { icon: , title: "Operations", count: 400, percent: 40, color: "blue" }, - { icon: , title: "HPL Earning", count: "$15,500", percent: 20, color: "purple" } - ].map((card, index) => ( -
    -
    - {card.icon} -

    {card.title}

    + {/* Main content area for different pages */} +
    +

    + + {/* Stats Cards */} +
    + {[ + { + icon: , + title: "Appointments", + count: 120, + percent: 60, + color: "teal", + }, + { + icon: , + title: "New Patients", + count: 1500, + percent: 50, + color: "orange", + }, + { + icon: , + title: "Operations", + count: 400, + percent: 40, + color: "blue", + }, + { + icon: , + title: "HPL Earning", + count: "$15,500", + percent: 20, + color: "purple", + }, + ].map((card, index) => ( +
    +
    + {card.icon} +

    {card.title}

    +
    +

    {card.count}

    +
    +
    +
    +

    + ↑ {card.percent}% Vs Last Month +

    +
    + ))}
    -

    {card.count}

    -
    -
    + + {/* Appointments Table */} +
    +
    +

    Scheduled Appointment

    + +
    + +
{header}
+ + + {[ + "Patient Name", + "Assigned Doctor", + "Date", + "Time", + "Action", + ].map((header, index) => ( + + ))} + + + + {[ + { + name: "Shiva Kumar", + doctor: "Dr. Sai Ahmed", + date: "08/03/2025", + time: "08:30", + }, + { + name: "Shashank", + doctor: "Dr. Dinesh Kumar", + date: "13/03/2025", + time: "09:30", + }, + { + name: "Dakshitha Kumari", + doctor: "Dr. Zain Ahmed", + date: "14/03/2025", + time: "10:30", + }, + { + name: "Laila Mahmoud", + doctor: "Dr. Vishal Pandey", + date: "14/03/2025", + time: "08:30", + }, + ].map((appointment, index) => ( + + + + + + + + ))} + +
+ {header} +
{appointment.name}{appointment.doctor}{appointment.date}{appointment.time} + + +
-

↑ {card.percent}% Vs Last Month

- ))} -
- - {/* Appointments Table */} -
-
-

Scheduled Appointment

-
- - - - - {["Patient Name", "Assigned Doctor", "Date", "Time", "Action"].map((header, index) => ( - - ))} - - - - {[ - { name: "Shiva Kumar", doctor: "Dr. Sai Ahmed", date: "08/03/2025", time: "08:30" }, - { name: "Shashank", doctor: "Dr. Dinesh Kumar", date: "13/03/2025", time: "09:30" }, - { name: "Dakshitha Kumari", doctor: "Dr. Zain Ahmed", date: "14/03/2025", time: "10:30" }, - { name: "Laila Mahmoud", doctor: "Dr. Vishal Pandey", date: "14/03/2025", time: "08:30" } - ].map((appointment, index) => ( - - - - - - - - ))} - -
{header}
{appointment.name}{appointment.doctor}{appointment.date}{appointment.time} - - -
-
+ ); }; diff --git a/frontend/src/components/Doctor.jsx b/frontend/src/components/Doctor.jsx new file mode 100644 index 0000000..d60acd8 --- /dev/null +++ b/frontend/src/components/Doctor.jsx @@ -0,0 +1,12 @@ +import React from 'react' +import Navbar from './Navbar'; +import Sidebar from './Sidebar'; + +const Doctor = () => { + return
+ + +
; +} + +export default Doctor \ No newline at end of file diff --git a/frontend/src/components/Patient.jsx b/frontend/src/components/Patient.jsx new file mode 100644 index 0000000..12b730c --- /dev/null +++ b/frontend/src/components/Patient.jsx @@ -0,0 +1,13 @@ +import React from "react"; +import Navbar from "./Navbar"; +import Sidebar from "./Sidebar"; +const Patient = () => { + return ( +
+ + +
+ ); +}; + +export default Patient; diff --git a/frontend/src/components/Pharmacy.jsx b/frontend/src/components/Pharmacy.jsx new file mode 100644 index 0000000..7ecb601 --- /dev/null +++ b/frontend/src/components/Pharmacy.jsx @@ -0,0 +1,13 @@ +import React from "react"; +import Navbar from "./Navbar"; +import Sidebar from "./Sidebar"; +const Pharmacy = () => { + return ( +
+ + +
+ ); +}; + +export default Pharmacy; diff --git a/frontend/src/components/Sidebar.jsx b/frontend/src/components/Sidebar.jsx index b5cbbbc..5a02e21 100644 --- a/frontend/src/components/Sidebar.jsx +++ b/frontend/src/components/Sidebar.jsx @@ -1,47 +1,48 @@ import { FaHome, FaUserMd, FaCalendarCheck, FaUsers, FaPills, FaChartBar, FaCog, FaQuestionCircle, FaSignOutAlt } from "react-icons/fa"; +import { Link } from "react-router-dom"; const Sidebar = () => { return (
    -
  • + Dashboard -
  • -
  • + + Doctors -
  • -
  • + + Appointments -
  • -
  • + + Patients -
  • -
  • + + Pharmacy -
  • -
  • + + Charts -
  • +
-
  • + Settings -
  • -
  • + + Help Center -
  • -
  • + + Log Out -
  • +
    ); diff --git a/frontend/src/main.jsx b/frontend/src/main.jsx index b9a1a6d..f691da8 100644 --- a/frontend/src/main.jsx +++ b/frontend/src/main.jsx @@ -1,10 +1,11 @@ -import { StrictMode } from 'react' + import { createRoot } from 'react-dom/client' import './index.css' import App from './App.jsx' +import { BrowserRouter } from'react-router-dom' -createRoot(document.getElementById('root')).render( - +createRoot(document.getElementById("root")).render( + - , -) + +); From 1c3616b840743ba57580c9df6769e13857509e81 Mon Sep 17 00:00:00 2001 From: dinesh bharati Date: Fri, 7 Mar 2025 14:04:33 +0530 Subject: [PATCH 10/48] before rebase --- frontend/src/components/Patient.jsx | 178 ---------------------------- 1 file changed, 178 deletions(-) delete mode 100644 frontend/src/components/Patient.jsx diff --git a/frontend/src/components/Patient.jsx b/frontend/src/components/Patient.jsx deleted file mode 100644 index fdbd043..0000000 --- a/frontend/src/components/Patient.jsx +++ /dev/null @@ -1,178 +0,0 @@ -import React, { useState, useEffect } from "react"; - -const Patient = () => { - const [searchQuery, setSearchQuery] = useState(""); - const [currentPage, setCurrentPage] = useState(1); - const [patients, setPatients] = useState( - Array(20).fill(null).map((_, index) => ({ - id: index + 1, - name: "Patient " + (index + 1), - age: 20 + (index % 5), - gender: index % 2 === 0 ? "Male" : "Female", - appointment: "2024-08-13 08:30", - doctorAssigned: "Dr. Smith" - })) - ); - const [showForm, setShowForm] = useState(false); - const [newPatient, setNewPatient] = useState({ - name: "", - age: "", - gender: "Male", - appointment: "", - doctorAssigned: "" - }); - - const itemsPerPage = 10; - const filteredPatients = patients.filter((patient) => - patient.name.toLowerCase().includes(searchQuery.toLowerCase()) - ); - const totalPages = Math.ceil(filteredPatients.length / itemsPerPage); - const startIndex = (currentPage - 1) * itemsPerPage; - const paginatedPatients = filteredPatients.reverse().slice(startIndex, startIndex + itemsPerPage); - - const handleAddNew = () => { - setShowForm(true); - }; - - useEffect(() => { - setCurrentPage(1); - }, [searchQuery]); - - const handleSubmit = (e) => { - e.preventDefault(); - setPatients([...patients, { id: patients.length + 1, ...newPatient }]); - setShowForm(false); - setNewPatient({ name: "", age: "", gender: "Male", appointment: "", doctorAssigned: "" }); - }; - - return ( -
    -
    -
    -

    Patient List

    - -
    - -
    - setSearchQuery(e.target.value)} - /> - -
    - - {showForm && ( -
    -
    - setNewPatient({ ...newPatient, name: e.target.value })} - required - /> - setNewPatient({ ...newPatient, age: e.target.value })} - required - /> - - setNewPatient({ ...newPatient, appointment: e.target.value })} - required - /> - setNewPatient({ ...newPatient, doctorAssigned: e.target.value })} - required - /> - - -
    -
    - )} - - - - - - - - - - - - - - {paginatedPatients.length > 0 ? ( - paginatedPatients.map((patient, index) => ( - - - - - - - - - )) - ) : ( - - - - )} - -
    IDPatient Name ⬇Age ⬇Gender ⬇Appointment ⬇Doctor Assigned ⬇
    {patient.id}{patient.name}{patient.age}{patient.gender}{patient.appointment}{patient.doctorAssigned}
    - No results found. -
    - -
    - - {currentPage} of {totalPages} - -
    - -
    -
    - ); -}; - -export default Patient; From 565a8a73629b501dc55894da73838c20cc91fb97 Mon Sep 17 00:00:00 2001 From: dinesh bharati Date: Fri, 7 Mar 2025 15:38:46 +0530 Subject: [PATCH 11/48] patient.jsx updated --- frontend/package-lock.json | 264 ++++++---------------------- frontend/package.json | 1 + frontend/src/components/Chart.jsx | 79 --------- frontend/src/components/Patient.jsx | 211 +++++++++++++++++++++- 4 files changed, 265 insertions(+), 290 deletions(-) delete mode 100644 frontend/src/components/Chart.jsx diff --git a/frontend/package-lock.json b/frontend/package-lock.json index 7ad660e..5b5cb97 100644 --- a/frontend/package-lock.json +++ b/frontend/package-lock.json @@ -17,6 +17,7 @@ "react": "^19.0.0", "react-dom": "^19.0.0", "react-icons": "^5.5.0", + "react-router-dom": "^7.3.0", "tailwindcss": "^4.0.9" }, "devDependencies": { @@ -269,18 +270,6 @@ "@babel/core": "^7.0.0-0" } }, - "node_modules/@babel/runtime": { - "version": "7.26.9", - "resolved": "https://registry.npmjs.org/@babel/runtime/-/runtime-7.26.9.tgz", - "integrity": "sha512-aA63XwOkcl4xxQa3HjPMqOP6LiK0ZDv3mUPYEFXkpHbaFjtGggE1A61FjFzJnB+p7/oy2gA8E+rcBNl/zC1tMg==", - "license": "MIT", - "dependencies": { - "regenerator-runtime": "^0.14.0" - }, - "engines": { - "node": ">=6.9.0" - } - }, "node_modules/@babel/template": { "version": "7.26.9", "resolved": "https://registry.npmjs.org/@babel/template/-/template-7.26.9.tgz", @@ -1585,6 +1574,12 @@ "@babel/types": "^7.20.7" } }, + "node_modules/@types/cookie": { + "version": "0.6.0", + "resolved": "https://registry.npmjs.org/@types/cookie/-/cookie-0.6.0.tgz", + "integrity": "sha512-4Kh9a6B2bQciAhf7FSuMRRkUWecJgJu9nPnx3yzpsfXX/c50REIqpHY4C82bXP90qrLtXtkDxTZosYO3UpOwlA==", + "license": "MIT" + }, "node_modules/@types/estree": { "version": "1.0.6", "resolved": "https://registry.npmjs.org/@types/estree/-/estree-1.0.6.tgz", @@ -1800,15 +1795,6 @@ "url": "https://github.com/chalk/chalk?sponsor=1" } }, - "node_modules/clsx": { - "version": "2.1.1", - "resolved": "https://registry.npmjs.org/clsx/-/clsx-2.1.1.tgz", - "integrity": "sha512-eYm0QWBtUrBWZWG0d386OGAw16Z995PiOVo2B7bjWSbHedGl5e0ZWaq65kOGgUSNesEIDkB9ISbTg/JK9dhCZA==", - "license": "MIT", - "engines": { - "node": ">=6" - } - }, "node_modules/color-convert": { "version": "2.0.1", "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz", @@ -1871,129 +1857,9 @@ "version": "3.1.3", "resolved": "https://registry.npmjs.org/csstype/-/csstype-3.1.3.tgz", "integrity": "sha512-M1uQkMl8rQK/szD0LNhtqxIPLpimGm8sOBwU7lLnCpSbTyY3yeU1Vc7l4KT5zT4s/yOxHH5O7tIuuLOCnLADRw==", + "dev": true, "license": "MIT" }, - "node_modules/d3-array": { - "version": "3.2.4", - "resolved": "https://registry.npmjs.org/d3-array/-/d3-array-3.2.4.tgz", - "integrity": "sha512-tdQAmyA18i4J7wprpYq8ClcxZy3SC31QMeByyCFyRt7BVHdREQZ5lpzoe5mFEYZUWe+oq8HBvk9JjpibyEV4Jg==", - "license": "ISC", - "dependencies": { - "internmap": "1 - 2" - }, - "engines": { - "node": ">=12" - } - }, - "node_modules/d3-color": { - "version": "3.1.0", - "resolved": "https://registry.npmjs.org/d3-color/-/d3-color-3.1.0.tgz", - "integrity": "sha512-zg/chbXyeBtMQ1LbD/WSoW2DpC3I0mpmPdW+ynRTj/x2DAWYrIY7qeZIHidozwV24m4iavr15lNwIwLxRmOxhA==", - "license": "ISC", - "engines": { - "node": ">=12" - } - }, - "node_modules/d3-ease": { - "version": "3.0.1", - "resolved": "https://registry.npmjs.org/d3-ease/-/d3-ease-3.0.1.tgz", - "integrity": "sha512-wR/XK3D3XcLIZwpbvQwQ5fK+8Ykds1ip7A2Txe0yxncXSdq1L9skcG7blcedkOX+ZcgxGAmLX1FrRGbADwzi0w==", - "license": "BSD-3-Clause", - "engines": { - "node": ">=12" - } - }, - "node_modules/d3-format": { - "version": "3.1.0", - "resolved": "https://registry.npmjs.org/d3-format/-/d3-format-3.1.0.tgz", - "integrity": "sha512-YyUI6AEuY/Wpt8KWLgZHsIU86atmikuoOmCfommt0LYHiQSPjvX2AcFc38PX0CBpr2RCyZhjex+NS/LPOv6YqA==", - "license": "ISC", - "engines": { - "node": ">=12" - } - }, - "node_modules/d3-interpolate": { - "version": "3.0.1", - "resolved": "https://registry.npmjs.org/d3-interpolate/-/d3-interpolate-3.0.1.tgz", - "integrity": "sha512-3bYs1rOD33uo8aqJfKP3JWPAibgw8Zm2+L9vBKEHJ2Rg+viTR7o5Mmv5mZcieN+FRYaAOWX5SJATX6k1PWz72g==", - "license": "ISC", - "dependencies": { - "d3-color": "1 - 3" - }, - "engines": { - "node": ">=12" - } - }, - "node_modules/d3-path": { - "version": "3.1.0", - "resolved": "https://registry.npmjs.org/d3-path/-/d3-path-3.1.0.tgz", - "integrity": "sha512-p3KP5HCf/bvjBSSKuXid6Zqijx7wIfNW+J/maPs+iwR35at5JCbLUT0LzF1cnjbCHWhqzQTIN2Jpe8pRebIEFQ==", - "license": "ISC", - "engines": { - "node": ">=12" - } - }, - "node_modules/d3-scale": { - "version": "4.0.2", - "resolved": "https://registry.npmjs.org/d3-scale/-/d3-scale-4.0.2.tgz", - "integrity": "sha512-GZW464g1SH7ag3Y7hXjf8RoUuAFIqklOAq3MRl4OaWabTFJY9PN/E1YklhXLh+OQ3fM9yS2nOkCoS+WLZ6kvxQ==", - "license": "ISC", - "dependencies": { - "d3-array": "2.10.0 - 3", - "d3-format": "1 - 3", - "d3-interpolate": "1.2.0 - 3", - "d3-time": "2.1.1 - 3", - "d3-time-format": "2 - 4" - }, - "engines": { - "node": ">=12" - } - }, - "node_modules/d3-shape": { - "version": "3.2.0", - "resolved": "https://registry.npmjs.org/d3-shape/-/d3-shape-3.2.0.tgz", - "integrity": "sha512-SaLBuwGm3MOViRq2ABk3eLoxwZELpH6zhl3FbAoJ7Vm1gofKx6El1Ib5z23NUEhF9AsGl7y+dzLe5Cw2AArGTA==", - "license": "ISC", - "dependencies": { - "d3-path": "^3.1.0" - }, - "engines": { - "node": ">=12" - } - }, - "node_modules/d3-time": { - "version": "3.1.0", - "resolved": "https://registry.npmjs.org/d3-time/-/d3-time-3.1.0.tgz", - "integrity": "sha512-VqKjzBLejbSMT4IgbmVgDjpkYrNWUYJnbCGo874u7MMKIWsILRX+OpX/gTk8MqjpT1A/c6HY2dCA77ZN0lkQ2Q==", - "license": "ISC", - "dependencies": { - "d3-array": "2 - 3" - }, - "engines": { - "node": ">=12" - } - }, - "node_modules/d3-time-format": { - "version": "4.1.0", - "resolved": "https://registry.npmjs.org/d3-time-format/-/d3-time-format-4.1.0.tgz", - "integrity": "sha512-dJxPBlzC7NugB2PDLwo9Q8JiTR3M3e4/XANkreKSUxF8vvXKqm1Yfq4Q5dl8budlunRVlUUaDUgFt7eA8D6NLg==", - "license": "ISC", - "dependencies": { - "d3-time": "1 - 3" - }, - "engines": { - "node": ">=12" - } - }, - "node_modules/d3-timer": { - "version": "3.0.1", - "resolved": "https://registry.npmjs.org/d3-timer/-/d3-timer-3.0.1.tgz", - "integrity": "sha512-ndfJ/JxxMd3nw31uyKoY2naivF+r29V+Lc0svZxe1JvvIRmi8hUsrMvdOwgS1o6uBHmiz91geQ0ylPP0aj1VUA==", - "license": "ISC", - "engines": { - "node": ">=12" - } - }, "node_modules/debug": { "version": "4.4.0", "resolved": "https://registry.npmjs.org/debug/-/debug-4.4.0.tgz", @@ -2012,12 +1878,6 @@ } } }, - "node_modules/decimal.js-light": { - "version": "2.5.1", - "resolved": "https://registry.npmjs.org/decimal.js-light/-/decimal.js-light-2.5.1.tgz", - "integrity": "sha512-qIMFpTMZmny+MMIitAB6D7iVPEorVw6YQRWkvarTkT4tBeSLLiHzcwj6q0MmYSFCiVpiqPJTJEYIrpcPzVEIvg==", - "license": "MIT" - }, "node_modules/deep-is": { "version": "0.1.4", "resolved": "https://registry.npmjs.org/deep-is/-/deep-is-0.1.4.tgz", @@ -2037,16 +1897,6 @@ "node": ">=0.10" } }, - "node_modules/dom-helpers": { - "version": "5.2.1", - "resolved": "https://registry.npmjs.org/dom-helpers/-/dom-helpers-5.2.1.tgz", - "integrity": "sha512-nRCa7CK3VTrM2NmGkIy4cbK7IZlgBE/PYMn55rrXefr5xXDP0LdtfPnblFDoVdcAfslJ7or6iqAUnx0CCGIWQA==", - "license": "MIT", - "dependencies": { - "@babel/runtime": "^7.8.7", - "csstype": "^3.0.2" - } - }, "node_modules/electron-to-chromium": { "version": "1.5.111", "resolved": "https://registry.npmjs.org/electron-to-chromium/-/electron-to-chromium-1.5.111.tgz", @@ -2307,12 +2157,6 @@ "node": ">=0.10.0" } }, - "node_modules/eventemitter3": { - "version": "4.0.7", - "resolved": "https://registry.npmjs.org/eventemitter3/-/eventemitter3-4.0.7.tgz", - "integrity": "sha512-8guHBZCwKnFhYdHr2ysuRWErTwhoN2X8XELRlrRwpmfeY2jjuUN4taQMsULKUVo1K4DvZl+0pgfyoysHxvmvEw==", - "license": "MIT" - }, "node_modules/fast-deep-equal": { "version": "3.1.3", "resolved": "https://registry.npmjs.org/fast-deep-equal/-/fast-deep-equal-3.1.3.tgz", @@ -2320,15 +2164,6 @@ "dev": true, "license": "MIT" }, - "node_modules/fast-equals": { - "version": "5.2.2", - "resolved": "https://registry.npmjs.org/fast-equals/-/fast-equals-5.2.2.tgz", - "integrity": "sha512-V7/RktU11J3I36Nwq2JnZEM7tNm17eBJz+u25qdxBZeCKiX6BkVSZQjwWIr+IobgnZy+ag73tTZgZi7tr0LrBw==", - "license": "MIT", - "engines": { - "node": ">=6.0.0" - } - }, "node_modules/fast-json-stable-stringify": { "version": "2.1.0", "resolved": "https://registry.npmjs.org/fast-json-stable-stringify/-/fast-json-stable-stringify-2.1.0.tgz", @@ -2497,15 +2332,6 @@ "node": ">=0.8.19" } }, - "node_modules/internmap": { - "version": "2.0.3", - "resolved": "https://registry.npmjs.org/internmap/-/internmap-2.0.3.tgz", - "integrity": "sha512-5Hh7Y1wQbvY5ooGgPbDaL5iYLAPzMTUrjMulskHLH6wnv/A+1q5rgEaiuqEjB+oxGXIVZs1FF+R/KPN3ZSQYYg==", - "license": "ISC", - "engines": { - "node": ">=12" - } - }, "node_modules/is-extglob": { "version": "2.1.1", "resolved": "https://registry.npmjs.org/is-extglob/-/is-extglob-2.1.1.tgz", @@ -2879,12 +2705,6 @@ "url": "https://github.com/sponsors/sindresorhus" } }, - "node_modules/lodash": { - "version": "4.17.21", - "resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.21.tgz", - "integrity": "sha512-v2kDEe57lecTulaDIuNTPy3Ry4gLGJ6Z1O3vE1krgXZNrsQ+LFTGHVxVjcXPs17LhbZVGedAJv8XZ1tvj5FvSg==", - "license": "MIT" - }, "node_modules/lodash.merge": { "version": "4.6.2", "resolved": "https://registry.npmjs.org/lodash.merge/-/lodash.merge-4.6.2.tgz", @@ -3169,6 +2989,46 @@ "node": ">=0.10.0" } }, + "node_modules/react-router": { + "version": "7.3.0", + "resolved": "https://registry.npmjs.org/react-router/-/react-router-7.3.0.tgz", + "integrity": "sha512-466f2W7HIWaNXTKM5nHTqNxLrHTyXybm7R0eBlVSt0k/u55tTCDO194OIx/NrYD4TS5SXKTNekXfT37kMKUjgw==", + "license": "MIT", + "dependencies": { + "@types/cookie": "^0.6.0", + "cookie": "^1.0.1", + "set-cookie-parser": "^2.6.0", + "turbo-stream": "2.4.0" + }, + "engines": { + "node": ">=20.0.0" + }, + "peerDependencies": { + "react": ">=18", + "react-dom": ">=18" + }, + "peerDependenciesMeta": { + "react-dom": { + "optional": true + } + } + }, + "node_modules/react-router-dom": { + "version": "7.3.0", + "resolved": "https://registry.npmjs.org/react-router-dom/-/react-router-dom-7.3.0.tgz", + "integrity": "sha512-z7Q5FTiHGgQfEurX/FBinkOXhWREJIAB2RiU24lvcBa82PxUpwqvs/PAXb9lJyPjTs2jrl6UkLvCZVGJPeNuuQ==", + "license": "MIT", + "dependencies": { + "react-router": "7.3.0" + }, + "engines": { + "node": ">=20.0.0" + }, + "peerDependencies": { + "react": ">=18", + "react-dom": ">=18" + } + }, "node_modules/resolve-from": { "version": "4.0.0", "resolved": "https://registry.npmjs.org/resolve-from/-/resolve-from-4.0.0.tgz", @@ -3312,6 +3172,12 @@ "node": ">=6" } }, + "node_modules/turbo-stream": { + "version": "2.4.0", + "resolved": "https://registry.npmjs.org/turbo-stream/-/turbo-stream-2.4.0.tgz", + "integrity": "sha512-FHncC10WpBd2eOmGwpmQsWLDoK4cqsA/UT/GqNoaKOQnT8uzhtCbg3EoUDMvqpOSAI0S26mr0rkjzbOO6S3v1g==", + "license": "ISC" + }, "node_modules/type-check": { "version": "0.4.0", "resolved": "https://registry.npmjs.org/type-check/-/type-check-0.4.0.tgz", @@ -3366,28 +3232,6 @@ "punycode": "^2.1.0" } }, - "node_modules/victory-vendor": { - "version": "36.9.2", - "resolved": "https://registry.npmjs.org/victory-vendor/-/victory-vendor-36.9.2.tgz", - "integrity": "sha512-PnpQQMuxlwYdocC8fIJqVXvkeViHYzotI+NJrCuav0ZYFoq912ZHBk3mCeuj+5/VpodOjPe1z0Fk2ihgzlXqjQ==", - "license": "MIT AND ISC", - "dependencies": { - "@types/d3-array": "^3.0.3", - "@types/d3-ease": "^3.0.0", - "@types/d3-interpolate": "^3.0.1", - "@types/d3-scale": "^4.0.2", - "@types/d3-shape": "^3.1.0", - "@types/d3-time": "^3.0.0", - "@types/d3-timer": "^3.0.0", - "d3-array": "^3.1.6", - "d3-ease": "^3.0.1", - "d3-interpolate": "^3.0.1", - "d3-scale": "^4.0.2", - "d3-shape": "^3.1.0", - "d3-time": "^3.0.0", - "d3-timer": "^3.0.1" - } - }, "node_modules/vite": { "version": "6.2.0", "resolved": "https://registry.npmjs.org/vite/-/vite-6.2.0.tgz", diff --git a/frontend/package.json b/frontend/package.json index 93b8960..e1fae42 100644 --- a/frontend/package.json +++ b/frontend/package.json @@ -19,6 +19,7 @@ "react": "^19.0.0", "react-dom": "^19.0.0", "react-icons": "^5.5.0", + "react-router-dom": "^7.3.0", "tailwindcss": "^4.0.9" }, "devDependencies": { diff --git a/frontend/src/components/Chart.jsx b/frontend/src/components/Chart.jsx deleted file mode 100644 index 9360305..0000000 --- a/frontend/src/components/Chart.jsx +++ /dev/null @@ -1,79 +0,0 @@ -import React from "react"; -import { PieChart, Pie, Cell, Tooltip, Legend } from "recharts"; - -const Chart = () => { - const data = [ - { name: "Dental", value: 125, color: "#00C49F" }, - { name: "Medicine", value: 25, color: "#FFA500" }, - { name: "Cardiology", value: 50, color: "#0088FE" }, - ]; - - const total = data.reduce((sum, entry) => sum + entry.value, 0); // Calculate total - - const processedData = data.map((entry) => ({ - ...entry, - percentage: ((entry.value / total) * 100).toFixed(1), // Calculate percentage - })); - - const renderCustomizedLabel = ({ cx, cy, midAngle, outerRadius, percent, name }) => { - const RADIAN = Math.PI / 180; - const x = cx + (outerRadius + 20) * Math.cos(-midAngle * RADIAN); - const y = cy + (outerRadius + 20) * Math.sin(-midAngle * RADIAN); - - return ( - cx ? "start" : "end"} fontSize={12}> - {name} - - {`${(percent * 100).toFixed(1)}%`} - - - ); - }; - - // Custom Legend Component - const renderLegend = (props) => { - const { payload } = props; - return ( -
      - {payload.map((entry, index) => ( -
    • - - {entry.value} {entry.payload.value} -
    • - ))} -
    - ); - }; - - - return ( -
    -

    Patients By Department

    - - - {processedData.map((entry, index) => ( - - ))} - - - - -

    {total} Total

    -
    - ); -}; - -export default Chart; diff --git a/frontend/src/components/Patient.jsx b/frontend/src/components/Patient.jsx index 12b730c..cf62ec0 100644 --- a/frontend/src/components/Patient.jsx +++ b/frontend/src/components/Patient.jsx @@ -1,11 +1,220 @@ -import React from "react"; +import React, { useState, useEffect } from "react"; import Navbar from "./Navbar"; import Sidebar from "./Sidebar"; const Patient = () => { + + + const [searchQuery, setSearchQuery] = useState(""); + const [currentPage, setCurrentPage] = useState(1); + const [patients, setPatients] = useState( + Array(30).fill(null).map((_, index) => ({ + id: index + 1, + name: "Patient " + (index + 1), + age: 20 + (index % 5), + gender: index % 2 === 0 ? "Male" : "Female", + appointment: "2024-08-13 08:30", + doctorAssigned: "Dr. Smith" + })) + ); + const [showForm, setShowForm] = useState(false); + const [newPatient, setNewPatient] = useState({ + name: "", + age: "", + gender: "Male", + appointment: "", + doctorAssigned: "" + }); + + const itemsPerPage = 9; + const filteredPatients = patients.filter((patient) => + patient.name.toLowerCase().includes(searchQuery.toLowerCase()) + ); + const totalPages = Math.ceil(filteredPatients.length / itemsPerPage); + const startIndex = (currentPage - 1) * itemsPerPage; + const paginatedPatients = filteredPatients.reverse().slice(startIndex, startIndex + itemsPerPage); + + + const goToPage = (page) => { + if (page >= 1 && page <= totalPages) { + setCurrentPage(page); + } + }; + + const handleAddNew = () => { + setShowForm(true); + }; + + useEffect(() => { + setCurrentPage(1); + }, [searchQuery]); + + const handleSubmit = (e) => { + e.preventDefault(); + setPatients([...patients, { id: patients.length + 1, ...newPatient }]); + setShowForm(false); + setNewPatient({ name: "", age: "", gender: "Male", appointment: "", doctorAssigned: "" }); + }; + + return (
    + + {/* Main Content */} +
    +
    +
    +

    Patient List

    + {/* */} +
    + +
    + setSearchQuery(e.target.value)} + /> + +
    + + {/* Form */} + {showForm && ( +
    +
    + setNewPatient({ ...newPatient, name: e.target.value })} + required + /> + setNewPatient({ ...newPatient, age: e.target.value })} + required + /> + + setNewPatient({ ...newPatient, appointment: e.target.value })} + required + /> + setNewPatient({ ...newPatient, doctorAssigned: e.target.value })} + required + /> + + +
    +
    + )} + + {/* Table */} + + + + + + + + + + + + + {paginatedPatients.length > 0 ? ( + paginatedPatients.map((patient, index) => ( + + + + + + + + + )) + ) : ( + + + + )} + +
    IDPatient Name ⬇Age ⬇Gender ⬇Appointment ⬇Doctor Assigned ⬇
    {patient.id}{patient.name}{patient.age}{patient.gender}{patient.appointment.replace("T", " ")}{patient.doctorAssigned}
    + No results found. +
    + + {/* Pagination */} +
    + + + {currentPage > 2 && ...} + + {[...Array(totalPages).keys()] + .map((_, i) => i + 1) + .filter((page) => page === 1 || page === totalPages || (page >= currentPage - 1 && page <= currentPage + 1)) + .map((page) => ( + + ))} + + {currentPage < totalPages - 1 && ...} + + +
    + + +
    +
    + + +
    ); }; From dd92e03de55684d7a1e44dce321870d91c5bf5d2 Mon Sep 17 00:00:00 2001 From: adhyayan Date: Fri, 7 Mar 2025 17:09:57 +0530 Subject: [PATCH 12/48] Updated Pharmacy --- frontend/src/components/Pharmacy.jsx | 111 ++++++++++++++++++++++++++- 1 file changed, 109 insertions(+), 2 deletions(-) diff --git a/frontend/src/components/Pharmacy.jsx b/frontend/src/components/Pharmacy.jsx index 7ecb601..5489c17 100644 --- a/frontend/src/components/Pharmacy.jsx +++ b/frontend/src/components/Pharmacy.jsx @@ -1,13 +1,120 @@ -import React from "react"; +import React, { useState } from "react"; import Navbar from "./Navbar"; import Sidebar from "./Sidebar"; + const Pharmacy = () => { + const [medicines, setMedicines] = useState([]); + const [form, setForm] = useState({ name: "", description: "", price: "" }); + + const handleChange = (e) => { + setForm({ ...form, [e.target.name]: e.target.value }); + }; + + const handleSubmit = (e) => { + e.preventDefault(); + if (form.name && form.description && form.price) { + setMedicines([...medicines, form]); + setForm({ name: "", description: "", price: "" }); + } + }; + return (
    - +
    + +
    +
    +
    +

    Pharmacy

    + +
    + +
    +
    +

    Add Medicine

    +
    +
    +
    + + +
    +
    + +
    -
    - -