AS
Back to projects
Business Management

PharmaCare — Pharmacy Management System

Full-Stack Developer · 2026 — Live in production

PharmaCare — Pharmacy Management System — live screenshot
PHP 8.3React 19MySQLDockernginxJWTTailwind CSSRailway

Overview

PharmaCare is a complete pharmacy management platform running live in production. It covers the full operational surface of a pharmacy across 18 pages: a cashier POS screen, medicine catalog, batch-tracked inventory, supply chain, sales history, customer loyalty, analytics, and a full admin panel. The backend is a hand-built PHP MVC framework — router, JWT auth, middleware, and logging written from scratch with zero Composer dependencies — exposing 121 API routes across 19 controllers to a React 19 frontend.

The Problem

Pharmacies need more than a generic retail POS: medicines have batches with expiry dates, prescription and controlled-substance flags, bilingual (Arabic/English) naming, and strict auditability. Off-the-shelf systems either don't model this domain or lock pharmacies into expensive licenses.

The Solution

I built the entire system end-to-end: a POS with held invoices, mixed payment methods, and loyalty points; FIFO batch inventory with expiry tracking and low-stock/near-expiry alerts; purchase orders and returns; analytics dashboards with CSV export; and an admin panel with role-based permissions (owner, admin, pharmacist, plus per-user overrides), settings, database backup download, and a full activity audit log. It also syncs with the Saudi RSD drug database.

Architecture

Single Docker image deployed on Railway: Node builds the React 19 + Vite frontend, nginx serves it and proxies /api/* to PHP-FPM 8.3, backed by managed MySQL (23 tables). Security: short-lived JWT access tokens with refresh rotation, bcrypt hashing, per-route permission middleware, rate limiting, CORS controls, and activity logging on every significant action. Configuration is injected from Railway environment variables at startup.

Challenges & how I solved them

A framework with zero dependencies

I wrote the router, JWT authentication, permission middleware, and logging by hand instead of pulling in Composer packages — which meant owning every security decision (token refresh, rate limiting, bcrypt) rather than trusting defaults I hadn't read.

FIFO batch inventory correctness

Selling medicine must consume the oldest batch first and respect expiry dates, across sales, refunds, and stock adjustments. Getting this right required modeling batches as first-class entities rather than a single stock counter.

Production deployment as one unit

Packaging a React build, nginx, and PHP-FPM into one Docker image with environment-driven config meant a single `railway up` deploys the whole system — no drift between frontend and backend versions.

Key features

Point of Sale

Cashier screen with cart, held invoices, mixed payment methods, and loyalty points.

Batch inventory (FIFO)

Expiry-dated batches, stock adjustments, low-stock and near-expiry alerts.

Supply chain & returns

Suppliers, purchase orders, and purchase/sale returns with full history.

Analytics & reports

Revenue/profit dashboard, 12-month charts, top medicines, CSV export.

Role-based admin

Owner/admin/pharmacist roles with per-user overrides, audit log, and DB backup.

Saudi RSD drug sync

Integration with the national drug database, with sync logging.

Screenshots

PharmaCare — Pharmacy Management System screenshot 1

Future improvements

  • Multi-branch support with per-branch inventory
  • Offline-capable POS with sync-on-reconnect
  • E-invoicing (ZATCA) integration

Let's build something reliable together

I'm currently open to Backend, Full-Stack, and PHP Developer roles. If you need someone who cares about clean architecture as much as shipping fast, let's talk.