You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+104-9Lines changed: 104 additions & 9 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -12,7 +12,7 @@ Mifos X Web App is a modern single-page application (SPA) built on top of the Mi
12
12
13
13
## Quick Links
14
14
15
-
-[Live Demo](https://sandbox.mifos.community/#/login) (Updated nightly ** System is restored every 6 hours**)
15
+
-[Live Demo](https://sandbox.mifos.community/#/login) (Updated nightly — sandbox data is reset every 6 hours; test data and transient state may be cleared.)
-[Jira Board of Mifos](https://mifosforge.jira.com/jira/your-work)
@@ -31,13 +31,13 @@ Before installing the web app, you need to set up the Fineract backend server:
31
31
32
32
1.**Choose ONE of these backend options:**
33
33
-**Option A: Use existing remote server**
34
-
- Use the sandbox (MariaDB) at https://sandbox.mifos.community** System is restored every 6 hours**
35
-
- Use the demo (MariaDB) at https://demo.mifos.community
36
-
- Use the demo (Keycloak) at https://oauth.mifos.community
37
-
- Use the demo (2FA) at https://2fa.mifos.community
38
-
- Use the demo (Oidc) at https://oidc.mifos.community
39
-
- Use the demo (Postgres) at https://elephant.mifos.community
40
-
- Configure to your server by updating API URLs in environment files
34
+
- Use the [sandbox (MariaDB)](https://sandbox.mifos.community) — sandbox data is reset every 6 hours; test data and transient state may be cleared.
35
+
- Use the [demo (MariaDB)](https://demo.mifos.community)
36
+
- Use the [demo (Keycloak)](https://oauth.mifos.community)
37
+
- Use the [demo (2FA)](https://2fa.mifos.community)
38
+
- Use the [demo (Oidc)](https://oidc.mifos.community)
39
+
- Use the [demo (Postgres)](https://elephant.mifos.community)
40
+
- Configure to your server by updating API URLs in environment files
41
41
42
42
-**Option B: Install local Fineract server**
43
43
@@ -132,6 +132,101 @@ When using the development server with basic authentication:
132
132
-**Build for production:**`ng build --configuration production` or `npm run build:prod`
133
133
-**Get Angular CLI help:**`ng help`
134
134
135
+
## Proxy Configuration
136
+
137
+
The web app includes a proxy configuration (`proxy.conf.js`) that allows you to forward API requests to a remote Fineract backend during local development. This helps avoid CORS issues and enables you to work against production-like environments.
138
+
139
+
### Using the Sandbox Proxy (Default)
140
+
141
+
By default, the proxy forwards `/fineract-provider` requests to the Mifos sandbox environment:
142
+
143
+
-**Target:**`https://sandbox.mifos.community`
144
+
-**API Endpoint:**`https://apis.mifos.community` (exposed in the sandbox)
145
+
-**System Reset:** Sandbox test data and transient state are reset every 6 hours (expect data to be periodically cleared).
Use the provided localhost proxy file (recommended for `ng serve`):
167
+
168
+
1. Start the dev server with the localhost proxy:
169
+
170
+
```bash
171
+
ng serve --proxy-config proxy.localhost.conf.js
172
+
```
173
+
174
+
2. Ensure your local Fineract instance is running on `http://localhost:8443`.
175
+
176
+
Notes:
177
+
178
+
-`proxy.localhost.conf.js` forwards `/fineract-provider` to your local backend to avoid CORS during development.
179
+
- The `HttpsProxyAgent` / `setupForProxy` logic (present in `proxy.conf.js`) is only necessary when an upstream corporate/HTTP proxy must be used (set via `HTTP_PROXY`/`http_proxy`). It is not required for a direct `localhost` backend.
180
+
181
+
### Proxy Features
182
+
183
+
-**CORS Avoidance:** Eliminates cross-origin issues during local development
184
+
-**Error Handling:** Gracefully handles proxy failures with detailed logging
185
+
-**Corporate Proxy Support:** Maintains support for corporate proxy agents via `HTTP_PROXY` environment variable
186
+
-**Debug Logging:** All proxy requests are logged for troubleshooting
187
+
188
+
The proxy is configured to work with Fineract endpoints as described in this section.
189
+
190
+
### Testing the Proxy
191
+
192
+
To verify the proxy is working correctly, start the development server (`ng serve`) and test with curl:
To allow external API calls redirection through a corporate proxy, you will also find a `setupForCorporateProxy()`
37
-
function in the proxy configuration file. By default, this method configures a corporate proxy agent based on the
38
-
`HTTP_PROXY` environment variable, see the [corporate proxy documentation](corporate-proxy.md) for more details.
77
+
The repository configures a helper function in `proxy.conf.js` named `setupForProxy` which will attach an
78
+
`HttpsProxyAgent` to proxy entries when the `HTTP_PROXY` (or `http_proxy`) environment variable is present. This lets
79
+
the dev server forward requests through a corporate proxy when required.
80
+
81
+
**Behavior:**
82
+
83
+
-**When `HTTP_PROXY` is set:** Logs `"Using proxy server: <url>"` and configures the agent for corporate proxy forwarding
84
+
-**When `HTTP_PROXY` is not set:** Logs `"No proxy server configured. API requests will not be proxied."` — note that this refers only to corporate proxy forwarding; the Angular dev server proxy (forwarding `/fineract-provider` to the sandbox) still works normally
39
85
40
-
If you need to, you can further customize this function to fit the network of your working environment.
86
+
See `proxy.conf.js` for the exact implementation.
41
87
42
-
If your corporate proxy use a custom SSL certificate, your may need to add the `secure: false`option to your
43
-
backend proxy configuration.
88
+
If your corporate proxy uses a custom SSL certificate you may need to set `secure: false`on the specific proxy entry
89
+
or configure your environment to trust the corporate CA.
0 commit comments