Public Health Information System
2026 – 2026
Health information system with predictive analytics for Rural Health Units and Barangay Health Stations in Balanga City, Bataan. Laravel 12 API + React 19 SPA; ~900 automated tests.
- Client
- Rural Health Units, Balanga City, Bataan
- Role
- Full-stack developer
- Platform
- Web
- Period
- 2026 – 2026
- Stack
- Laravel 12
- Sanctum
- MySQL
- React 19
- TypeScript
- TanStack Query
- Recharts
- GitHub Actions
- Live
- phis-bpsu.onrender.com
Showcase deployment only — Render + TiDB Cloud, seeded with synthetic health data and connected to no real patient records. The client's actual deployment is on-premises (Apache 2.4 + MySQL 5.7 on a LAN).
- Source
- Private repository
~900
automated tests, CI on every push
z-score
outbreak detection on case counts
3
report formats: table, CSV, PDF
In short
I built a health information system that lets Rural Health Units and Barangay Health Stations in Balanga City record consultations, diagnoses and referrals digitally and generate the city’s required reports in familiar formats. I served as the full-stack developer, creating a Laravel 12 API backend and a React 19 single-page application front-end, and wrote around 900 automated tests. The system was built to work for staff with limited training and intermittent connectivity. The showcase runs on Render with TiDB Cloud, while the client’s production deployment runs on-premises with Apache 2.4 and MySQL 5.7.
Written by AI from this case study.



Context & constraints
Rural Health Units (RHUs) and the Barangay Health Stations (BHSs) under them record consultations, diagnoses and referrals on paper and in spreadsheets. Aggregating them for the city takes weeks, which is exactly the delay that makes an outbreak hard to catch early.
The system had to work for staff with limited training and intermittent connectivity, respect who is allowed to see what across RHU and BHS levels, and produce the reports the city already expects — in the formats it already uses.
Architecture
A Laravel 12 REST API with Sanctum authentication and policy-based RBAC, so every query is scoped to the caller's unit and role at the policy layer rather than in each controller. A React 19 + TypeScript SPA with TanStack Query for server state and Recharts for the dashboards.
Analytics run server-side: z-score outbreak detection flags a disease when its current count sits far enough above its historical mean, and regression-based trend forecasting projects the next periods. The choropleth map is hand-built SVG keyed by barangay, so it works without a mapping SDK or network tiles.
Key decisions
- Laravel over framework-free PHP (the opposite call to GlowSimcha): this system needed RBAC, validation, queues and reporting fast, and Laravel's policies and Eloquent gave me those in days. The interesting code is the analytics, not the plumbing.
- Policy-based authorization instead of role checks in controllers: one place to reason about who sees which unit's data, and one place to test it.
- SVG choropleth instead of a map library: a few dozen barangays, no need for tiles, and full control over accessibility (each region is a labelled element, not a canvas pixel).
- Multi-format reporting (table / CSV / PDF) from the same query: the city's workflows already ran on CSV and printed PDFs; meeting them where they were mattered more than a prettier dashboard.
What broke
Early z-score alerts fired constantly for diseases with tiny historical counts — a jump from one case to three is a huge z-score and a meaningless signal. The fix was a minimum-baseline guard and a rolling window sized to the reporting cadence, with tests pinning the thresholds so a future change can't silently reopen the flood of false alerts.
Quality
~900 automated tests across API, policies, analytics and the SPA, running in GitHub Actions on every push. Analytics functions are tested against fixed datasets with known expected outputs, so the maths is verified independently of the UI.
What I'd do differently
Start with the reports, not the dashboard. The charts were the fun part, but the CSV and PDF exports were what staff actually needed on day one, and building them first would have surfaced the data-model gaps earlier.
Evidence
Source is private, but the demo above is live: a showcase instance on Render with TiDB Cloud behind it, seeded with synthetic health data. The client's own deployment is on-premises — Apache 2.4 and MySQL 5.7 on a LAN — and nothing public touches real patient records.
The screenshots below come from that same seeded instance — aggregate counts only. Happy to walk through the z-score baseline and the choropleth pipeline on a call.
Source private — details limited by client agreement.