# ethanzer0/facelogin architecture

> Architecture diagram of the GitHub repository ethanzer0/facelogin, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-12-06). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/ethanzer0/facelogin
- Repository: https://github.com/ethanzer0/facelogin

## Overview

FaceLogin provides Windows camera-based face authentication for lock-screen sign-in, plus an enrollment console and graphical installer. The principal path is lock-screen authentication through the service: the service captures and analyzes a face, applies pose/liveness checks, matches enrolled data, and returns credentials over a named pipe. The console enrolls and manages faces and communicates with the service; the installer handles setup and removal. Several implementation details, including credential-provider and credential-store sources, are absent from the supplied tree, so those links are not expanded.

Main entry points: [`face_service/FaceService.cpp`](https://github.com/ethanzer0/facelogin/blob/main/face_service/FaceService.cpp) (Face service), [`enrollment_app/EnrollmentWizard.cpp`](https://github.com/ethanzer0/facelogin/blob/main/enrollment_app/EnrollmentWizard.cpp) (Enrollment and management), [`face_service/webcam_capture.cpp`](https://github.com/ethanzer0/facelogin/blob/main/face_service/webcam_capture.cpp) (Camera capture), [`enrollment_app/main.cpp`](https://github.com/ethanzer0/facelogin/blob/main/enrollment_app/main.cpp) (Console entry point)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_auth["Authentication service"]
  node_service["Face service<br/>[FaceService.cpp]"]
  node_pipe["Named-pipe server<br/>[pipe_server.cpp]"]
  node_camera["Camera capture<br/>[webcam_capture.cpp]"]
  node_fallback_camera["DirectShow fallback"]
  node_face_detection["SCRFD detection<br/>[onnx_models.h]"]
  node_landmarks["106-point landmarks"]
  node_recognition["Face recognition<br/>[onnx_models.h]"]
  node_pose["Pose and liveness"]
end

subgraph group_enroll["Enrollment console"]
  node_console_entry["Console entry point<br/>[main.cpp]"]
  node_wizard["Enrollment and management"]
  node_preview["Camera preview<br/>[CameraPreview.cpp]"]
  node_webview["WebView host<br/>[WebviewHost.cpp]"]
end

subgraph group_shared["Shared runtime"]
  node_user_data[("Enrolled face data")]
  node_config["Runtime configuration<br/>[config_util.h]"]
  node_secure_storage["DPAPI utilities<br/>[dpapi_util.cpp]"]
  node_ipc_protocol["IPC protocol<br/>[ipc_protocol.cpp]"]
end

subgraph group_install["Installer"]
  node_installer_ui["Installer interface<br/>[App.vue]"]
  node_installer_backend["Installer backend<br/>[app.go]"]
  node_installer_ops["Install operations"]
end

node_logon(("Windows lock screen"))

node_logon -->|"requests authentication"| node_service
node_service -->|"handles requests"| node_pipe
node_service -->|"captures frames"| node_camera
node_service -->|"falls back"| node_fallback_camera
node_service -->|"detects faces"| node_face_detection
node_service -->|"extracts landmarks"| node_landmarks
node_service -->|"matches faces"| node_recognition
node_service -->|"checks liveness"| node_pose
node_service -->|"matches enrolled data"| node_user_data
node_service -->|"loads settings"| node_config
node_service -->|"uses protocol"| node_ipc_protocol
node_console_entry -->|"creates wizard"| node_wizard
node_console_entry -->|"creates host"| node_webview
node_wizard -->|"uses capture"| node_camera
node_wizard -->|"loads models"| node_face_detection
node_wizard -->|"loads models"| node_landmarks
node_wizard -->|"saves enrollment"| node_user_data
node_wizard -->|"protects passwords"| node_secure_storage
node_wizard -->|"uses protocol"| node_ipc_protocol
node_preview -->|"captures frames"| node_camera
node_installer_ui -.->|"invokes operations"| node_installer_backend
node_installer_backend -.->|"delegates operations"| node_installer_ops

click node_service "https://github.com/ethanzer0/facelogin/blob/main/face_service/FaceService.cpp"
click node_pipe "https://github.com/ethanzer0/facelogin/blob/main/face_service/pipe_server.cpp"
click node_camera "https://github.com/ethanzer0/facelogin/blob/main/face_service/webcam_capture.cpp"
click node_fallback_camera "https://github.com/ethanzer0/facelogin/blob/main/face_service/webcam_capture_dshow.cpp"
click node_face_detection "https://github.com/ethanzer0/facelogin/blob/main/face_service/onnx_models.h"
click node_landmarks "https://github.com/ethanzer0/facelogin/blob/main/face_service/landmark_detector.cpp"
click node_recognition "https://github.com/ethanzer0/facelogin/blob/main/face_service/onnx_models.h"
click node_pose "https://github.com/ethanzer0/facelogin/blob/main/face_service/liveness_detector.cpp"
click node_config "https://github.com/ethanzer0/facelogin/blob/main/common/config_util.h"
click node_secure_storage "https://github.com/ethanzer0/facelogin/blob/main/common/dpapi_util.cpp"
click node_ipc_protocol "https://github.com/ethanzer0/facelogin/blob/main/common/ipc_protocol.cpp"
click node_console_entry "https://github.com/ethanzer0/facelogin/blob/main/enrollment_app/main.cpp"
click node_wizard "https://github.com/ethanzer0/facelogin/blob/main/enrollment_app/EnrollmentWizard.cpp"
click node_preview "https://github.com/ethanzer0/facelogin/blob/main/enrollment_app/CameraPreview.cpp"
click node_webview "https://github.com/ethanzer0/facelogin/blob/main/enrollment_app/WebviewHost.cpp"
click node_installer_ui "https://github.com/ethanzer0/facelogin/blob/main/installer/FaceLoginSetup/frontend/src/App.vue"
click node_installer_backend "https://github.com/ethanzer0/facelogin/blob/main/installer/FaceLoginSetup/app.go"
click node_installer_ops "https://github.com/ethanzer0/facelogin/tree/main/installer/FaceLoginSetup/internal"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_service,node_pipe,node_camera,node_fallback_camera,node_face_detection,node_landmarks,node_recognition,node_pose,node_logon toneBlue
class node_console_entry,node_wizard,node_preview,node_webview toneAmber
class node_user_data,node_config,node_secure_storage,node_ipc_protocol toneMint
class node_installer_ui,node_installer_backend,node_installer_ops toneRose
```

## Components

### Authentication service

- [Face service](https://github.com/ethanzer0/facelogin/blob/main/face_service/FaceService.cpp): `face_service/FaceService.cpp`
- [Named-pipe server](https://github.com/ethanzer0/facelogin/blob/main/face_service/pipe_server.cpp): `face_service/pipe_server.cpp`
- [Camera capture](https://github.com/ethanzer0/facelogin/blob/main/face_service/webcam_capture.cpp): `face_service/webcam_capture.cpp`
- [DirectShow fallback](https://github.com/ethanzer0/facelogin/blob/main/face_service/webcam_capture_dshow.cpp): `face_service/webcam_capture_dshow.cpp`
- [SCRFD detection](https://github.com/ethanzer0/facelogin/blob/main/face_service/onnx_models.h): `face_service/onnx_models.h`
- [106-point landmarks](https://github.com/ethanzer0/facelogin/blob/main/face_service/landmark_detector.cpp): `face_service/landmark_detector.cpp`
- [Face recognition](https://github.com/ethanzer0/facelogin/blob/main/face_service/onnx_models.h): `face_service/onnx_models.h`
- [Pose and liveness](https://github.com/ethanzer0/facelogin/blob/main/face_service/liveness_detector.cpp): `face_service/liveness_detector.cpp`

### Enrollment console

- [Console entry point](https://github.com/ethanzer0/facelogin/blob/main/enrollment_app/main.cpp): `enrollment_app/main.cpp`
- [Enrollment and management](https://github.com/ethanzer0/facelogin/blob/main/enrollment_app/EnrollmentWizard.cpp): `enrollment_app/EnrollmentWizard.cpp`
- [Camera preview](https://github.com/ethanzer0/facelogin/blob/main/enrollment_app/CameraPreview.cpp): `enrollment_app/CameraPreview.cpp`
- [WebView host](https://github.com/ethanzer0/facelogin/blob/main/enrollment_app/WebviewHost.cpp): `enrollment_app/WebviewHost.cpp`

### Shared runtime

- **Enrolled face data**
- [Runtime configuration](https://github.com/ethanzer0/facelogin/blob/main/common/config_util.h): `common/config_util.h`
- [DPAPI utilities](https://github.com/ethanzer0/facelogin/blob/main/common/dpapi_util.cpp): `common/dpapi_util.cpp`
- [IPC protocol](https://github.com/ethanzer0/facelogin/blob/main/common/ipc_protocol.cpp): `common/ipc_protocol.cpp`

### Installer

- [Installer interface](https://github.com/ethanzer0/facelogin/blob/main/installer/FaceLoginSetup/frontend/src/App.vue): `installer/FaceLoginSetup/frontend/src/App.vue`
- [Installer backend](https://github.com/ethanzer0/facelogin/blob/main/installer/FaceLoginSetup/app.go): `installer/FaceLoginSetup/app.go`
- [Install operations](https://github.com/ethanzer0/facelogin/tree/main/installer/FaceLoginSetup/internal): `installer/FaceLoginSetup/internal`

### Other components

- **Windows lock screen**

## Connections

- Windows lock screen → Face service: requests authentication (evidence: `README.md`)
- Face service → Named-pipe server: handles requests
- Face service → Camera capture: captures frames
- Face service → DirectShow fallback: falls back (evidence: `face_service/FaceService.cpp`)
- Face service → SCRFD detection: detects faces
- Face service → 106-point landmarks: extracts landmarks
- Face service → Face recognition: matches faces
- Face service → Pose and liveness: checks liveness (evidence: `face_service/FaceService.cpp`)
- Face service → Enrolled face data: matches enrolled data (evidence: `README.md`)
- Face service → Runtime configuration: loads settings (evidence: `face_service/FaceService.cpp`)
- Face service → IPC protocol: uses protocol (evidence: `face_service/FaceService.cpp`)
- Console entry point → Enrollment and management: creates wizard (evidence: `enrollment_app/main.cpp`)
- Console entry point → WebView host: creates host (evidence: `enrollment_app/main.cpp`)
- Enrollment and management → Camera capture: uses capture
- Enrollment and management → SCRFD detection: loads models (evidence: `enrollment_app/EnrollmentWizard.cpp`)
- Enrollment and management → 106-point landmarks: loads models (evidence: `enrollment_app/EnrollmentWizard.cpp`)
- Enrollment and management → Enrolled face data: saves enrollment (evidence: `enrollment_app/EnrollmentWizard.cpp`)
- Enrollment and management → DPAPI utilities: protects passwords (evidence: `enrollment_app/EnrollmentWizard.cpp`)
- Enrollment and management → IPC protocol: uses protocol (evidence: `enrollment_app/EnrollmentWizard.cpp`)
- Camera preview → Camera capture: captures frames
- Installer interface → Installer backend: invokes operations
- Installer backend → Install operations: delegates operations
