Skip to content

About

This repo is for the react version of the Mifos-X web-app. This is currently not recommended for deployment and is work in progress. Main branch contains release code.

Resources

Code of conduct

Contributing

Security policy

Stars

21 stars

Watchers

0 watching

Forks

Latest commit

Β 

History

447 Commits

Folders and files

NameName
Last commit message
Last commit date
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

mifos-x-web-app-react

This repo is for the React version of the Mifos-X web-app.
It is currently work in progress and not recommended for deployment.

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.

This project is part of Google Summer of Code 2025 under The Mifos Initiative.


πŸš€ Tech Stack

  • React + TypeScript – Frontend architecture
  • Tailwind CSS + ShadCN UI – UI and styling
  • Redux Toolkit – Global state management
  • Vite – Build tool
  • Fineract API (OpenAPI-generated client) – Backend integration

πŸ“ Project Structure

src/
β”œβ”€β”€ app/              # Redux store setup (slices, providers)
β”œβ”€β”€ assets/           # Static assets (images, logos, etc.)
β”œβ”€β”€ components/       # Reusable UI components
β”‚   β”œβ”€β”€ custom/       # Feature-specific ShadCN components
β”‚   β”œβ”€β”€ styles/       # Custom styles and overrides
β”‚   └── ui/           # Core ShadCN UI elements
β”œβ”€β”€ fineract-api/     # OpenAPI-generated Fineract client
β”œβ”€β”€ hooks/            # Custom React hooks
β”œβ”€β”€ layout/           # Navbar, sidebar, app shell components
β”œβ”€β”€ lib/              # API clients, helper utilities
β”œβ”€β”€ pages/            # Route-based page components (contains all the pages)
β”œβ”€β”€ router/           # React Router setup
β”œβ”€β”€ App.tsx           # Root component
β”œβ”€β”€ index.css         # Global styles (Tailwind base layer)
β”œβ”€β”€ main.tsx          # React entry point
β”œβ”€β”€ vite-env.d.ts     # Vite TypeScript definitions

root/
β”œβ”€β”€ fineract.yaml         # OpenAPI spec for Fineract
β”œβ”€β”€ openapitools.json     # OpenAPI generator config
β”œβ”€β”€ components.json       # ShadCN CLI config
β”œβ”€β”€ index.html            # App HTML shell
β”œβ”€β”€ .eslintrc.js          # Linting rules
β”œβ”€β”€ .gitignore

βš™οΈ Prerequisites

  • A working Apache Fineract backend running locally
  • Node.js and npm installed

πŸ› οΈ Installation & Setup

# 1. Clone the repository
git clone https://github.com/openMF/mifos-x-web-app-react.git

# 2. Move into the project directory
cd mifos-x-web-app-react

# 3. Install dependencies
npm install

# 4. Generate the Fineract API client from OpenAPI spec
npm run generate-sdk

# 5. Start the development server
npm run dev

οΏ½ Docker Deployment

Quick Start with Docker Compose

Run the complete stack (web app + Fineract backend + database):

# 1. Copy and configure environment file
cp .env.docker.sample .env.docker
# Edit .env.docker with your database passwords

# 2. Start all services
docker compose -f docker-compose-zitadel.yml up -d

# 3. Access the application
# Web App: http://localhost:10706
# Fineract API: https://localhost:3000

Production Deployment

For production with security hardening and resource limits:

docker compose -f docker-compose-zitadel.yml -f docker-compose.prod.yml up -d

The production overlay requires TLS on both database connections (sslmode=verify-full). Before starting it, place ca.crt, server.crt, server.key and a pg_hba.conf in the directory given by POSTGRES_TLS_DIR, and the same ca.crt in FINERACT_TLS_DIR. The server certificate must carry a subject alternative name of fineractpostgres. A starting point for the hba file is provided at fineract-db/tls/pg_hba.conf.sample, which refuses any connection that is not encrypted.

Using Pre-built Docker Image

Pull and run the latest image from Docker Hub:

docker pull mifos/web-app-react:latest

docker run -d -p 80:80 \
  -e FINERACT_API_URL=https://your-fineract-server:8443 \
  -e FINERACT_API_PROVIDER=/fineract-provider \
  -e FINERACT_PLATFORM_TENANT_IDENTIFIER=default \
  --name mifos-web-app \
  mifos/web-app-react:latest

Build Custom Docker Image

docker build -t mifos/web-app-react:custom .

Docker Features:

  • Multi-stage build for optimized image size (~50MB)
  • Nginx web server with security headers
  • Runtime environment variable configuration
  • Non-root user for enhanced security
  • Health checks included
  • Multi-platform support (linux/amd64, linux/arm64)

For Docker environment variables, see .env.docker.sample.


οΏ½πŸ”§ Environment Variables

The application uses environment variables for configuration. Copy .env.sample to .env or .env.development.local and adjust the values as needed.

Variable Description Default
VITE_FINERACT_API_URL Base URL for the Fineract server (protocol + host + port) https://localhost:3000
VITE_FINERACT_API_PROVIDER API path prefix /fineract-provider
VITE_FINERACT_API_VERSION API version path /api
VITE_FINERACT_PLATFORM_TENANT_IDENTIFIER Tenant identifier for multi-tenant deployments default
VITE_FINERACT_PLATFORM_TENANTS_IDENTIFIER More tenants to offer on the sign-in page, comma separated (empty)
VITE_MIFOS_SESSION_IDLE_TIMEOUT Sign out after this many ms without activity (0 = off) 300000

Note: In development, .env.development intentionally leaves VITE_FINERACT_API_URL empty so requests use relative URLs and go through the Vite dev proxy, which forwards /fineract-provider/* to the value above (see vite.config.ts). 3000 is the host port the Docker Compose stack publishes for Fineract. Only override this if you run Fineract yourself on another port.

.env.development also sets VITE_MIFOS_SESSION_IDLE_TIMEOUT=0, so the dev server never signs you out for inactivity. To test the idle timeout locally, set a value such as 60000 in .env.development.local.

Manual Fineract Setup (Without Docker)

If running Apache Fineract manually (e.g., on https://localhost:8443):

  1. Create a file: .env.development.local

  2. Add the below configurations

# .env.development.local
VITE_FINERACT_API_URL=https://localhost:8443
VITE_FINERACT_API_PROVIDER=/fineract-provider
VITE_FINERACT_API_VERSION=/api
VITE_FINERACT_PLATFORM_TENANT_IDENTIFIER=default
VITE_FINERACT_PLUGIN_OIDC_ENABLED=false

Note: Files ending in .local are ignored by git and should be used for machine-specific configuration.


πŸ€– Copilot (Optional)

Mifos X Copilot is an AI assistant panel. It is off by default and needs the Copilot gateway from openMF/mcp-mifosx. The web app only talks to that gateway, with the signed-in officer's own credential. It never holds an AI key and never chooses the AI model.

Variable Description Default
VITE_MIFOS_ENABLE_COPILOT Turn the Copilot on false
VITE_MIFOS_COPILOT_MCP_BASE_URL Gateway URL (https, or mock for a demo) (empty)

The launcher appears only when the Copilot is on and the gateway URL is set. With the URL empty, or not https, it stays hidden and the browser console says why. http://localhost is accepted by the dev server only.

Try it without a gateway

# .env.development.local
VITE_MIFOS_ENABLE_COPILOT=true
VITE_MIFOS_COPILOT_MCP_BASE_URL=mock

mock plays recorded sample answers and marks the panel Demo. Nothing in them comes from Fineract, so do not use it in production.

Run it with the gateway

In a checkout of openMF/mcp-mifosx (Java 21+):

cd gateway

# Allow this app's dev server, and point at the same Fineract this app uses
export COPILOT_ALLOWED_ORIGINS=http://localhost:5173
export FINERACT_BASE_URL=https://your-fineract-host

./mvnw spring-boot:run                                  # scripted AI, real Fineract reads
COPILOT_LLM_PROVIDER=groq COPILOT_LLM_API_KEY=gsk_... ./mvnw spring-boot:run
COPILOT_LLM_PROVIDER=ollama COPILOT_LLM_MODEL=qwen3:8b ./mvnw spring-boot:run   # model on your machine

Then, in this app:

# .env.development.local
VITE_MIFOS_ENABLE_COPILOT=true
VITE_MIFOS_COPILOT_MCP_BASE_URL=http://localhost:8090

Things that commonly go wrong:

  • Nothing happens, CORS error in the console: the app's origin is missing from COPILOT_ALLOWED_ORIGINS.
  • "Configuration mismatch": the gateway's FINERACT_BASE_URL is a different server from the one this app signed in to. They must match, so the Copilot can never act on another institution's data.
  • Every lookup fails: the gateway's FINERACT_API_PATH does not match how that Fineract publishes its API.

The AI provider and model (COPILOT_LLM_PROVIDER, COPILOT_LLM_MODEL, COPILOT_LLM_API_KEY, COPILOT_LLM_BASE_URL) are gateway settings; see the gateway README.


🀝 Contributing

Contributions are welcome to improve the project.

About

This repo is for the react version of the Mifos-X web-app. This is currently not recommended for deployment and is work in progress. Main branch contains release code.

Resources

Code of conduct

Contributing

Security policy

Stars

21 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages