How mrfrazer25/enhanced-hibp-checker works
Project Type and Purpose
• Enhanced HIBP Checker is a Python-based desktop application (not a web app or microservice).
• It bundles a user interface (PyQt6 + embedded HTML/JS) with a core logic module that (a) checks “Have I Been Pwned” via HTTP, (b) stores the HIBP API key securely in the OS keyring, and (c) forwards prompts/data to a local Ollama AI instance for cybersecurity advice.
File‐Structure Analysis
• Top-level files:
– main.py (application entry point)
– requirements.txt (dependencies)
– core/ (business logic)
• hibp_client.py (HTTP client for the HIBP API)
• secure_storage.py (wraps OS keyring for API key)
• __init__.py
– ui/ (presentation layer)
• main_window.py (PyQt6 window, tab management)
• styles.py (GUI styling)
• html/ (embedded web chat view)
– chat_template.html
– chat_logic.js
• __init__.py
README Insights
• Describes three main user flows: (1) settings (store/retrieve API key + Ollama endpoint & model), (2) HIBP breach checks, (3) AI-powered advisor via local Ollama.
• Emphasizes local processing, secure key storage, and no external data collection beyond HIBP and local Ollama.
a. Main Components (highest level):
1. User (actor)
2. Desktop Application Container
– UI Module (PyQt6 + embedded HTML/JS)
– Core Module (HIBP client + secure key storage + Ollama client)
3. External Services
– Have I Been Pwned REST API
– Local Ollama HTTP API (running on localhost)
– OS Keyring (Windows Credential Manager / macOS Keychain / Linux Secret Service)
b. Relationships & Data Flow:
• UI ←→ Core: method calls in Python
• Core → OS Keyring: store/retrieve HIBP API key
• Core → HIBP API: HTTP GET/POST for breach checks
• Core → Local Ollama: HTTP POST to /api/generate with user queries or breach details
c. Architectural Patterns:
• Separation of concerns (UI vs. business logic) akin to MVC
• Client‐side HTTP clients for third‐party services
• Local first / offline AI invocation
d. Key Technologies:
• Python 3.7+ with PyQt6 (UI)
• Requests (HTTP)
• Keyring (secure storage)
• Ollama local API (AI)
• Embedded HTML + JS for chat view