This repository implements a DIY smart lock controller for ESP32 hardware, enabling Apple HomeKey NFC authentication, HomeKit integration, and MQTT connectivity for Home Assistant. The architecture is a hybrid embedded system: a C++ backend built on ESP-IDF (FreeRTOS) handles hardware interaction (NFC, GPIO, Ethernet) and protocol stacks (HomeSpan, mbedTLS), while a Svelte 5 frontend hosted on the device's LittleFS provides a web-based configuration and monitoring interface. The system manages configuration persistence in NVS using MessagePack/JSON serialization and streams real-time logs via WebSocket. Engineering quality is high, featuring RAII wrappers for memory safety in C++, template-based configuration management, and a decoupled event-loop architecture. However, the codebase carries significant security debt, explicitly acknowledging the lack of flash encryption and plain-text password storage in configuration. Hardware support is fragmented across ESP32 variants and NFC modules, requiring hardcoded pin presets that limit portability. Despite 52 open issues, the recent commit activity and modern tech stack (ESP-IDF 5.x, Svelte 5) indicate active development.
This repository implements an Apple Home Key Reader application that enables NFC-based authentication for Apple HomeKit smart locks. The system acts as a bridge between NFC-enabled devices (iPhones/Apple Watches with Home Keys) and HomeKit accessory control, allowing users to unlock locks by tapping their devices on an NFC reader. The architecture follows a modular design with clear separation: main.py coordinates initialization, accessory.py handles HomeKit Accessory Protocol interfaces, service.py implements core NFC authentication logic, homekey.py manages Apple-specific NFC protocols, and repository.py handles persistent state management. The application relies on external dependencies including pyhap for HomeKit, nfcpy for NFC communication, and cryptography for security operations.