Multi-portal monolithic architecture with Java EE backend, React frontends, and MariaDB database
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 │ │
│ └─────────────────────────────────────────────────────────────────┘ │
└─────────────────────────────────────────────────────────────────────────┘
Back-office operations: loan processing, user management, branch operations, accounting, investment management
Financial management: journal entries, vouchers, reconciliation, reporting, chart of accounts
Member self-service: loan applications, account management, fund transfers, payments, statements
Java EE monolith: temco-loan-system.war, temco-bank.war, temco-api.war — JWT auth, EJB business logic, JPA ORM
Development proxy routing for each frontend application
| App | Proxy Rule | Target |
|---|---|---|
| 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/students | localhost:8086 |
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>
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 │ │ │ │ │ └──────────────┘ └──────────────┘ └─────────────┘ │ │ │ └────────────────────────────────────────────────────────┘ │ └─────────────────────────────────────────────────────────────┘
| WAR File | Purpose | Port | Key Modules |
|---|---|---|---|
temco-loan-system.war | Core banking & SSO authentication | 8080 | Auth, User, Loan, Member, Branch |
temco-bank.war | Banking operations | 8080 | Deposits, Transactions, JV, Investments |
temco-bank-system-project.war | System management | 8080 | Config, Permissions, Audit |
temco-api.war | Finance API | 8087 | Vouchers, Journal Entries, Reports |