1- # Payment Hub EE - Operations Web App (React)
1+ # Payment Hub EE — Operations Web App (React)
22
3- This repository contains the React-based rewrite of the Payment Hub EE Operations Web App. The goal is to achieve feature parity with the existing Angular Operations App through an MVP release targeted for version 2.1.0 (October 2026).
3+ A modern React-based rebuild of the Payment Hub EE Operations App, replacing the legacy Angular frontend. Built as part of ** C4GT DMP 2026 ** under the [ Mifos Initiative ] ( https://mifos.org ) , targeting release ** 2.1.0 (October 2026)** .
44
5- It is currently work in progress and not recommended for production deployment .
5+ > The ` main ` branch contains release code. All PRs should target the ` dev ` branch first and will be merged to ` main ` at release .
66
7- The ` main ` branch contains release code. All PRs should be submitted to the ` dev ` branch first, and will be merged to ` main ` at a release.
7+ ---
88
9- This project is part of ** C4GT DMP 2026 ** under [ The Mifos Initiative ] ( https://mifos.org ) .
9+ ## Tech Stack
1010
11- ## Tech Stack
12-
13- - ** React + TypeScript** – Frontend architecture
14- - ** Vite** – Build tool
15- - ** Tailwind CSS v4 + ShadCN UI (Radix Nova)** – UI and styling
16- - ** React Router v6** – Routing
17- - ** TanStack Query** – Server state management
18- - ** Axios** – HTTP client
19- - ** Keycloak** – Authentication and RBAC (OAuth2)
20-
21- ## Project Structure
11+ | Layer | Technology |
12+ | ---| ---|
13+ | Framework | React 19 + TypeScript 6 (Vite 8) |
14+ | UI | ShadCN UI (Radix Nova) + TailwindCSS v4 |
15+ | Routing | React Router v7 |
16+ | Server state | TanStack Query v5 |
17+ | HTTP client | Axios |
18+ | Auth | Keycloak JS — ROPC (Direct Grant) flow |
19+ | Charts | Recharts |
20+ | PDF export | jsPDF + jspdf-autotable |
21+
22+ ---
23+
24+ ## Features
25+
26+ - ** Dashboard** — operational overview with KPI stats, recent batches, recent vouchers, quick actions
27+ - ** Payment Hub** — Main Batches, Sub Batches, Transfers with status filters, CSV/PDF export
28+ - ** Voucher Management** — voucher list with status filters, bulk CSV upload
29+ - ** Account Mapper** — beneficiary management, create beneficiary form, self-service portal
30+ - ** G2P Payment Config** — configuration list and create form
31+ - ** RBAC** — role configuration cards and user management with lock/unlock
32+ - ** Reporting Dashboard** — Recharts line/bar/pie charts, KPI metrics, failed batch table, date/tenant filters
33+ - ** Settings** — app configuration with accordion sections
34+ - ** In-app Keycloak authentication** — ROPC flow, token stored in ` localStorage ` , JWT expiry validation
35+ - ** Animated splash screen** — shimmer progress bar, auto-navigates to login
36+
37+ ---
38+
39+ ## Project Structure
2240
2341```
2442src/
25- ├── modules/ # Feature modules, one per domain area
26- │ ├── auth/ # Keycloak integration, login, protected routes
27- │ ├── dashboard/ # Dashboard module cards
28- │ ├── payment-hub/ # Main Batches, Sub Batches, Transfers
29- │ ├── vouchers/ # Voucher Management (G2P)
30- │ ├── account-mapper/ # Beneficiary account mapping
43+ ├── modules/ # Feature modules, one per domain area
44+ │ ├── auth/ # Login page, Splash screen
45+ │ ├── payment-hub/ # Main Batches, Sub Batches, Transfers
46+ │ ├── vouchers/ # Voucher Management (G2P)
47+ │ ├── account-mapper/ # Beneficiary mapping + self-service portal
3148│ ├── g2p-config/ # G2P Payment Configuration
32- │ ├── settings/ # App settings
33- │ └── rbac/ # Role configuration and user management
49+ │ ├── rbac/ # Role config and user management
50+ │ ├── reporting/ # Reporting dashboard with charts
51+ │ └── settings/ # App settings
3452├── components/
35- │ ├── ui/ # ShadCN UI primitives
36- │ └── shared/ # Shared components ( AppLayout, DataTable, StatusBadge)
53+ │ ├── ui/ # ShadCN UI primitives
54+ │ └── shared/ # AppLayout, StatusBadge
3755├── lib/
38- │ ├── api/ # Axios client setup , API interceptors
39- │ └ ── keycloak/ # Keycloak auth context and hooks
40- ├── config/ # Environment config, constants
41- ├── types/ # Shared TypeScript types
42- ├── App.tsx # Root component
43- ├── index.css # Tailwind base layer and theme
44- ├── main.tsx # React entry point, router setup
45- └── vite-env.d.ts # Vite TypeScript definitions
56+ │ ├── api/ # Axios client, API functions (paymentHub, accountMapper)
57+ │ ├ ── keycloak/ # KeycloakProvider, useAuth hook, singleton
58+ │ ├── exportCsv.ts # CSV download utility
59+ │ └── exportPdf.ts # PDF download utility (jsPDF)
60+ ├── pages/ # Thin re-exports wiring modules to routes
61+ ├── config/ # Constants (APP_NAME, TENANTS, DEFAULT_TENANT)
62+ ├── main.tsx # Router setup, QueryClient, KeycloakProvider
63+ └── index.css # Tailwind base layer and theme
4664
4765root/
48- ├── components.json # ShadCN CLI config
49- ├── index.html # App HTML shell
50- ├── eslint.config.js # Linting rules
51- ├── .env.example # Environment variable template
52- └── .gitignore
66+ ├── components.json # ShadCN CLI config
67+ ├── index.html # App HTML shell + favicon
68+ ├── .env.example # Environment variable template
69+ └── vite.config.ts
5370```
5471
55- ## Prerequisites
72+ ---
5673
57- - Node.js and npm installed
58- - Access to a running Payment Hub EE backend instance (or use mock data during early development)
59- - A configured Keycloak realm for authentication (once auth integration begins)
74+ ## Prerequisites
6075
61- ## Installation & Setup
76+ - ** Node.js 18+** and npm
77+ - ** Docker Desktop** — for running Keycloak locally
78+ - Access to a ** Mifos Gazelle** backend instance (or use built-in mock data)
79+
80+ ---
81+
82+ ## Installation
6283
6384``` bash
6485# 1. Clone the repository
@@ -70,62 +91,147 @@ cd ph-ee-operations-web-react
7091# 3. Install dependencies
7192npm install
7293
73- # 4. Copy environment variables and configure them
94+ # 4. Copy and configure environment variables
7495cp .env.example .env
7596
7697# 5. Start the development server
7798npm run dev
7899```
79100
80- Navigate to ` http://localhost:5173/ ` to view the app. It will automatically reload if you change any source files.
101+ Navigate to ` http://localhost:5173/ ` — the app auto-reloads on file changes.
102+
103+ ---
81104
82- ## Environment Variables
105+ ## Environment Variables
83106
84- Copy ` .env.example ` to ` .env ` and adjust the values as needed .
107+ Copy ` .env.example ` to ` .env ` and fill in the values.
85108
86109| Variable | Description |
87110| ---| ---|
88- | ` VITE_API_BASE_URL ` | Base URL for the Payment Hub Operations backend services |
89- | ` VITE_BULK_CONNECTOR_URL ` | URL for Bulk Import Batch creation backend services |
90- | ` VITE_KEYCLOAK_URL ` | Keycloak auth server URL |
91- | ` VITE_KEYCLOAK_REALM ` | Keycloak realm used for authentication |
92- | ` VITE_KEYCLOAK_CLIENT_ID ` | Keycloak client identifier for this app |
111+ | ` VITE_API_BASE_URL ` | Base URL for the Payment Hub Operations backend ( ` /api/v1 ` ) |
112+ | ` VITE_BULK_CONNECTOR_URL ` | URL for Bulk Import / Batch creation backend |
113+ | ` VITE_KEYCLOAK_URL ` | Keycloak auth server URL (e.g. ` http://localhost:8180 ` ) |
114+ | ` VITE_KEYCLOAK_REALM ` | Keycloak realm (e.g. ` paymenthub ` ) |
115+ | ` VITE_KEYCLOAK_CLIENT_ID ` | Keycloak client ID (e.g. ` opsapp ` ) |
93116| ` VITE_TENANT_ID ` | Default Platform Tenant Identifier used in API calls |
94117
95- ## Routes
118+ ---
96119
97- | Route | Description |
98- | ---| ---|
99- | ` /splash ` | Animated landing screen |
100- | ` /login ` | Login with Keycloak authentication |
101- | ` / ` | Dashboard with module cards |
102- | ` /payment-hub ` | Main Batches, Sub Batches, Transfers |
103- | ` /vouchers ` | Voucher Management (list and create) |
104- | ` /account-mapper ` | Beneficiary account mapping (list and create) |
105- | ` /g2p-config ` | G2P Payment Configuration (list and create) |
106- | ` /settings ` | App settings |
107- | ` /rbac ` | Role configuration and user management |
108- | ` /reporting ` | Reporting dashboard (in development) |
109-
110- ## Building for Production
120+ ## Keycloak Setup (Local Docker)
121+
122+ Run Keycloak locally on port 8180:
123+
124+ ``` bash
125+ docker run -p 8180:8080 \
126+ -e KC_BOOTSTRAP_ADMIN_USERNAME=admin \
127+ -e KC_BOOTSTRAP_ADMIN_PASSWORD=admin \
128+ quay.io/keycloak/keycloak:latest start-dev
129+ ```
130+
131+ Then configure at ` http://localhost:8180 ` :
132+
133+ 1 . Create realm: ` paymenthub `
134+ 2 . Create client: ` opsapp `
135+ - ** Client authentication:** OFF
136+ - ** Direct access grants:** ON
137+ - ** Valid redirect URIs:** ` http://localhost:5173/* `
138+ - ** Web origins:** ` http://localhost:5173 `
139+ 3 . Create a test user and set credentials
140+
141+ Update ` .env ` :
142+
143+ ``` env
144+ VITE_KEYCLOAK_URL=http://localhost:8180
145+ VITE_KEYCLOAK_REALM=paymenthub
146+ VITE_KEYCLOAK_CLIENT_ID=opsapp
147+ ```
148+
149+ ---
150+
151+ ## Gazelle Backend Setup
152+
153+ Add to your hosts file (` C:\Windows\System32\drivers\etc\hosts ` on Windows, ` /etc/hosts ` on Linux/macOS):
154+
155+ ```
156+ <VM-IP> ops.mifos.gazelle.test
157+ <VM-IP> kibana-phee.mifos.gazelle.test
158+ <VM-IP> zeebe-operate.mifos.gazelle.test
159+ <VM-IP> bulk-connector.mifos.gazelle.test
160+ ```
161+
162+ Update ` .env ` :
163+
164+ ``` env
165+ VITE_API_BASE_URL=https://ops.mifos.gazelle.test/api/v1
166+ VITE_BULK_CONNECTOR_URL=https://bulk-connector.mifos.gazelle.test
167+ VITE_TENANT_ID=greenbank
168+ ```
169+
170+ ---
171+
172+ ## Routes
173+
174+ | Route | Auth | Description |
175+ | ---| ---| ---|
176+ | ` /splash ` | Public | Animated splash screen |
177+ | ` /login ` | Public | In-app Keycloak login (ROPC) |
178+ | ` / ` | Protected | Dashboard — KPIs, recent batches, quick actions |
179+ | ` /payment-hub ` | Protected | Main Batches, Sub Batches, Transfers |
180+ | ` /vouchers ` | Protected | Voucher list, status filters, CSV upload |
181+ | ` /account-mapper ` | Protected | Beneficiary list and create form |
182+ | ` /g2p-config ` | Protected | G2P Payment Config list and create |
183+ | ` /rbac ` | Protected | Role config and user management |
184+ | ` /reporting ` | Protected | Charts, KPI metrics, failed batch table |
185+ | ` /settings ` | Protected | App configuration |
186+ | ` /account-mapper/self-service ` | ** Public** | Beneficiary self-service portal (iframe) |
187+
188+ ---
189+
190+ ## Account Mapper Self-Service Portal
191+
192+ The self-service portal is a standalone, iframe-friendly page for beneficiaries to update their own payment details — no Keycloak credentials required.
193+
194+ ** URL format:**
195+ ```
196+ /account-mapper/self-service?beneficiaryId={id}
197+ ```
198+
199+ ** Example:**
200+ ```
201+ http://localhost:5173/account-mapper/self-service?beneficiaryId=9876543210
202+ ```
203+
204+ - Looks up the beneficiary via ` GET /beneficiary/{id} ` (falls back to mock data if the API is unreachable)
205+ - Pre-fills a form with current Financial Institution, Financial Address, and Payment Modality
206+ - On submit calls ` PUT /beneficiary/{id} ` via TanStack Query ` useMutation `
207+ - No sidebar, no header — minimal white card layout, mobile responsive, embeddable in external portals
208+
209+ ---
210+
211+ ## Building for Production
111212
112213``` bash
113214npm run build
114215```
115216
116- Build artifacts will be stored in the ` dist/ ` directory .
217+ Build artifacts are output to ` dist/ ` .
117218
118- ## Contributing
219+ ---
119220
120- Contributions are welcome to improve the project.
221+ ## Contributing
222+
223+ Contributions are welcome.
121224
122225- All PRs should target the ` dev ` branch
123- - Reference the relevant Jira ticket in your PR title, e.g. ` PHEE-XXX: short description `
226+ - Reference the relevant Jira ticket in your PR title: ` PHEE-XXX: short description `
124227- For design references, see the Figma file (link to be added)
125228- For backend integration questions or access, reach out to the project mentors
126229
127- ## Related Links
230+ ---
231+
232+ ## Related Links
128233
129- - [ Angular Operations App (reference implementation )] ( https://github.com/openMF/ph-ee-operations-web )
234+ - [ Angular Operations App (reference)] ( https://github.com/openMF/ph-ee-operations-web )
130235- [ Jira Epic — PHEE-363] ( https://mifosforge.jira.com/browse/PHEE-363 )
131- - [ The Mifos Initiative] ( https://mifos.org )
236+ - [ The Mifos Initiative] ( https://mifos.org )
237+ - [ C4GT DMP 2026] ( https://codeforgovtech.in )
0 commit comments