Skip to content

isharax9/nawwa-banking-system

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

79 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

🏦 Nawwa Banking System

Enterprise-Grade Banking Platform Built with Jakarta EE 10 & EJB

Java Jakarta EE GlassFish MySQL License

GitHub stars GitHub forks GitHub issues

πŸ“– Documentation β€’ πŸš€ Live Demo β€’ πŸ› Report Bug β€’ ✨ Request Feature


πŸ“‘ Table of Contents


🎯 Overview

The Nawwa Banking System is a modern, enterprise-grade core banking platform designed to revolutionize banking operations. Built on the robust Jakarta EE 10 platform with Enterprise JavaBeans (EJB), this system delivers unparalleled security, scalability, and reliability for mission-critical banking functions.

πŸŽ“ Core Objectives

βœ… Secure & Efficient - Manage core banking functions with enterprise-level security
βœ… Transactional Integrity - Leverage EJB for ACID-compliant transactions
βœ… Automated Operations - Utilize EJB Timer Services for scheduled tasks
βœ… Scalable Architecture - Multi-module design for independent development and deployment


✨ Key Features

Feature Description
πŸ” Secure Authentication BCrypt password hashing with robust user management
πŸ‘₯ Customer Management Complete lifecycle management of customer profiles and accounts
πŸ’° Transaction Processing Real-time and scheduled fund transfers with ACID compliance
⏰ Automated Services EJB Timer Services for interest calculation and scheduled operations
πŸ“Š Analytics Integration Google Analytics & Microsoft Clarity for user behavior insights
πŸ“„ PDF Reports Downloadable transaction statements and reports
πŸ›‘οΈ Multi-layer Security WAF, DDoS protection, and programmatic authorization
πŸ“± Responsive UI Modern interface with Bootstrap 5 and dynamic components

πŸ—οΈ System Architecture

The Nawwa Banking System employs a multi-module architecture that ensures separation of concerns and enables parallel development.

%%{init: {'theme': 'dark'}}%%
graph TB
    subgraph "Client Layer"
        A[Web Browser]
    end
    
    subgraph "CDN & Security"
        B[Cloudflare CDN/WAF]
    end
    
    subgraph "Proxy Layer"
        C[Nginx Reverse Proxy<br/>SSL Termination]
    end
    
    subgraph "Application Server - GlassFish 7"
        D[Web Module<br/>Servlets & JSP]
        E[Security Module<br/>EJB]
        F[Banking Services<br/>EJB]
        G[Transaction Services<br/>EJB]
        H[Timer Services<br/>EJB Singleton]
        I[Notification Services<br/>EJB]
        J[Core Module<br/>JPA Entities & DTOs]
    end
    
    subgraph "Data Layer"
        K[(MySQL 8.0<br/>Database)]
        L[S3 Bucket<br/>Backups]
    end
    
    A -->|HTTPS| B
    B -->|Cached/Filtered| C
    C -->|HTTP| D
    D --> E
    D --> F
    D --> G
    E --> J
    F --> J
    G --> J
    H --> J
    I --> J
    J -->|JPA| K
    K -.->|Hourly Backup| L
    H -.->|Scheduled Tasks| G
    H -.->|Interest Calculation| F

    style A fill:#4169E1
    style B fill:#FF8C00
    style C fill:#228B22
    style D fill:#9932CC
    style E fill:#6495ED
    style F fill:#6495ED
    style G fill:#6495ED
    style H fill:#FFD700
    style I fill:#2E8B57
    style J fill:#A0522D
    style K fill:#DAA520
    style L fill:#FF6347
Loading

πŸ“¦ Module Structure

Module Type Description
core JAR Foundational module with JPA entities, DTOs, mappers, and exceptions
security-module EJB Authentication, authorization, and user management
banking-services EJB Customer and account CRUD operations
transaction-services EJB Financial transaction processing with Facade pattern
timer-services EJB Automated background tasks (interest, scheduled transfers)
notification-services EJB Notification and alert management
web WAR Presentation layer with Servlets and JSP
ear EAR Final deployable Enterprise Archive
%%{init: {'theme': 'dark'}}%%
graph LR
    A[core<br/>JAR] --> B[security-module<br/>EJB]
    A --> C[banking-services<br/>EJB]
    A --> D[transaction-services<br/>EJB]
    A --> E[timer-services<br/>EJB]
    A --> F[notification-services<br/>EJB]
    B --> G[web<br/>WAR]
    C --> G
    D --> G
    E --> G
    F --> G
    G --> H[ear<br/>Enterprise Archive]
    B --> H
    C --> H
    D --> H
    E --> H
    F --> H

    style A fill:#4169E1
    style B fill:#FF8C00
    style C fill:#228B22
    style D fill:#9932CC
    style E fill:#6495ED
    style F fill:#6495ED
    style G fill:#6495ED
    style H fill:#FFD700
Loading

πŸ’» Technology Stack

Backend Technologies

Jakarta EE EJB JPA Java

Frontend Technologies

HTML5 CSS3 JavaScript Bootstrap jQuery

Infrastructure

MySQL GlassFish Nginx Cloudflare

Category Technology Purpose
Backend Framework Jakarta EE 10 Enterprise platform foundation
Business Logic EJB 4.0 (@Stateless, @Singleton) Transaction management & business components
Persistence JPA 3.1 with Hibernate Object-Relational Mapping
Database MySQL 8.0 Relational data storage
Frontend Servlets 6.0 & JSP 3.1 with JSTL Server-side rendering
UI Framework Bootstrap 5, jQuery, DataTables, Chart.js Responsive UI & data visualization
Security jBCrypt Adaptive password hashing
Build Tool Apache Maven 3.9+ Dependency & build management
App Server GlassFish 7 Jakarta EE 10 runtime
Proxy Nginx Reverse proxy & SSL termination
CDN/Security Cloudflare WAF, DDoS protection & caching

πŸš€ Getting Started

Quick local start with Docker

The repository includes a MySQL 8 schema and a GlassFish 7 image configured with the macna_jdbc_v2 JTA datasource expected by persistence.xml.

docker compose up --build -d

After both containers are healthy, open http://localhost:8080/banking-system/. The seeded development administrator is mac / password123A!.

To stop the application, run docker compose down. To also delete the local database and recreate the schema on the next start, run docker compose down -v.

Heroku CI/CD

The GitHub Actions workflow in .github/workflows/ci-cd.yml runs the Java 17 test suite for pull requests. Pushes to main additionally build the linux/amd64 container with reusable BuildKit caching, publish it to Heroku, release it, and smoke-test the login page.

Configure these GitHub Actions secrets before enabling production deployment:

  • HEROKU_API_KEY
  • HEROKU_APP_NAME

The Heroku app requires a JawsDB attachment that exposes JAWSDB_URL. At boot, the container binds GlassFish to Heroku's dynamic PORT, configures the JTA pool from JAWSDB_URL, and applies the idempotent MySQL schema.

Prerequisites

Before you begin, ensure you have the following installed:

  • β˜• Java Development Kit (JDK) 17 or higher
  • πŸ”§ Apache Maven 3.9+
  • πŸ—„οΈ MySQL 8.0+
  • 🐠 GlassFish 7.0 Application Server

Installation & Setup

  1. Clone the Repository

    git clone https://github.com/isharax9/nawwa-banking-system.git
    cd nawwa-banking-system
  2. Configure MySQL Database

    CREATE DATABASE nawwa_banking;
    CREATE USER 'banking_user'@'localhost' IDENTIFIED BY 'your_password';
    GRANT ALL PRIVILEGES ON nawwa_banking.* TO 'banking_user'@'localhost';
    FLUSH PRIVILEGES;
  3. Update Database Configuration

    Configure your database connection in the persistence configuration file.

  4. Build the Project

    mvn clean install
  5. Deploy to GlassFish

    Deploy the generated EAR file from ear/target/ to your GlassFish server.

  6. Access the Application

    Navigate to: http://localhost:8080/nawwa-banking/

πŸ‘€ Default Admin Credentials

For testing administrative features:

  • Username: mac
  • Password: password123A!

⚠️ Important: Change default credentials immediately in production!


πŸ“‹ Module Structure

Core Module (JAR)

The foundational library containing:

  • πŸ—οΈ JPA Entities (User, Customer, Account, Transaction)
  • πŸ“¦ Data Transfer Objects (DTOs)
  • πŸ”„ Mappers for entity-DTO conversion
  • ⚠️ Custom exception hierarchy

Security Module (EJB)

  • πŸ” User authentication and registration
  • πŸ”‘ Password management with BCrypt
  • βœ… Authorization and role management
  • πŸ‘₯ User lifecycle operations

Banking Services (EJB)

  • πŸ‘€ Customer profile management
  • 🏦 Account CRUD operations
  • πŸ“Š Account activation/deactivation
  • πŸ”„ Account type management

Transaction Services (EJB)

  • πŸ’Έ Fund transfers (atomic operations)
  • πŸ’° Payments and deposits
  • πŸ“„ Transaction history
  • πŸ“₯ PDF statement generation

Timer Services (EJB)

Automated background operations:

  • πŸ“ˆ Interest Calculation - Daily interest for savings accounts
  • ⏰ Scheduled Transfers - Execute scheduled fund movements
  • πŸ“Š Daily Reports - Generate system summary reports
  • 🧹 Maintenance Tasks - Weekly data archival and cleanup

Web Module (WAR)

  • 🌐 Servlet-based controllers
  • 🎨 JSP views with JSTL
  • πŸ“± Responsive Bootstrap UI
  • πŸ“Š Interactive dashboards with Chart.js

πŸ”„ Application Workflows

User Registration Flow

%%{init: {'theme': 'dark'}}%%
sequenceDiagram
    actor User
    participant Browser
    participant RegisterServlet
    participant UserManagementService
    participant Database
    
    User->>Browser: Fill registration form
    Browser->>RegisterServlet: POST /register
    RegisterServlet->>RegisterServlet: Validate input
    RegisterServlet->>UserManagementService: register(userData)
    
    UserManagementService->>Database: Check username/email uniqueness
    Database-->>UserManagementService: Validation result
    
    alt Credentials unique
        UserManagementService->>UserManagementService: Hash password (BCrypt)
        UserManagementService->>Database: Create User entity
        UserManagementService->>Database: Create Customer entity
        Database-->>UserManagementService: Success
        UserManagementService-->>RegisterServlet: Registration complete
        RegisterServlet-->>Browser: Redirect to login (success)
    else Credentials exist
        UserManagementService-->>RegisterServlet: Throw exception
        RegisterServlet-->>Browser: Show error message
    end
    
    Browser-->>User: Display result
Loading

Fund Transfer Flow

%%{init: {'theme': 'dark'}}%%
sequenceDiagram
    actor Customer
    participant Browser
    participant TransferServlet
    participant TransactionManager
    participant FundTransferService
    participant ScheduledTransferService
    participant Database
    
    Customer->>Browser: Navigate to Transfer Funds
    Browser->>TransferServlet: GET /transfer
    TransferServlet->>Database: Fetch customer accounts
    Database-->>TransferServlet: Account list
    TransferServlet-->>Browser: Display transfer form
    
    Customer->>Browser: Fill transfer details
    Browser->>TransferServlet: POST /transfer
    TransferServlet->>TransferServlet: Validate input
    
    alt Immediate Transfer
        TransferServlet->>TransactionManager: transferFunds()
        TransactionManager->>FundTransferService: execute transfer
        FundTransferService->>Database: BEGIN TRANSACTION
        FundTransferService->>Database: Debit source account
        FundTransferService->>Database: Credit destination account
        FundTransferService->>Database: Create transaction records
        FundTransferService->>Database: COMMIT
        Database-->>FundTransferService: Success
        FundTransferService-->>TransactionManager: Transfer complete
        TransactionManager-->>TransferServlet: Success
    else Scheduled Transfer
        TransferServlet->>ScheduledTransferService: create scheduled transfer
        ScheduledTransferService->>Database: Save ScheduledTransfer entity
        Database-->>ScheduledTransferService: Success
        ScheduledTransferService-->>TransferServlet: Scheduled
    end
    
    TransferServlet-->>Browser: Redirect to dashboard (success)
    Browser-->>Customer: Show success message
Loading

Automated Interest Calculation Flow

%%{init: {'theme': 'dark'}}%%
sequenceDiagram
    participant TimerService
    participant InterestCalculationService
    participant Database
    participant Account
    
    Note over TimerService: Daily @ 00:00
    TimerService->>InterestCalculationService: Execute scheduled task
    InterestCalculationService->>Database: Fetch all savings accounts
    Database-->>InterestCalculationService: Savings accounts list
    
    loop For each eligible account
        InterestCalculationService->>InterestCalculationService: Calculate interest
        InterestCalculationService->>Database: Update account balance
        InterestCalculationService->>Database: Create interest transaction
    end
    
    InterestCalculationService->>Database: COMMIT all changes
    Database-->>InterestCalculationService: Success
    InterestCalculationService-->>TimerService: Task complete
    Note over TimerService: Log execution results
Loading

🎨 Screenshots

Login Page

Clean and secure authentication interface

Login Page

Customer Dashboard

Comprehensive overview of accounts and recent transactions

Customer Dashboard

Fund Transfer Interface

Support for both immediate and scheduled transfers

Fund Transfer

Transaction History

Detailed transaction logs with color-coded amounts

Transaction History

User Management (Admin)

Administrative interface for user management

User Management

Deposit/Withdrawal Interface

Simple and secure fund operations

Deposit/Withdraw

Customer Management (Admin)

Manage customer profiles and information

Customer Management

Bank Account Management (Admin)

Administrative control over all bank accounts

Account Management

PDF Transaction Reports

Downloadable transaction statements

PDF Report

EJB Timer Services in Action

Server logs showing automated timer execution

Timer Logs


πŸš€ Deployment

Deployment Architecture

The application is deployed in a production-grade environment optimized for security, performance, and scalability.

%%{init: {'theme': 'dark'}}%%
graph TB
    A[User Request] -->|HTTPS| B[Cloudflare CDN]
    B -->|WAF & DDoS Protection| C[Nginx Reverse Proxy]
    C -->|SSL Termination| D[GlassFish 7 Server]
    D --> E[Nawwa Banking EAR]
    E --> F[(MySQL 8.0)]
    F -.->|Hourly Backup<br/>via Crontab| G[Amazon S3]
    
    style B fill:#f9a825
    style C fill:#00bcd4
    style D fill:#4caf50
    style E fill:#2196f3
    style F fill:#ff9800
    style G fill:#9c27b0
Loading

Infrastructure Components

Component Technology Purpose
🌐 Application Server GlassFish 7 on Ubuntu VPS Jakarta EE 10 runtime environment
πŸ”’ Reverse Proxy Nginx SSL/TLS termination, load balancing
πŸ›‘οΈ CDN & Security Cloudflare WAF, DDoS protection, edge caching
πŸ’Ύ Database Backup Crontab + AWS S3 Hourly automated backups
πŸ“Š Monitoring GlassFish Admin Console Server health & performance

Version Control Strategy

%%{init: {'theme': 'dark'}}%%
gitGraph
    commit id: "Initial commit"
    branch testing
    checkout testing
    commit id: "Setup testing environment"
    branch feature/security
    checkout feature/security
    commit id: "Implement authentication"
    commit id: "Add BCrypt hashing"
    checkout testing
    merge feature/security
    branch feature/banking-services
    checkout feature/banking-services
    commit id: "Account management"
    checkout testing
    merge feature/banking-services
    branch feature/timer-services
    checkout feature/timer-services
    commit id: "Interest calculation"
    commit id: "Scheduled transfers"
    checkout testing
    merge feature/timer-services
    checkout main
    merge testing tag: "v1.0"
Loading

Branching Strategy:

  • main - Production-ready releases
  • testing - Integration and QA testing
  • feature/* - Individual feature development

πŸ“š Documentation Portal

Comprehensive documentation available at: doc.bank.nawwa.xyz

Light Mode Documentation Light

Dark Mode Documentation Dark


πŸ“Š Analytics & Monitoring

Google Analytics Integration

The system leverages Google Analytics for comprehensive usage insights:

  • πŸ“ˆ User Engagement - Session duration, bounce rates, page views
  • 🎯 Conversion Tracking - Account creation, transaction completion rates
  • 🌍 Traffic Analysis - User acquisition sources and demographics
  • πŸ“± Device Analytics - Cross-platform usage patterns

Google Analytics

Microsoft Clarity Integration

Qualitative user behavior analysis through:

  • πŸŽ₯ Session Recordings - Anonymized user interaction playback
  • πŸ”₯ Heatmaps - Click, scroll, and attention pattern visualization
  • 😀 Frustration Detection - Rage clicks and abandoned processes
  • 🎯 Dead Click Analysis - Non-interactive element identification

Dashboard Overview Clarity Dashboard

Session Recordings Session Recording

Click Heatmaps Click Heatmap

Scroll Heatmaps Scroll Heatmap

Additional Analytics Views

Analytics Detail


πŸ”’ Security

Multi-Layer Security Architecture

%%{init: {'theme': 'dark'}}%%
graph TD
    A[User Request] --> B{Cloudflare WAF}
    B -->|Threat Detected| C[Block Request]
    B -->|Clean Traffic| D{Nginx SSL/TLS}
    D --> E{Authentication Layer}
    E -->|Invalid| F[Deny Access]
    E -->|Valid| G{Authorization Check}
    G -->|Unauthorized| F
    G -->|Authorized| H[Business Logic]
    H --> I{Transaction Validation}
    I -->|Failed| J[Rollback]
    I -->|Success| K[Commit]
    
    style B fill:#B22222
    style D fill:#000080
    style E fill:#008000
    style G fill:#FFD700
    style H fill:#8A2BE2
    style I fill:#696969
Loading

Security Features

Layer Implementation Description
🌐 Network Cloudflare WAF DDoS protection, malicious traffic filtering
πŸ” Transport Nginx SSL/TLS End-to-end encryption with HTTPS
πŸ”‘ Authentication BCrypt Hashing Adaptive password hashing (2^10 rounds)
βœ… Authorization Programmatic Role-based access control (RBAC)
πŸ’Ό Transaction Container-Managed ACID compliance via EJB CMT
⚠️ Exception Handling Custom Hierarchy Automatic transaction rollback on errors
πŸ” Input Validation Server-side Comprehensive form validation
πŸ“ Audit Logging EJB Interceptors Operation tracking and monitoring

Exception Handling Examples

Inactive Account Transaction Attempt

Exception - Inactive Account

Unauthorized Access Attempt

Exception - Unauthorized User

Exception - Unauthorized Account

Input Validation Examples

Registration Validation Flow

Validation 1

Validation 2

Validation 3

GlassFish Module Management

Server Module Deployment

GlassFish Modules


πŸ”§ Development Workflow

Feature Development Process

Example: Adding PDF Report Feature

Step 1: Create Pull Request Create PR

Step 2: Merge to Main Merge PR

Final Repository State

GitHub Repository


πŸ† Key Achievements

βœ… Robust & Reliable - Container-managed transactions and persistent EJB timers
βœ… Enterprise Security - Multi-layer security with BCrypt and programmatic authorization
βœ… Process Automation - Scheduled tasks reduce manual intervention by 80%
βœ… High Availability - Hourly database backups with S3 redundancy
βœ… Scalable Architecture - Multi-module design enables independent scaling
βœ… Data-Driven Insights - Integrated analytics for continuous improvement


πŸ“„ License

This project is licensed under the MIT License.

Copyright (c) 2025 Ishara Lakshitha

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.

πŸ“ž Support & Community

πŸ’¬ Get Help & Connect

Platform Link Purpose
πŸ“§ Email isharax9@gmail.com Direct support & inquiries
πŸ’¬ Telegram @mac_knight141 Quick questions & community
πŸ’Ό LinkedIn isharax9 Professional networking
πŸ“Έ Instagram @mac_knight141 Updates & behind-the-scenes
🐦 Twitter @isharax9 Announcements & tech discussions

πŸ› Issues & Contributions

Type Link Description
πŸ› Bug Reports GitHub Issues Report bugs and request features
πŸ’¬ Discussions GitHub Discussions Community Q&A and ideas
πŸ“– Documentation Project Docs Complete guides and references

🌟 Show Your Support

⭐ Star this repository if it helped you!

GitHub stars GitHub forks GitHub watchers GitHub issues


πŸš€ Ready to Transform Banking Management?

Made with ❀️ by Ishara Lakshitha β€’ Β© 2025

Empowering Banking Through Technology

About

Enterprise-grade core banking platform built with Jakarta EE 10, EJB, and modern web technologies. Features secure authentication, customer/account management, transactional integrity, automated timer services, multi-layer security, analytics integration, and responsive UI. Supports real-time fund transfers, PDF reports, and admin panel. Try Now πŸ‘‡

Topics

Resources

Stars

Watchers

Forks

Releases

Packages

Contributors

Languages