# akarshjha03/proximitylocksystem architecture

> Architecture diagram of the GitHub repository akarshjha03/proximitylocksystem, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2025-11-27). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/akarshjha03/proximitylocksystem
- Repository: https://github.com/akarshjha03/proximitylocksystem

## Overview

##### Project type and purpose
- This is a Python-based CLI application (packaged via setup.py) whose job is to monitor your phone’s Bluetooth presence and lock the desktop when the phone moves out of range.

##### File structure
- Top-level:
- proximity_lock_system/ – the main Python package
- build/, dist/, *.egg-info – build/artifact outputs created by packaging
- requirements.txt, setup.py – dependency and install metadata
- Inside proximity_lock_system/:
- cli.py – CLI entry point (defines the “proximity-lock” console script)
- config.py – poll intervals, thresholds, pause durations
- core.py – service logic (scanning loop, threshold logic, invoking lock)
- utils.py – platform-agnostic helper functions (Bluetooth scanning, executing lock commands)

##### README for additional insights
- Dependencies: Python ≥3.8, pybluez, OS-specific lock commands
- Runtime behavior:
- “proximity-lock setup” prepares config (optional)
- “proximity-lock start” launches a loop: scan → compare misses → lock if threshold exceeded
- Platform integration points: Windows, macOS, Linux lock utilities

## Diagram (Mermaid)

```mermaid
flowchart TD
    %% Internal Python Modules
    subgraph "Internal Python Modules"
        CLI["cli.py: CLI Entry Point"]:::internal
        Config["config.py: Configuration Loader"]:::config
        Core["core.py: Monitor Service"]:::internal
        Scanner["utils.py: Bluetooth Scanner"]:::internal
        LockExec["utils.py: Lock Executor"]:::internal
        Packaging["setup.py: Packaging & Console Script"]:::internal
    end

    %% External Systems
    BluetoothAdapter["Bluetooth Adapter"]:::external
    OSLock["OS Lock Utilities"]:::external

    %% Connections
    Packaging -->|defines entrypoint| CLI
    CLI -->|loads configuration| Config
    CLI -->|instantiates monitor service| Core
    Core -->|calls scanner| Scanner
    Scanner -->|scans via pybluez| BluetoothAdapter
    Core -->|applies threshold logic| Core
    Core -->|triggers lock executor| LockExec
    LockExec -->|invokes OS command| OSLock

    %% Click Events
    click CLI "https://github.com/akarshjha03/proximitylocksystem/blob/main/proximity_lock_system/cli.py"
    click Config "https://github.com/akarshjha03/proximitylocksystem/blob/main/proximity_lock_system/config.py"
    click Core "https://github.com/akarshjha03/proximitylocksystem/blob/main/proximity_lock_system/core.py"
    click Scanner "https://github.com/akarshjha03/proximitylocksystem/blob/main/proximity_lock_system/utils.py"
    click LockExec "https://github.com/akarshjha03/proximitylocksystem/blob/main/proximity_lock_system/utils.py"
    click Packaging "https://github.com/akarshjha03/proximitylocksystem/blob/main/setup.py"

    %% Styles
    classDef internal fill:#AED6F1,stroke:#2E86C1,stroke-width:1px;
    classDef external fill:#A9DFBF,stroke:#27AE60,stroke-width:1px;
    classDef config fill:#F9E79F,stroke:#D68910,stroke-width:1px;
```
