Skip to content

Full-stack learning app: Oracle JET + KnockoutJS frontend (MVVM) with a Spring Boot backend. Implements a secure, validated multi-step wizard for account verification and password reset, with REST APIs and clean modular architecture.

AsgharAZ/OracleJet_KnockOutJS_LearningProject

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

24 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

Banking Password Reset System

A full-stack banking application built with Oracle JET and Spring Boot that provides a secure password reset/change functionality for banking customers. The system implements a multi-step wizard that allows users to verify their identity through CNIC and account details before updating their login credentials.

πŸš€ Features

Core Functionality

  • Multi-step Password Reset Wizard - Guided 4-step process for secure password changes
  • Real-time Validation - Instant feedback on CNIC, account numbers, and IBAN validation
  • Account Type Support - Individual, Sole Proprietor, and Foreign National account types
  • Dual Verification Methods - Support for both Account Number and IBAN verification
  • Password Strength Evaluation - Real-time password strength assessment and feedback
  • Secure Password Hashing - SHA-256 hashing using Web Crypto API

Security Features

  • Input validation and sanitization
  • Database constraints and unique validations
  • Secure API endpoints with proper error handling
  • Password strength requirements and validation

πŸ—οΈ Architecture

Frontend (Oracle JET + KnockoutJS)

  • Framework: Oracle JavaScript Extension Toolkit (JET) v19.0.0
  • MVVM Pattern: Knockout.js for data binding and reactive UI
  • Module Loading: Require.js for dependency management
  • Responsive Design: Mobile-first approach with Oracle JET components

Backend (Spring Boot)

  • Framework: Spring Boot 3.5.6 with Java 17
  • Data Access: Spring Data JPA with Hibernate
  • Database: PostgreSQL with proper indexing and constraints
  • API Design: RESTful APIs with comprehensive validation

Database Design

  • Customer Entity: CNIC as primary key with validation constraints
  • Account Entity: Composite unique constraints (customer + account_type)
  • Relationships: Proper JPA relationships with foreign key mappings
  • Stored Procedures: Complex operations handled by PostgreSQL procedures

πŸ“ Project Structure

OracleJet_KnockOutJS_LearningProject/
β”œβ”€β”€ mvvmJS/                          # Frontend Application
β”‚   β”œβ”€β”€ src/
β”‚   β”‚   β”œβ”€β”€ js/
β”‚   β”‚   β”‚   β”œβ”€β”€ viewModels/          # Knockout ViewModels
β”‚   β”‚   β”‚   β”‚   β”œβ”€β”€ Account_Type.js      # Account type selection
β”‚   β”‚   β”‚   β”‚   β”œβ”€β”€ Account_Details.js   # Account verification
β”‚   β”‚   β”‚   β”‚   β”œβ”€β”€ login_details_2.js   # Password reset
β”‚   β”‚   β”‚   β”‚   └── successful_registration.js # Success page
β”‚   β”‚   β”‚   β”œβ”€β”€ views/               # HTML Templates
β”‚   β”‚   β”‚   β”‚   β”œβ”€β”€ Account_Type.html
β”‚   β”‚   β”‚   β”‚   β”œβ”€β”€ Account_Details.html
β”‚   β”‚   β”‚   β”‚   └── successful_registration.html
β”‚   β”‚   β”‚   β”œβ”€β”€ appController.js     # Main application controller
β”‚   β”‚   β”‚   β”œβ”€β”€ main.js             # Application bootstrap
β”‚   β”‚   β”‚   └── root.js             # Router configuration
β”‚   β”‚   β”œβ”€β”€ css/                    # Stylesheets and images
β”‚   β”‚   └── index.html              # Main HTML file
β”‚   β”œβ”€β”€ package.json                # Frontend dependencies
β”‚   └── oraclejetconfig.json       # Oracle JET configuration
β”‚
β”œβ”€β”€ springOne/                      # Backend Application
β”‚   β”œβ”€β”€ src/main/java/com/example/springOne/
β”‚   β”‚   β”œβ”€β”€ controller/             # REST Controllers
β”‚   β”‚   β”‚   β”œβ”€β”€ AccountController.java    # Account management
β”‚   β”‚   β”‚   └── CustomerController.java   # Customer management
β”‚   β”‚   β”œβ”€β”€ entity/                 # JPA Entities
β”‚   β”‚   β”‚   β”œβ”€β”€ Account.java             # Account entity
β”‚   β”‚   β”‚   └── Customer.java            # Customer entity
β”‚   β”‚   β”œβ”€β”€ repository/             # Data repositories
β”‚   β”‚   β”‚   β”œβ”€β”€ AccountRepository.java
β”‚   β”‚   β”‚   └── CustomerRepository.java
β”‚   β”‚   β”œβ”€β”€ service/                # Business logic services
β”‚   β”‚   β”œβ”€β”€ dto/                    # Data Transfer Objects
β”‚   β”‚   └── config/                 # Configuration classes
β”‚   β”œβ”€β”€ src/main/resources/
β”‚   β”‚   β”œβ”€β”€ application.properties  # Application configuration
β”‚   β”‚   └── sp_create_account.sql   # Database procedures
β”‚   └── pom.xml                     # Maven dependencies
β”‚
└── notes/                         # Documentation and notes
    └── SpringBoot/                # Spring Boot reference materials

πŸ› οΈ Technology Stack

Frontend Technologies

  • Oracle JET 19.0.0 - Enterprise JavaScript framework
  • Knockout.js - MVVM data binding library
  • Require.js - JavaScript module loader
  • HTML5/CSS3 - Modern web standards
  • Responsive Design - Mobile-first approach

Backend Technologies

  • Spring Boot 3.5.6 - Java web framework
  • Spring Data JPA - Data access abstraction
  • Hibernate - ORM framework
  • Jakarta Validation - Bean validation
  • Maven - Dependency management

Database & Tools

  • PostgreSQL - Relational database
  • Git - Version control
  • Node.js - JavaScript runtime

πŸš€ Getting Started

Prerequisites

  • Java 17 or higher
  • Node.js 16 or higher
  • PostgreSQL database
  • Maven for backend build
  • Git for version control

Backend Setup

  1. Clone the repository

    git clone <repository-url>
    cd OracleJet_KnockOutJS_LearningProject
  2. Configure Database

    • Create a PostgreSQL database
    • Update springOne/src/main/resources/application.properties:
    spring.datasource.url=jdbc:postgresql://localhost:3306/your_database
    spring.datasource.username=your_username
    spring.datasource.password=your_password
    spring.jpa.hibernate.ddl-auto=update
  3. Build and Run Backend

    cd springOne
    ./mvnw spring-boot:run
    • Backend will be available at http://localhost:8080

Frontend Setup

  1. Install Dependencies

    cd mvvmJS
    npm install
  2. Build and Serve

    ojet build
    ojet serve
    • Frontend will be available at http://localhost:8000

πŸ“– API Documentation

Customer Endpoints (/api/v1/customers/)

Method Endpoint Description
GET / Get all customers
POST / Create new customer
DELETE /{customerId} Delete customer
PUT /{customerId}/password Update customer password
GET /validate/{cnic} Validate CNIC number

Account Endpoints (/api/v1/accounts/)

Method Endpoint Description
GET / Get all accounts
GET /customer/{customerId} Get accounts by customer
POST / Create new account
DELETE /{accountNumber} Delete account by account number
PUT / Update account
GET /validate/{accountNumber}/{cnic} Validate account number with CNIC
GET /validate/iban/{iban}/{cnic} Validate IBAN with CNIC
GET /summary/{cnic} Get account summary by CNIC
GET /username/by-account/{cnic}/{accountNumber} Get username by CNIC and account number
GET /username/by-iban/{iban}/{cnic} Get username by IBAN and CNIC

Request/Response Examples

Validate CNIC

GET /api/v1/customers/validate/1234567890123

Response:

{
  "statusCode": "SUCCESS",
  "message": "CNIC verified successfully",
  "isValid": true
}

Update Password

PUT /api/v1/customers/1234567890123/password
Content-Type: application/json

{
  "password": "hashed_password_here"
}

πŸ’‘ Usage Guide

Password Reset Flow

  1. Account Type Selection

    • Choose from Individual, Sole Proprietor, or Foreign National
    • Enter CNIC number (for Individual accounts)
    • Real-time validation with database verification
  2. Account Details Verification

    • Enter Account Number (14 digits) or IBAN
    • Tab-based interface for easy switching
    • Real-time validation against database
  3. Verification Step

    • CNIC and account linking validation
    • Cross-verification of provided details
  4. Password Update

    • Password strength evaluation
    • Real-time matching validation
    • Secure hashing before database storage
  5. Success Confirmation

    • Display updated account information
    • Confirmation of successful password change

Password Requirements

  • Minimum 8 characters
  • At least "Fair" strength rating
  • Combination of uppercase, lowercase, numbers, and special characters recommended

πŸ”§ Development

Code Organization

Frontend Structure:

  • viewModels/ - Business logic and data management
  • views/ - HTML templates and UI components
  • appController.js - Main application coordination
  • Modular design for easy maintenance

Backend Structure:

  • controller/ - REST API endpoints
  • entity/ - JPA entities and database models
  • repository/ - Data access layer
  • service/ - Business logic layer
  • dto/ - Data transfer objects

Key Components

Frontend ViewModels

  • Account_Type.js - Account type selection and CNIC validation
  • Account_Details.js - Account number/IBAN verification
  • login_details_2.js - Password reset with strength validation
  • successful_registration.js - Success page management

Backend Controllers

  • CustomerController - Customer management and validation
  • AccountController - Account operations and verification

πŸ—„οΈ Database Schema

Customer Table

CREATE TABLE customer (
    id BIGINT PRIMARY KEY,           -- CNIC as primary key
    name VARCHAR(255) NOT NULL,
    username VARCHAR(255) UNIQUE NOT NULL,
    password VARCHAR(255) NOT NULL,
    phone_number VARCHAR(13) NOT NULL
);

Account Table

CREATE TABLE accounts (
    account_number BIGINT PRIMARY KEY,
    user_id BIGINT NOT NULL,         -- Foreign key to customer.id
    account_type INTEGER NOT NULL,
    iban VARCHAR(34) UNIQUE NOT NULL,
    digitally_active BOOLEAN NOT NULL,
    FOREIGN KEY (user_id) REFERENCES customer(id)
);

🀝 Contributing

  1. Fork the repository
  2. Create a feature branch (git checkout -b feature/amazing-feature)
  3. Commit your changes (git commit -m 'Add amazing feature')
  4. Push to the branch (git push origin feature/amazing-feature)
  5. Open a Pull Request

Development Guidelines

  • Follow existing code style and patterns
  • Add proper validation for new features
  • Update documentation for API changes
  • Test thoroughly before submitting PR

πŸ“ Notes

  • This application demonstrates integration between Oracle JET frontend and Spring Boot backend
  • Implements modern web development practices with reactive UI patterns
  • Suitable for banking and financial services requiring secure customer verification
  • Can be extended for additional account management features

🎯 Presentation

View the project presentation here: Canva Presentation

πŸ“Š Database Utilities

The StoredProcedure_View_MaterializedView_SummaryCode.txt file contains comprehensive database scripts and examples including:

  • Stored procedures for customer and account creation
  • Materialized view creation for customer-account relationships
  • Sample data insertion scripts for testing
  • Database management commands and utilities
  • API endpoint examples for account summaries

πŸ“„ License

This project is licensed under the Oracle Universal Permissive License (UPL) - see the LICENSE file for details.

πŸ†˜ Support

For support and questions:

  • Create an issue in the repository
  • Contact the development team
  • Check the documentation in the notes/ directory

Built with ❀️ using Oracle JET and Spring Boot

About

Full-stack learning app: Oracle JET + KnockoutJS frontend (MVVM) with a Spring Boot backend. Implements a secure, validated multi-step wizard for account verification and password reset, with REST APIs and clean modular architecture.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published