Hospital Management System — Full-Stack MVP Prompt Act as an expert Full-Stack Developer and UI/UX Designer. Build a complete MVP for a Hospital Management System with a working frontend, backend API, and database. The system is used by hospital administrators, doctors, nurses, and front-desk staff to manage daily operations. Implement real authentication, persistent data storage, and RESTful API endpoints. System Overview A centralized hospital management platform that allows staff to register patients, schedule appointments, manage doctor profiles, maintain electronic health records (EHR), handle billing/invoicing, and track pharmacy inventory — all through a role-based dashboard interface. Core Screens Dashboard — Summary cards (total patients, today's appointments, available beds, pending bills), a line chart for weekly admissions, and a recent-activity feed. Patients — Searchable/sortable table of all patients with columns: name, ID, age, gender, phone, status (active/discharged). Add/edit patient form with fields for personal info, emergency contact, and insurance details. Appointments — Calendar view (day/week/month) and list view. Create appointment form: patient selector, doctor selector, date/time, department, reason. Status badges: Scheduled, In Progress, Completed, Cancelled. Doctors & Staff — Directory of doctors with photo, specialty, department, availability schedule, and contact info. CRUD operations for staff profiles. Medical Records (EHR) — Per-patient record timeline: diagnoses, prescriptions, lab results, notes. Doctors can add new entries. Records are read-only for non-doctor roles. Billing & Invoices — Generate invoices linked to patient visits. Line items for consultation, procedures, medications, room charges. Status: Paid, Pending, Overdue. Summary totals and print/export view. Pharmacy / Inventory — Drug catalog with stock levels, expiry dates, and reorder alerts. Dispense medications linked to prescriptions. Low-stock warning badges. Settings & Roles — Role management (Admin, Doctor, Nurse, Receptionist). Each role sees only permitted modules. User account CRUD for admins. Backend & Database Backend Framework: Node.js with Express (or Python with FastAPI — pick one). Database: MySQL or PostgreSQL. Design normalized tables for: users, patients, doctors, appointments, medical_records, prescriptions, invoices, invoice_items, pharmacy_inventory, departments, roles. Authentication: JWT-based auth with role-based access control (RBAC). Login returns a token; middleware protects routes by role. API Endpoints (RESTful): POST /auth/login · POST /auth/register GET/POST/PUT/DELETE /patients GET/POST/PUT/DELETE /doctors GET/POST/PUT/DELETE /appointments GET/POST /medical-records/:patientId GET/POST/PUT /invoices GET/PUT /pharmacy GET/PUT /settings/roles Seed Data: Include a seed script that populates the database with sample patients, doctors, appointments, and inventory so the system is demo-ready on first run. Design Direction Primary Color: #0077B6 (medical blue) — used for sidebar, buttons, and active states. Secondary Accent: #00B4D8 (lighter blue) for hover states and highlights. Background: #F0F2F5 (light neutral gray). Surface/Cards: #FFFFFF with border-radius: 12px and subtle box-shadow: 0 1px 3px rgba(0,0,0,0.08). Text: #1A1A2E primary, #6C757D secondary. Danger/Alert: #E63946 for overdue bills, low stock, cancelled appointments. Success: #2A9D8F for paid, completed, in-stock. Font Stack: 'Inter', 'Segoe UI', system-ui, sans-serif — 14px body, 24px page titles, 18px section headers. Dashboard-first layout: Sidebar navigation on the left, main content area with card-based widgets. Layout & Responsiveness Desktop (1024px+): Fixed 260px sidebar with icons + labels, top bar with search and user avatar/dropdown. Main content max-width 1200px. Tablet (768px–1023px): Sidebar collapses to icon-only (60px). Tables become horizontally scrollable. Mobile (<768px): Sidebar hidden behind hamburger menu or replaced with bottom navigation. Cards stack vertically. Forms go full-width. Calendar defaults to day view. Technical Constraints Frontend: React + TypeScript + Tailwind CSS (or Vite + React). Backend: Node.js + Express + JWT (or FastAPI + Python). Database: MySQL or PostgreSQL with an ORM (Prisma, Drizzle, or SQLAlchemy). Auth: Real JWT-based login with hashed passwords (bcrypt). Role-based middleware. Seed script: Must populate all tables with realistic sample data on first setup. No third-party SaaS dependencies — everything runs locally or self-hosted. Include a README with setup instructions: install, migrate, seed, and run.