System Architecture

Multi-portal monolithic architecture with Java EE backend, React frontends, and MariaDB database

High-Level Architecture

Monolithic backend deployed on WildFly 31 with three React frontend portals

┌─────────────────────────────────────────────────────────────────────────┐
│                           CLIENT LAYER                                  │
│                                                                         │
│  ┌─────────────┐  ┌─────────────┐  ┌───────────────┐                  │
│  │  AdminApp   │  │ FinanceApp  │  │Customer Portal│                  │
│  │  React 18.2 │  │ React 18.2  │  │  React 18.2   │                  │
│  │  :3000      │  │  :3001      │  │  :3002        │                  │
│  └──────┬──────┘  └──────┬──────┘  └───────┬───────┘                  │
└─────────┼────────────────┼─────────────────┼──────────────────────────┘
          │                │                 │
          ▼                ▼                 ▼
┌─────────────────────────────────────────────────────────────────────────┐
│                    REVERSE PROXY (Nginx — port 443)                     │
└─────────────────────────────┬───────────────────────────────────────────┘
                              │
┌─────────────────────────────▼───────────────────────────────────────────┐
│              MONOLITHIC APPLICATION SERVER (WildFly 31 + JDK 17)       │
│              Deployed as WAR on Jakarta EE 10 Container                │
│                                                                         │
│  ┌─────────────────────────────────────────────────────────────────┐    │
│  │                    JAX-RS REST API Layer                        │    │
│  │              (MicroProfile OpenAPI 3.1 documented)             │    │
│  └─────────────────────────────┬───────────────────────────────────┘    │
│                                │                                        │
│  ┌─────────────────────────────▼───────────────────────────────────┐    │
│  │                    EJB Business Logic Layer                     │    │
│  │                                                                 │    │
│  │  ┌──────────┐ ┌──────────┐ ┌──────────┐ ┌───────────────────┐ │    │
│  │  │ Auth &   │ │ Loan     │ │ Deposit  │ │ Voucher / Invoice │ │    │
│  │  │ User Mgmt│ │ Mgmt     │ │ Mgmt     │ │ Module            │ │    │
│  │  ├──────────┤ ├──────────┤ ├──────────┤ ├───────────────────┤ │    │
│  │  │ Member   │ │ Payment  │ │ JV &     │ │ Investment        │ │    │
│  │  │ Mgmt     │ │ Mgmt     │ │ Escrow   │ │ Module            │ │    │
│  │  ├──────────┤ ├──────────┤ ├──────────┤ ├───────────────────┤ │    │
│  │  │ Branch   │ │ Fund     │ │ Report   │ │ Notification      │ │    │
│  │  │ Mgmt     │ │ Transfer │ │ Engine   │ │ (Email/WhatsApp)  │ │    │
│  │  └──────────┘ └──────────┘ └──────────┘ └───────────────────┘ │    │
│  └─────────────────────────────────────────────────────────────────┘    │
│                                                                         │
│  ┌─────────────────────────────────────────────────────────────────┐    │
│  │              JPA / Hibernate 6.2.x ORM Layer                    │    │
│  └─────────────────────────────┬───────────────────────────────────┘    │
│                                │                                        │
│  ┌──────────────┐  ┌──────────▼──────┐  ┌──────────────────────────┐   │
│  │ Redis Cache  │  │ MariaDB 10.6    │  │ JasperReports 6.20.6    │   │
│  │ (Jedis 5.0.2)│  │ (JDBC 3.x)     │  │ (PDF/Excel Generation)  │   │
│  └──────────────┘  └─────────────────┘  └──────────────────────────┘   │
│                                                                         │
│  ┌─────────────────────────────────────────────────────────────────┐    │
│  │  Jakarta Mail 2.0.1  │  Meta WhatsApp Cloud API  │  Node.js   │    │
│  └─────────────────────────────────────────────────────────────────┘    │
└─────────────────────────────────────────────────────────────────────────┘

Multi-Portal Architecture

:3000 → :8080

Admin Portal

Back-office operations: loan processing, user management, branch operations, accounting, investment management

React 18 • TypeScript • Vite 5 • Tailwind 3.4
:3001 → :8080 / :8087

Finance App

Financial management: journal entries, vouchers, reconciliation, reporting, chart of accounts

React 18 • TypeScript • Vite 5 • Tailwind 3.4
:3002 → :8080

Customer Portal

Member self-service: loan applications, account management, fund transfers, payments, statements

React 18 • TypeScript • Vite 5 • Tailwind 3.4
:8080 (WildFly)

Core Backend

Java EE monolith: temco-loan-system.war, temco-bank.war, temco-api.war — JWT auth, EJB business logic, JPA ORM

WildFly 31 • Jakarta EE 10 • JDK 17

Vite Proxy Configuration

Development proxy routing for each frontend application

AppProxy RuleTarget
AdminApp (:3000)/api/v1/*/temco-loan-system/api/v1/customer/*localhost:8080
FinanceApp (:3001)/api/v1/auth/*/temco-loan-system/api/v1/customer/*localhost:8080
FinanceApp (:3001)/api/*/temco-api/api/*localhost:8087
Customer Portal (:3002)/api/*/temco-loan-system/*localhost:8080
Customer Portal (:3002)/api/studentslocalhost:8086

Authentication Flow

JWT-based SSO across all three portals via WildFly backend

Client → POST /api/v1/auth/login (username, password)
    │
    ▼
WildFly (temco-loan-system.war)
    │ → Validate credentials (BCrypt)
    │ → Check account lock (count_attempt >= max_login_attempt)
    │ → Generate JWT token
    │
    ▼
Response: {
    success: true,
    token: "eyJhbGciOi...",
    user: {
        id, username, email, fullName,
        nic, roleId, roleName
    },
    expiresAt: "2026-02-12T..."
}
    │
    ▼
Client stores token in Zustand store
All subsequent requests: Authorization: Bearer <token>

Full Technology Stack

Backend

Java17 LTS
Jakarta EE10.0.0
WildFly31.0.1
Hibernate ORM6.2.x
JAX-RSbuilt-in
EJBbuilt-in
JWT (jjwt)0.11.5
BCrypt (jbcrypt)0.4
Jackson2.15.x
JasperReports6.20.6
Redis (Jedis)5.0.2
Jakarta Mail2.0.1
OpenAPI3.1
Mavenbuild
JUnit 55.10
Mockito5.7

Frontend

React18.2
TypeScript5.3
Vite5.0
React Router6.21
Axios1.6
Zustand4.4
Tailwind CSS3.4
Lucide React0.300
Recharts2.10
date-fns3.0
React Hook Form7.49
React Query5.8
React Hot Toast2.4

Infrastructure

MariaDB10.6
Redis7 Alpine
Elasticsearch8.11
DockerCompose
NginxSSL/443
Ubuntu22.04
Node.js24.x
WhatsApp APIMeta Cloud
Contabo VPSProduction
SSHEd25519

Production Deployment

Docker-based deployment on Contabo VPS with Nginx reverse proxy

┌─────────────────────────────────────────────────────────────┐
│              PRODUCTION SERVER                                │
│              109.123.227.166 (Contabo VPS, Ubuntu 22.04)    │
│              SSH: root@temco-prod (Ed25519 key)             │
│                                                              │
│  ┌────────────────────────────────────────────────────────┐ │
│  │  Host Nginx (port 443 — SSL Termination)               │ │
│  │  ├── /admin/*     → localhost:8089 (admin-frontend)    │ │
│  │  ├── /finance/*   → localhost:8091 (finance-frontend)  │ │
│  │  ├── /portal/*    → localhost:8092 (my-frontend)       │ │
│  │  ├── /api/*       → localhost:8088 (admin-wildfly)     │ │
│  │  └── /finance-api/*→ localhost:8087 (finance-api)      │ │
│  └────────────────────────────────────────────────────────┘ │
│                                                              │
│  ┌──── Docker Containers ────────────────────────────────┐  │
│  │  ┌──────────────┐  ┌──────────────┐                   │  │
│  │  │admin-wildfly │  │ finance-api  │                   │  │
│  │  │WildFly 31    │  │ WildFly 31   │                   │  │
│  │  │:8088→8080    │  │ :8087→8080   │                   │  │
│  │  └──────────────┘  └──────────────┘                   │  │
│  │  ┌──────────────┐  ┌──────────────┐  ┌─────────────┐ │  │
│  │  │admin-frontend│  │finance-front │  │my-frontend  │ │  │
│  │  │Nginx:Alpine  │  │Nginx:Alpine  │  │Nginx:Alpine │ │  │
│  │  │:8089→80      │  │:8091→80      │  │:8092→80     │ │  │
│  │  └──────────────┘  └──────────────┘  └─────────────┘ │  │
│  └────────────────────────────────────────────────────────┘  │
│                                                              │
│  ┌──── Host Services ────────────────────────────────────┐  │
│  │  ┌──────────────┐  ┌──────────────┐  ┌─────────────┐ │  │
│  │  │ MariaDB 10.6 │  │ Redis 7      │  │Elasticsearch│ │  │
│  │  │ :3306        │  │ :6379        │  │ 8.11 :9200  │ │  │
│  │  └──────────────┘  └──────────────┘  └─────────────┘ │  │
│  └────────────────────────────────────────────────────────┘  │
└─────────────────────────────────────────────────────────────┘

WildFly WAR Deployments

WAR FilePurposePortKey Modules
temco-loan-system.warCore banking & SSO authentication8080Auth, User, Loan, Member, Branch
temco-bank.warBanking operations8080Deposits, Transactions, JV, Investments
temco-bank-system-project.warSystem management8080Config, Permissions, Audit
temco-api.warFinance API8087Vouchers, Journal Entries, Reports