A lightweight full-stack MVP web application designed for hospitals and clinics to manage staff shifts, track attendance, and improve operational efficiency. Built with React, Tailwind CSS, Node.js, PostgreSQL, and RESTful APIs.
- 👤 Secure Admin Login
- 👥 Staff Management (Doctors, Nurses, Technicians)
- 📆 Shift Scheduler (Morning, Afternoon, Night)
- 🗓️ Daily & Weekly Shift Views
- ✅ Attendance Tracking with Status & Remarks
- 🔍 Search & Filter by Staff, Role, Shift
⚠️ Shift Conflict Alerts (Double Booking Prevention)
| Layer | Tech |
|---|---|
| Frontend | React + Context API + Tailwind CSS |
| Backend | Node.js + Express |
| Database | PostgreSQL |
| APIs | REST |
| DevOps | GitHub CI/CD, Cloud Deployment |
/login– Admin login with email & password/staff– Manage staff list: add, edit, search, sort/shifts– Create and list shifts with filters/assignments– Assign staff to shift slots with validation/schedule– Visual weekly or daily schedule with status indicators/attendance– Mark attendance (present/absent) with remarks
<App>
├─ <AuthProvider>
│ └─ <Router>
│ ├─ <LoginPage>
│ ├─ <ProtectedRoute>
│ │ ├─ <Navbar> – Links: Staff, Shifts, Schedule, Attendance
│ │ └─ <PageContainer>
│ │ ├─ <StaffPage>
│ │ ├─ <ShiftPage>
│ │ ├─ <AssignmentPage>
│ │ ├─ <SchedulePage>
│ │ └─ <AttendancePage>
# Clone the repo
git clone https://github.com/your-org/healthcare-scheduler.git
# Install client & server deps
cd client && npm install
cd ../server && npm install
# Run frontend & backend concurrently
npm run dev
## 🗃️ Database Schema (PostgreSQL)
```sql
-- Admins
CREATE TABLE users (
id uuid PRIMARY KEY,
name VARCHAR(100),
email VARCHAR(255) UNIQUE NOT NULL,
password VARCHAR(255) NOT NULL -- hashed
address VARCHAR(255),
job_title VARHAR(255),
department VARCHAR(100),
employee_id SERIAL NOT NULL,
hire_date DATE NOT NULL,
emergency_contact_name VARCHAR(255),
emergency_contact_relation VARCHAR(100),
emergency_contact_phone VARCHAR(20)
);
-- Shifts
CREATE TYPE shift_type AS ENUM ('morning', 'afternoon', 'night');
-- shifts --
CREATE TABLE shifts (
id SERIAL PRIMARY KEY,
shift_type TEXT CHECK (shift_type IN ('doctor', 'nurse', 'technician', 'other')),
start_time TIMESTAMP,
end_time TIMESTAMP
);
-- Assignments --
CREATE TABLE shift_assignments (
id SERIAL PRIMARY KEY,
shift_id INT REFERENCES shifts(id) ON DELETE CASCADE,
staff_id INT REFERENCES staff(id) ON DELETE CASCADE,
UNIQUE(shift_id, staff_id)
);
-- Attendance
CREATE TABLE attendance (
id SERIAL PRIMARY KEY,
assignment_id INT REFERENCES shift_assignments(id) ON DELETE CASCADE,
status VARCHAR(10) NOT NULL, -- 'present' or 'absent'
remarks TEXT
);
## 📡 REST API Endpoints
| Method | Endpoint | Description |
|--------|-----------------------------------------------|---------------------------------|
| POST | `/api/auth/login` | Admin login |
| GET | `/api/staff` | List staff |
| GET | `/api/staff?name=` | List staff by name |
| GET | `/api/staff?email=` | List staff by name |
| POST | `/api/staff` | Add staff |
| GET | `/api/shifts` | List shifts |
| POST | `/api/shifts` | Create shift |
| POST | `/api/shifts/:id/assignments` | Assign staff to shift |
| GET | `/api/shifts/:id/assignments` | View assigned staff |
| POST | `/api/attendance` | Mark attendance |
| GET | `/api/alerts/conflicts?weekOf=YYYY-MM-DD` | Weekly shift conflict alerts |
## ✅ Compliance & Security
- ✅ JWT Authentication & HTTPS
- ✅ Server-side validation & error handling
- ✅ Data encryption in transit (TLS)
- ✅ Logging (without PII)
- ✅ Basic HIPAA-oriented structure
---
## 🚀 Quick Start (for Dev)
```bash
# Clone the repo
git clone https://github.com/your-org/healthcare-scheduler.git
# Install client & server dependencies
cd client && npm install
cd ../server && npm install
# Run frontend & backend concurrently
npm run dev