How dominic62q/zkteco-localhost-bridge works
This is a local fingerprint test app and reusable localhost bridge: a React UI initiates enrolment or verification, the bridge coordinates the USB reader and vendor SDK, and enrolled users/templates persist in encrypted SQLite storage. The bridge also exposes app-agnostic capture, merge, verify, and identify operations for other authorized clients. The graph follows the documented API and sampled call sites; some route wiring and service internals were not included in the excerpts, so uncertain links are omitted.
Main entry points: Program.cs HTTP routes · EnrolManager.cs Enrol sessions · VerifyManager.cs Verify sessions · ZkFingerService.cs SDK service
Components 17
Test UI
- Test interface
frontend/src/App.tsx - Enrol / verify UI
frontend/src/components - API client
frontend/src/api/client.ts
Bridge API
- HTTP routes
bridge/Program.cs - Token auth
bridge/Middleware/TokenAuth.cs
Fingerprint operations
- Enrol sessions
bridge/Services/EnrolManager.cs - Verify sessions
bridge/Services/VerifyManager.cs - Generic operations
bridge/Services/CaptureService.cs - Capture gate
bridge/Services/CaptureGate.cs - Device polling
bridge/Services/DevicePoller.cs - SDK service
bridge/Services/ZkFingerService.cs
Local data
- Template protection
bridge/Services/TemplateProtection.cs - User and template store
bridge/Data/Store.cs - SQLite database
data
Other components
- User / app
- ZKFinger SDK
- USB reader
Connections 28
- User / app → Test interface: uses
- Test interface → Enrol / verify UI: shows
- Test interface → API client: polls / requests
- Enrol / verify UI → API client: starts / polls
- API client → HTTP routes: HTTP requests
- HTTP routes → Token auth: passes through
- HTTP routes → Enrol sessions: starts / reads
- HTTP routes → Verify sessions: starts / reads
- HTTP routes → Generic operations: dispatches v1
- HTTP routes → User and template store: reads / deletes
- HTTP routes → SDK service: reads status
- Enrol sessions → Capture gate: acquires
- Verify sessions → Capture gate: acquires
- Generic operations → Capture gate: acquires
- Enrol sessions → SDK service: uses reader
- Verify sessions → SDK service: uses reader
- Generic operations → SDK service: captures
- Device polling → SDK service: refreshes cache
- SDK service → ZKFinger SDK: calls
- ZKFinger SDK → USB reader: controls
- Enrol sessions → ZKFinger SDK: matches / merges
- Verify sessions → ZKFinger SDK: matches
- Generic operations → ZKFinger SDK: merges / identifies
- Enrol sessions → User and template store: loads / saves
- Verify sessions → User and template store: loads template
- Enrol sessions → Template protection: encrypts template
- Verify sessions → Template protection: decrypts template
- User and template store → SQLite database: reads / writes