1. Facial Recognition Authentication & Time Punch
The main screen (FacialRecognitionScreen) combines identity verification and time registration in a single flow:
Activates the device camera (front or rear, switchable)
Runs a continuous face detection loop using face-api.js, analyzing image sharpness and detection confidence
When a face is detected with sufficient confidence, it extracts a 128-float facial descriptor and submits it to Supabase to match against enrolled collaborators
On a successful match, the employee is logged in and can immediately punch the clock with one button press
After punching, the session automatically signs out
2. Automatic Check-In / Check-Out Toggling
The backend Edge Function (registrar-ponto) automatically determines whether the record is an Entrada (In) or Saída (Out) based on the last registered event for that collaborator. No manual selection is required.
3. CRPT Generation
Every time punch triggers the Edge Function to:
Collect collaborator and company data from the database
Assign a sequential NSR (Número Sequencial de Registro)
Generate a SHA-256 hash over the record fields
Produce a digitally-signed PDF CRPT (Comprovante de Registro de Ponto de Trabalho)
Upload the PDF to a Supabase Storage bucket (crpts)
Return the download URL to the app
4. Manual Identification Fallback
A ManualIdentificationModal allows employees to authenticate using email and password when:
Facial recognition is not possible (poor lighting, camera issues)
The employee has not yet enrolled their face (first login must be manual)
5. Offline Support
The app implements a full offline-first outbox pattern:
When a punch is registered without network connectivity, it is saved locally in IndexedDB via PontoOutbox
Upon reconnection, pending records are automatically synced with the server
Offline authentication is supported via offline-auth.ts, using encrypted local credentials in IndexedDB (secure-storage.ts with AES-GCM encryption via the Web Crypto API)
A network status indicator (Wi-Fi icon) always reflects the current connectivity state
6. Device Fingerprinting & Authorization
Each device is identified using FingerprintJS, generating a unique deviceToken stored encrypted in IndexedDB. The administrator (via gestor-backend) must authorize devices before they can be used to register punches. The auth flow checks device authorization status and blocks or warns the user accordingly.
7. Auto-Logout Session Timer
After login, a countdown timer (useLogoutTimer) automatically signs the employee out after a configurable period (default: 30 seconds). A visual warning appears in the final 30 seconds. This ensures the kiosk screen is always ready for the next employee.
8. Profile Management
The /profile route provides:
Display name editing — inline edit with save/cancel
Profile photo upload — file picker with 2 MB limit, base64 encoding, and live preview before saving
Account deletion — password-confirmed hard delete of the Supabase account
9. Forced Password Change
When a collaborator's account has the precisa_mudar_senha flag set (e.g. on first login), the app automatically redirects to /change-password. The screen validates minimum length (6 chars), real-time confirmation matching, and field-level error messages.
10. PWA & Mobile Support
Configured as a full PWA (manifest.webmanifest, sw.js service worker), the app:
Can be installed on home screens (iOS and Android)
Supports offline operation
Has full Open Graph and Twitter Card metadata for link sharing
Includes auto-update detection via useVersionCheck polling version.json
YouuPonto REP-P is a PWA for electronic employee time tracking (REP-P compliant)