Repository navigation
Architecture & Development
BHAM is built with a focus on speed, low resource consumption, and ease of deployment. The architecture strictly separates the asynchronous scanning engine from the user interface, communicating entirely via REST APIs and real-time WebSockets.
- Backend: Python
- Framework: FastAPI (ASGI) for high-performance HTTP endpoints and WebSocket management.
-
Concurrency:
asynciois used extensively in the scanning modules to prevent blocking operations during strict network and serial timeouts. - Frontend: Pure HTML5, CSS3, and Vanilla JavaScript. We intentionally avoid heavy frontend frameworks to keep the compiled binary size small and ensure the UI loads instantly, even on low-end industrial field tablets.
-
CI/CD: GitHub Actions handles automated testing, executable compilation,
.debpackaging, and WinGet manifest distribution.
If you wish to explore the code or submit a Pull Request, here is a quick map of the repository structure:
-
/api/- FastAPI routing (routes.py) and real-time event handlers (websockets.py). -
/core/- System-level utilities: hardware discovery (finding active serial COM ports and network adapters), logging, and session management. -
/data/- Internal state management and JSON map handling for the telemetry translation engine. -
/frontend/- The web interface assets, including the UI logic and localization dictionaries. -
/scanners/- The core protocol logic. Contains the dedicated asynchronous workers for Modbus, BACnet, KNX, and passive IP/Serial sniffing. -
/scripts/&/winget/- Automation scripts for bash installations, Debian packaging, and Microsoft package manager distribution.
To run BHAM locally from source for development or testing purposes:
- Clone the repository:
git clone https://github.com/Molonverona/BHAM.git - Navigate to the project directory:
cd BHAM - Install the required dependencies:
pip install -r requirements.txt - Start the development server:
python main.py
The backend will start on http://localhost:8000 and automatically serve the frontend web interface.
We welcome contributions from the community! Whether you are adding a new JSON telemetry map for a specific HVAC vendor, optimizing the Early Exit algorithm, or translating the frontend UI into a new language, please feel free to open an Issue or submit a Pull Request.