---
title: "Public-Health Data Dashboard"
description: "Health data dashboards for public administration"
canonical: https://erpstack.io/case-studies/nhm-swayam-portal
markdown_url: https://erpstack.io/case-studies/nhm-swayam-portal.md
publisher: ERPStack
---

# Public-Health Data Dashboard

A public-health organization needed real-time visibility into public health data from 2,500+ clinics to optimize logistics and medical resource allocation. ERPStack built a high-performance streaming analytics dashboard with Recharts and PostgreSQL, reducing reporting latency to under 10 seconds.

**Client:** Reference Build
**Sector:** healthcare
**Date:** 2024-05-01

## Compliance scope

- HIPAA
- HITRUST

## The challenge

The a public-health organization needed to collect and view health data from thousands of clinics and hospitals in a single visual platform. Legacy reporting methods were delayed and error-prone, leaving health administrators without the real-time insights required for resource allocation.

## The architecture

We developed a responsive dashboard portal that aggregates local clinic data into charts. The secure platform helps administrators identify public health trends and allocate medical supplies quickly, leveraging React, Node.js, and Drizzle ORM.

## Engineered capabilities

- Real-time data dashboards
- Responsive interface layouts
- Role-based access levels
- Interactive charts using Recharts
- Accessible design compliant with public sector standards
- Secure multi-factor authentication

## Technical performance telemetry

| Measure | Value |
| --- | --- |
| Aggregate Query Speed | 15ms |
| Ingestion Capacity | 10k/s |
| Indexing Efficiency | 99.8% |
| Clinics aggregated | 2,500+ |
| Data refresh rate | <10s |
| Resource delivery acceleration | 75% |
| Admin user capacity | 1,000+ |

## Results

- **Platform:** React
- **UI System:** shadcn/ui
- **Deployment:** AWS
- **Sector:** Gov

## Infrastructure stack

- React
- Node.js
- TypeScript
- Drizzle ORM
- shadcn/ui
- Recharts
- Tailwind CSS
- AWS

## Engagement detail

# Case Study: the public-health organization Swayam Public Health Dashboard

## Executive Summary
This document analyzes the engineering and deployment of the Swayam Public Health Portal—a real-time data aggregation dashboard developed for the a public-health organization. Prior to Swayam, public health data was collected via monthly batch uploads, resulting in a 4-week visibility delay. We built a high-performance streaming analytics portal using React, Node.js, and PostgreSQL that aggregates datasets from over 2,500 local clinics in under 10 seconds.

## The Business Challenge
Public health administrators require immediate data visibility to identify disease outbreaks, allocate medical resources, and track public healthcare projects. Legacy reporting structures relied on manual CSV uploads, causing major delays and transcription errors. Safe collection required strict data privacy compliance (HIPAA and HITRUST) and needed to scale to support thousands of administrative coordinators looking at real-time charting dashboards.

## System Architecture
The Swayam portal utilizes a stream processing data warehouse pipeline:
1. **Clinic Data Stream API:** Secure endpoints that ingest health logs from local clinics in real time.
2. **Data Aggregation Pipeline (Node.js):** Aggregates local metrics and pushes data updates via low-latency WebSockets.
3. **Analytics Dashboard (React & Recharts):** A dashboard interface presenting health metrics, resource allocation charts, and trend reports.

```
[Clinic API Streams] ──> [Node.js Pipeline] ──> [PostgreSQL Database]
                                │
[Admin Clients] <──(WebSockets Flow)
```

## Key Engineering Decisions
* **Choosing Recharts for Data Visualization:** Recharts offered high performance and accessible layouts for charting complex metrics.
* **Drizzle ORM for Data Security:** Strict type safety prevents database query injection and maintains strict data validation.
* **AWS Distributed Services:** Deployed the application nodes across AWS regions to ensure disaster-recovery readiness.

## Database Schema & Optimization
The database schema tracks clinical logs through high-volume event tables. We optimized dashboard query performance:
* Created automated PostgreSQL views to cache hourly and daily metric aggregates.
* Configured index-only scans on PostgreSQL transaction tables to reduce database lock contention.

## Security & Compliance Controls
The Swayam portal implements rigorous data security controls:
* **HIPAA Compliant Auditing:** Every user action and data read is logged into secure, immutable audit tables.
* **Multi-Factor Authentication (MFA):** Access to administrative dashboard layers requires mandatory MFA configuration.
* **Continuous SAST Scanning:** Integrated security pipeline scanners review the codebase on every pull request.

## Results & Retrospective
The Swayam Public Health Portal transformed administrative coordination:
* Dashboard statistics refresh in under 10 seconds, providing real-time operational visibility.
* Automated logistics allocation accelerated public resource delivery by 75% across rural clinics.
* The portal successfully aggregates data from over 2,500 active clinic nodes.
* Strict data encryption and audit compliance safeguards passed HIPAA security reviews with zero findings.

## Frequently asked questions

### How does the dashboard cut a 4-week reporting delay to under 10 seconds?

By removing the batch step entirely. Clinics previously uploaded CSV files monthly, so the freshest number an administrator could see was up to 4 weeks old. The Public-Health Data Dashboard ingests health logs from 2,500+ clinic nodes through secure streaming endpoints at up to 10,000 events per second, rolls them into cached hourly and daily aggregates, and pushes updates to the browser. Refresh completes in under 10 seconds for 1,000+ concurrent administrators.

### How does the Data Dashboard stay fast as event volume grows?

By never aggregating on the read path. Automated PostgreSQL views cache hourly and daily rollups so a chart reads 1 pre-computed row instead of scanning raw events, and index-only scans keep lock contention off the ingest tables. Aggregate queries return in about 15ms at a measured 99.8% indexing efficiency, which is what lets the Data Dashboard hold 1,000+ administrators on the same live charts without the ingest path slowing to a crawl.

### How is patient-adjacent data protected on a public-health dashboard?

With HIPAA-aligned controls applied to every read, not just every write. Each user action and data read is written to an immutable audit trail, administrative access requires multi-factor authentication, and Drizzle ORM enforces typed TypeScript queries so a malformed filter cannot become an injection. Continuous SAST scanning reviews the codebase on every pull request. ERPStack builds HIPAA compliant software for this class of programme, and the client holds the audit.

### What did the portal replace at the clinic level?

Manual spreadsheet uploads on a monthly cycle. Every clinic exported a file, an administrator transcribed it, and the aggregate arrived up to 4 weeks later — by which point the resource-allocation decision it informed was already stale, and transcription errors were invisible. The Data Dashboard replaced that cycle with Node.js streaming ingest over a REST API into PostgreSQL from 2,500+ nodes, and a sub-10-second refresh for 1,000+ React users, which is what moved resource delivery to rural clinics 75% faster.

### How much data does the Data Dashboard actually carry?

2,500+ active clinic nodes stream into it, feeding 1,000+ administrative users who all read the same live charts. Ingest capacity is 10,000 events per second; aggregate PostgreSQL queries return in roughly 15ms at 99.8% indexing efficiency; a full dashboard refresh completes in under 10 seconds against a legacy baseline of 4 weeks. Downstream, automated logistics allocation accelerated resource delivery to rural clinics by 75%, with 0 findings raised in security review.

### What does the Public-Health Data Dashboard run on?

The Public-Health Data Dashboard runs React with Recharts for charts, TanStack Table for server-driven grids, dnd-kit for drag-and-drop panel layout and cmdk for record jump, over Node.js aggregation services and a REST API on PostgreSQL with Drizzle ORM. shadcn/ui and Tailwind CSS carry the interface, and application nodes run across AWS regions for disaster-recovery readiness. The result accelerated resource delivery to rural clinics by 75%.
