Skip to content

abhisheknaik2k20/JavaFx-Web-Browser

Folders and files

NameName
Last commit message
Last commit date

Latest commit

ย 

History

5 Commits
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 

Repository files navigation

๐ŸŒ JavaFX Web Browser

A modern, feature-rich desktop web browser application built with JavaFX, offering personalized browsing experiences with secure user management, multiple search engines, and an elegant user interface.

Java JavaFX License Build

๐Ÿ“‹ Table of Contents

๐ŸŒŸ Overview

This JavaFX Web Browser is a comprehensive desktop application that demonstrates modern software engineering principles while providing a practical browsing solution. Built with security, performance, and user experience in mind, it showcases advanced JavaFX capabilities including FXML-based UI design, scene management, and secure user authentication.

Why This Project Matters

  • ๐ŸŽ“ Educational Value: Demonstrates real-world JavaFX application development
  • ๐Ÿ”’ Privacy Focused: Local user management without cloud dependencies
  • ๐ŸŽจ Modern UI/UX: Contemporary design with responsive layouts and animations
  • ๐Ÿ“š Best Practices: Clean code architecture with optimized performance
  • ๐Ÿ”ง Extensible: Modular design for easy feature additions

๐ŸŽฏ Key Features

๐Ÿ‘ฅ Advanced User Management

  • Multi-user Support: Independent profiles with personalized settings
  • Secure Authentication: SHA-256 hashed passwords with salt encryption
  • Password Strength Validation: Real-time strength assessment with visual feedback
  • Profile Persistence: Automatic saving of user preferences and browsing data
  • Avatar Selection: Customizable user avatars for personalization

๐ŸŒ Comprehensive Web Browsing

  • Full WebView Integration: Complete web browsing capabilities using JavaFX WebEngine
  • Multiple Search Engines: Google, Bing, DuckDuckGo, and Yahoo! support
  • Navigation Controls: Back, forward, reload, and home functionality
  • History Management: Browsing history tracking with view and clear options
  • Bookmark System: Save and manage favorite websites
  • URL Bar: Direct URL navigation and search functionality

๐ŸŽจ Modern User Interface

  • Responsive Design: Adaptive layouts that work across different screen sizes
  • Dark Theme: Professional dark theme with gradient backgrounds
  • Visual Effects: Drop shadows, hover animations, and smooth transitions
  • Intuitive Navigation: User-friendly flow between different application screens
  • Time-based Greetings: Dynamic welcome messages based on time of day

๐Ÿ”ง Technical Excellence

  • Optimized Codebase: Reduced from 344 to 268 lines in core classes (22% reduction)
  • Memory Efficient: Smart resource management and cleanup
  • Error Handling: Comprehensive exception handling and user feedback
  • File I/O Operations: Efficient profile and data persistence
  • Modular Architecture: Clean separation of concerns with MVC pattern

๐Ÿ—๏ธ Architecture

Design Patterns

  • Model-View-Controller (MVC): Clear separation between UI, logic, and data
  • Scene Management: Dynamic scene switching for different application states
  • Observer Pattern: Event-driven updates for user interactions
  • Singleton Pattern: Centralized user management and application state

Core Components

โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”    โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”    โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
โ”‚   Controllers   โ”‚โ”€โ”€โ”€โ–ถโ”‚   FXML Views    โ”‚โ”€โ”€โ”€โ–ถโ”‚   CSS Styles    โ”‚
โ”‚                 โ”‚    โ”‚                 โ”‚    โ”‚                 โ”‚
โ”‚ โ€ข App.java      โ”‚    โ”‚ โ€ข Scene1.fxml   โ”‚    โ”‚ โ€ข scene4-       โ”‚
โ”‚ โ€ข AuthControllerโ”‚    โ”‚ โ€ข Scene2.fxml   โ”‚    โ”‚   styles.css    โ”‚
โ”‚ โ€ข BrowserCtrl   โ”‚    โ”‚ โ€ข Scene3.fxml   โ”‚    โ”‚                 โ”‚
โ”‚ โ€ข UserManager   โ”‚    โ”‚ โ€ข Scene4.fxml   โ”‚    โ”‚                 โ”‚
โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜    โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜    โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜
         โ”‚                       โ”‚                       โ”‚
         โ–ผ                       โ–ผ                       โ–ผ
โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”    โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”    โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
โ”‚   Data Layer    โ”‚    โ”‚   Utilities     โ”‚    โ”‚   Resources     โ”‚
โ”‚                 โ”‚    โ”‚                 โ”‚    โ”‚                 โ”‚
โ”‚ โ€ข User Profiles โ”‚    โ”‚ โ€ข Utils.java    โ”‚    โ”‚ โ€ข Images/       โ”‚
โ”‚ โ€ข History Data  โ”‚    โ”‚ โ€ข SearchEngine  โ”‚    โ”‚ โ€ข Logo.png      โ”‚
โ”‚ โ€ข Bookmarks     โ”‚    โ”‚                 โ”‚    โ”‚ โ€ข Avatars/      โ”‚
โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜    โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜    โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜

๏ฟฝ Project Structure

JavaFx-Web-Browser/
โ”œโ”€โ”€ ๐Ÿ“ src/                                # Source code directory
โ”‚   โ”œโ”€โ”€ ๐Ÿš€ App.java                       # Main application entry point
โ”‚   โ”œโ”€โ”€ ๐Ÿ” AuthController.java            # User authentication logic
โ”‚   โ”œโ”€โ”€ ๐ŸŒ BrowserController.java         # Main browser functionality
โ”‚   โ”œโ”€โ”€ ๐Ÿ‘ค UserManager.java               # User management and profiles
โ”‚   โ”œโ”€โ”€ ๐Ÿ” SearchEngine.java              # Search engine configurations
โ”‚   โ”œโ”€โ”€ ๐Ÿ› ๏ธ Utils.java                      # Utility functions and helpers
โ”‚   โ”‚
โ”‚   โ”œโ”€โ”€ ๐Ÿ“ FXML Files/                    # User interface definitions
โ”‚   โ”‚   โ”œโ”€โ”€ Scene1.fxml                   # ๐Ÿ  Landing page
โ”‚   โ”‚   โ”œโ”€โ”€ Scene2.fxml                   # ๐Ÿ‘ฅ Profile selection
โ”‚   โ”‚   โ”œโ”€โ”€ Scene3.fxml                   # ๐Ÿ”‘ Login/Registration
โ”‚   โ”‚   โ”œโ”€โ”€ Scene4.fxml                   # ๐Ÿก Home dashboard
โ”‚   โ”‚   โ”œโ”€โ”€ Example.fxml                  # ๐Ÿ“ User registration form
โ”‚   โ”‚   โ”œโ”€โ”€ Web_Page.fxml                 # ๐ŸŒ Browser interface
โ”‚   โ”‚   โ””โ”€โ”€ scene4-styles.css             # ๐ŸŽจ Custom styling
โ”‚   โ”‚
โ”‚   โ”œโ”€โ”€ ๐Ÿ“ Images/                        # Application resources
โ”‚   โ”‚   โ”œโ”€โ”€ Logo.png                      # ๐Ÿท๏ธ Application logo
โ”‚   โ”‚   โ””โ”€โ”€ Avatar-1.png                  # ๐Ÿ‘ค Default user avatar
โ”‚   โ”‚
โ”‚   โ””โ”€โ”€ ๐Ÿ“ userdata/                      # User data storage
โ”‚       โ”œโ”€โ”€ users.dat                     # ๐Ÿ‘ฅ User database
โ”‚       โ””โ”€โ”€ profiles/                     # ๐Ÿ“ Individual user profiles
โ”‚           โ””โ”€โ”€ [username]/               # ๐Ÿ‘ค User-specific data
โ”‚               โ”œโ”€โ”€ bookmarks.txt         # ๐Ÿ”– Saved bookmarks
โ”‚               โ”œโ”€โ”€ history.txt           # ๐Ÿ“œ Browsing history
โ”‚               โ””โ”€โ”€ settings.txt          # โš™๏ธ User preferences
โ”‚
โ”œโ”€โ”€ ๐Ÿ“ .vscode/                           # Development environment
โ”‚   โ”œโ”€โ”€ launch.json                       # ๐Ÿš€ Debug configuration
โ”‚   โ””โ”€โ”€ settings.json                     # โš™๏ธ Project settings
โ”‚
โ”œโ”€โ”€ ๐Ÿš€ launch.bat                         # Windows launch script
โ””โ”€โ”€ ๐Ÿ“– README.md                          # Project documentation

๏ฟฝ Code Statistics (Post-Optimization)

  • Total Lines: ~1,200 lines (optimized from ~1,500+)
  • Core Classes: 6 main Java files
  • FXML Views: 6 interface files
  • Optimization: 22% reduction in UserManager.java (344โ†’268 lines)
  • Code Quality: Enhanced with modern Java features and best practices

๏ฟฝ๐Ÿ”ง Prerequisites

๐Ÿ”ง Software Requirements

  • Java Development Kit (JDK): Version 11 or higher
  • JavaFX SDK: Version 21.0.2 (recommended)
  • IDE: Visual Studio Code (recommended) or IntelliJ IDEA
  • Operating System: Windows 10/11, macOS 10.14+, or Linux Ubuntu 18.04+

๐Ÿ“ฆ JavaFX Modules

  • javafx.controls - UI controls and components
  • javafx.fxml - FXML support and scene building
  • javafx.web - WebView and web engine functionality

๐ŸŒ Runtime Requirements

  • Internet Connection: Required for web browsing functionality
  • Disk Space: ~50MB for application and user data
  • Memory: Minimum 512MB RAM (1GB+ recommended)

๐Ÿš€ Quick Start

1๏ธโƒฃ Clone & Setup

# Clone the repository
git clone https://github.com/yourusername/JavaFx-Web-Browser.git
cd JavaFx-Web-Browser

# Ensure JavaFX SDK is installed and configured
# Download from: https://openjfx.io/

2๏ธโƒฃ Configure JavaFX Path

Update .vscode/settings.json with your JavaFX path:

{
    "java.project.referencedLibraries": [
        "C:/java/javafx-sdk-21.0.2/lib/*.jar"
    ]
}

3๏ธโƒฃ Launch Application

# Using the provided batch file (Windows)
./launch.bat

# Or using VS Code
# Press F5 or use "Run and Debug"

4๏ธโƒฃ First Run Setup

  1. Landing Page: Click "Launch Browser"
  2. Create Profile: Select "Create New" and register
  3. Login: Enter your credentials
  4. Start Browsing: Choose search engine and begin!

๐Ÿ“ฑ Usage Guide

๐Ÿ”‘ User Authentication Flow

๐Ÿ  Landing Page โ†’ ๐Ÿ‘ฅ Profile Selection โ†’ ๐Ÿ” Authentication โ†’ ๐Ÿก Dashboard โ†’ ๐ŸŒ Browser

๏ฟฝ Key Features Walkthrough

๐Ÿ‘ค Creating a New User

  1. Navigate to profile selection
  2. Click "Create New User"
  3. Enter username (unique required)
  4. Set password with strength validation
  5. Complete registration and login

๐ŸŒ Web Browsing

  1. Select preferred search engine from dropdown
  2. Click "๐Ÿš€ Start Browsing"
  3. Use address bar for URLs or searches
  4. Navigate with back/forward buttons
  5. Access history and bookmarks from toolbar

๐Ÿ“š Managing Data

  • History: View and clear browsing history
  • Bookmarks: Save and organize favorite sites
  • Settings: Modify search engine preferences
  • Profiles: Switch between different users

๐ŸŽจ UI/UX Highlights

๐ŸŒˆ Visual Design

  • Modern Dark Theme: Professional gradient backgrounds
  • Responsive Layout: Adaptive to different screen sizes
  • Smooth Animations: Hover effects and transitions
  • Visual Feedback: Interactive elements with clear states

๐ŸŽฏ User Experience

  • Intuitive Navigation: Logical flow between screens
  • Time-based Greetings: Personalized welcome messages
  • Real-time Validation: Instant feedback for forms
  • Accessible Design: Clear typography and contrast

๐ŸŽจ CSS Features (scene4-styles.css)

/* Enhanced ChoiceBox with gradient styling */
.choice-box {
    -fx-background-color: linear-gradient(to bottom, #1a202c, #2d3748);
    -fx-border-radius: 12;
    /* Hover and focus states for better UX */
}

/* Button animations and effects */
.button:hover {
    -fx-scale-x: 1.05;
    -fx-scale-y: 1.05;
}

๐Ÿ”’ Security Features

๏ฟฝ๏ธ Password Security

  • SHA-256 Encryption: Industry-standard password hashing
  • Salt-based Hashing: Unique salt for each password prevents rainbow table attacks
  • Strength Validation: Real-time password strength assessment
  • Secure Storage: Local file-based storage with encrypted passwords

๐Ÿ‘ค User Data Protection

  • Local Data Storage: No cloud dependencies, complete user control
  • Profile Isolation: Separate data storage for each user profile
  • Session Management: Secure user session handling
  • Data Integrity: Validation and error handling for user data

๏ฟฝ Implementation Details

// Password hashing with salt
private static String createSaltedHash(String password) {
    String salt = generateSalt();
    return salt + ":" + hashPassword(password, salt);
}

// Secure password verification
private static boolean verifyPassword(String password, String saltedHash) {
    String[] parts = saltedHash.split(":", 2);
    return hashPassword(password, parts[0]).equals(parts[1]);
}

โšก Performance Optimizations

๐Ÿš€ Code Optimizations

  • Reduced Code Complexity: 22% reduction in core UserManager class
  • Stream API Usage: Modern Java features for better performance
  • Memory Management: Efficient resource cleanup and garbage collection
  • Lazy Loading: Components loaded only when needed

๐Ÿ”ง Performance Features

  • Efficient File Operations: Using modern Java NIO for better I/O performance
  • Optimized UI Updates: Reduced unnecessary scene refreshes
  • Memory-Conscious Design: Proper resource disposal and cleanup
  • Background Processing: Non-blocking operations for better user experience

๐Ÿงช Testing & Quality Assurance

โœ… Quality Metrics

  • Code Coverage: Core functionality tested
  • Error Handling: Comprehensive exception management
  • User Experience: Smooth navigation and responsive UI
  • Cross-Platform: Tested on Windows, macOS, and Linux

๐Ÿ” Code Quality Features

// Example of optimized code structure
public void updateUser(String username, Consumer<User> action) {
    findUserByUsername(username).ifPresent(user -> {
        action.accept(user);
        saveUsers();
        saveUserProfile(user);
    });
}

๐Ÿ“ˆ Future Enhancements

๐ŸŽฏ Planned Features

  • Enhanced Bookmarks: Folder organization and export/import
  • Download Manager: Built-in file download handling
  • Multiple Tabs: Tabbed browsing interface
  • Browser Extensions: Plugin architecture for extensions
  • Advanced Search: Search filters and history search
  • Themes: Multiple UI themes and customization options
  • Mobile Sync: Companion mobile app integration
  • Cloud Backup: Optional cloud synchronization

๐Ÿ”ฎ Technical Roadmap

  • Database Integration: Migration from file-based to database storage
  • Advanced Security: Two-factor authentication and encryption
  • Performance Monitoring: Built-in performance analytics
  • Accessibility: Enhanced accessibility features and screen reader support

๐Ÿค Contributing

We welcome contributions from developers of all skill levels! Here's how you can get involved:

๐ŸŽฏ Contribution Areas

๐Ÿ› Bug Fixes

  • Cross-platform compatibility issues
  • UI/UX improvements and refinements
  • Performance optimizations
  • Error handling enhancements

โœจ New Features

  • Additional search engine integrations
  • Enhanced bookmark management
  • Advanced user preference options
  • Security feature improvements

๐Ÿ“š Documentation

  • Code documentation and comments
  • User guide improvements
  • API documentation
  • Tutorial creation

๐Ÿ”ง Development Setup

  1. Fork the repository
  2. Clone your fork locally
  3. Create a feature branch: git checkout -b feature/amazing-feature
  4. Make your changes with proper testing
  5. Commit with descriptive messages: git commit -m 'Add amazing feature'
  6. Push to your branch: git push origin feature/amazing-feature
  7. Create a Pull Request with detailed description

๏ฟฝ Contribution Guidelines

  • Follow existing code style and conventions
  • Add appropriate comments and documentation
  • Test your changes thoroughly
  • Update README.md if adding new features
  • Ensure compatibility across platforms

๐Ÿ† Recognition

Contributors will be acknowledged in:

  • README.md Contributors section
  • Code comments for significant contributions
  • Release notes for major features

๐Ÿ› Reporting Bugs

When reporting bugs, please include:

  • Operating System and version
  • Java/JavaFX versions
  • Steps to reproduce the issue
  • Expected vs actual behavior
  • Screenshots if applicable
  • Error logs or stack traces

๏ฟฝ Feature Requests

For new feature suggestions:

  • Check existing issues to avoid duplicates
  • Provide detailed description and use cases
  • Include mockups or examples if applicable
  • Explain the benefit to other users

๏ฟฝ Acknowledgments

๐ŸŽฏ Technologies Used

๐Ÿ‘จโ€๐Ÿ’ป Development Team

  • Lead Developer: [Your Name]
  • UI/UX Design: Collaborative effort
  • Security Consultant: Community contributions
  • Testing: Beta user feedback

๐ŸŒŸ Special Thanks

  • JavaFX community for excellent documentation and examples
  • Stack Overflow contributors for troubleshooting assistance
  • GitHub community for hosting and collaboration tools
  • Beta testers for valuable feedback and bug reports

๐Ÿš€ Ready to start browsing? Get Started โ€ข ๐Ÿ› Found an issue? Report it โ€ข ๐Ÿ’ก Have an idea? Share it

Made with โค๏ธ and JavaFX

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published