UniEvents includes a browser-based QR code scanner atDocumentation Index
Fetch the complete documentation index at: https://mintlify.com/Edfermachado/proyectoSistemas/llms.txt
Use this file to discover all available pages before exploring further.
/faculty-admin/scanner that lets authorized staff verify attendee tickets at event entrances. Each attendee receives a unique ticketToken (UUID) embedded in their QR code. When scanned, the server marks the token as used and writes an immutable scan log record, providing a tamper-resistant audit trail of all entry validations.
Scanner Access
Navigate to/faculty-admin/scanner. The scanner page is accessible to sessions holding one of the following roles:
tenant_adminevent_managersuperadminaccess_control
The
access_control role is specifically designed for gate staff who only need the scanning capability. Users with this role are automatically redirected to /faculty-admin/scanner on login and cannot navigate to any other section of the portal.How Scanning Works
Start the camera
Click Iniciar Escáner and grant the browser camera permission when prompted. The scanner uses the device’s rear-facing camera (
facingMode: "environment") at 10 frames per second with a 250×250 pixel QR detection box.Frame the QR code
Align the attendee’s QR code within the visible scanner frame. The
html5-qrcode library decodes the QR code and extracts the ticketToken UUID string.Ticket validation request
The scanner automatically sends a
POST request to /api/tickets/validate with the decoded token:Server processes the token
The server looks up the
attendees table by ticketToken:- Token found,
scannedAtisnull→ UpdatesscannedAtto the current timestamp, inserts a record inscanLogs(witheventId,attendeeId, andscannedByfrom the session), and returns200 OKwith attendee details. - Token found,
scannedAtis already set → Returns409 Conflict(ticket already used). - Token not found → Returns
404 Not Found.
Visual feedback is displayed
The scanner overlay changes color and displays a large status message:
After 3.5 seconds, the overlay clears and the scanner resumes listening for the next QR code.
| Result | Overlay | Message |
|---|---|---|
| Valid, first scan | 🟢 Green | ACCESO PERMITIDO + attendee name and type |
| Already scanned | 🟡 Gold | TICKET YA ESCANEADO |
| Not found / error | 🔴 Red | TICKET INVÁLIDO or connection error |
API Reference — Ticket Validation
Request:200 OK):
409 Conflict):
404 Not Found):
Scan Logs
Every successful scan is recorded in thescanLogs table with the following fields:
| Field | Description |
|---|---|
eventId | The event the scanned attendee is registered for. |
attendeeId | The specific attendee record that was validated. |
scannedBy | The userId of the logged-in staff member who performed the scan. |
scannedAt | Timestamp of when the scan occurred (set automatically). |
tenant_admin users on the Audit Logs page (/faculty-admin/audit), which shows the 100 most recent scans across all of the faculty’s events, ordered by scannedAt descending.
HTML5 QR Code Library
The scanner is built on thehtml5-qrcode library, which provides cross-browser camera access and QR decoding via the browser’s MediaDevices API. The scanner instance is attached to a <div id="reader"> element in the DOM. The library is initialized on component mount and properly stopped and cleaned up when the component unmounts or the user clicks Detener Escáner.