A unified diagnostic billing and payment orchestration layer for African hospitals. Built for the Enyata x Interswitch Buildathon 2026.
Live Demo: https://dxpay.vercel.app
Live API Base URL: https://dxpay.onrender.com
In many African healthcare facilities, diagnostic services suffer from fragmented payment systems. Patients often move between departments (Labs, Radiology, Pharmacy), paying separately for tests and receiving multiple paper receipts. This creates:
- Workflow Delays: Tests cannot start until individual payment confirmations are received.
- Revenue Leakage: Manual reconciliation causes missing or untracked payments.
- Poor Patient Experience: Long payment queues and financial confusion.
DiagnosticsPay introduces a single payment orchestration layer. Instead of patients paying each diagnostic unit separately, our platform aggregates all ordered diagnostics into one unified bill.
- Order: Doctor orders multiple tests via the Terminal.
- Aggregate: System generates a single, unified invoice.
- Pay: Patient pays once digitally via Interswitch.
- Split (Core Innovation): The backend Payment Split Engine automatically distributes the funds to the respective providers (e.g., Hematology Lab, Imaging Center, Hospital Admin).
We utilized a "Two Kingdoms" monorepo structure to optimize parallel development during the 72-hour sprint.
- Framework: Next.js 16.2 (App Router)
- Language: TypeScript
- Styling: Tailwind CSS + Shadcn UI
- State Management: Zustand
- Deployment: Vercel
- Framework: Node.js + Express.js
- Database: PostgreSQL (Hosted on Neon.tech)
- Payment Gateway: Interswitch APIs
- Deployment: Render
To run this project locally for judging or development:
cd backend
npm installCreate a .env file in the /backend directory. (Note: Our db.js uses a hybrid config. If DATABASE_URL is provided, it uses SSL for cloud DBs. Otherwise, it falls back to local variables).
PORT=5000
DATABASE_URL=your_neon_or_local_postgres_connection_string
# Interswitch API Credentials (Sandbox)
INTERSWITCH_CLIENT_ID=your_test_client_id
INTERSWITCH_SECRET_KEY=your_test_secret_key
INTERSWITCH_PASSPORT_ENV=[https://qa.interswitchng.com/passport/oauth/token](https://qa.interswitchng.com/passport/oauth/token)
INTERSWITCH_MERCHANT_CODE=MX6072Start the server:
npm startOpen a new terminal window:
cd frontend/diagnosticspay
npm installCreate a .env.local file in the /frontend/diagnosticspay directory:
NEXT_PUBLIC_API_BASE_URL=http://localhost:5000Start the frontend:
npm run devOpen http://localhost:3000 to view the application.
Our Express backend exposes 4 optimized endpoints to power the orchestration layer:
Creates an aggregated bill from multiple diagnostic tests.
- Payload:
{"patient_name": "Chukwudi Okafor", "test_ids": [1, 2]} - Response:
{"order_id": "ORD-123456-789", "total_amount": 19000}
Generates the unique transaction reference needed for Web Checkout.
- Payload:
{"order_id": "ORD-123456-789"} - Response:
{"invoice_id": "TXN-1711270000000", "payment_link": "https://dxpay.vercel.app/pay/TXN-1711270000000", "amount": 19000}
Verifies the transaction with Interswitch and triggers the Payment Split Engine to allocate funds to providers.
- Query:
?transaction_reference=TXN-1711270000000 - Response:
{"payment_status": "successful"}(Includes a graceful demo fallback if sandbox is unreachable).
Fetches real-time revenue and transaction data based on successfully split funds.
- Query:
?provider_id=1 - Response: Returns aggregated
total_revenue,number_of_tests, and thetransactionsledger.
- Hassan Ismail — Product and Frontend Lead
- Ayomide Ayodele-Soyebo — Backend + Data Engineer
- Simbiat Jinadu — Frontend + UX/UI Design
- Olamitunji Akinwale — Product Manager / Operations