PermisosQR ships two reporting surfaces: a live dashboard that auto-refreshes every 30 seconds and gives a real-time snapshot of the whole operation, and a summary report with full date-range filtering for historical analysis. Together they answer the questions operators care about most — how many QR codes are in use right now, how many employees came back on time, which operators process the most permissions, and at what times of day activity peaks. All statistics are computed directly from the PostgreSQL database in parallel queries, keeping response times low even as the permission log grows.Documentation Index
Fetch the complete documentation index at: https://mintlify.com/edgar2420/QrPermision/llms.txt
Use this file to discover all available pages before exploring further.
Dashboard Stats
GET /api/reports/dashboard executes four database queries in parallel via Promise.all and returns their results as a single object. No query parameters are accepted — the dashboard always reflects the full dataset as of the moment of the request.
API reference
qr
Live count of every QR code in each status bucket, plus the grand total. Reflects the
qr_codes table in real time.permissions
All-time permission tallies including how many are currently open (
active_now) and how many are overdue right now.averages
Mean
time_used_minutes, delay_minutes, and allowed_minutes across all completed permissions only. Values are rounded to 2 decimal places.recent_activity
The five most recently created permissions (regardless of status), enriched with the enabling operator’s name.
All three average fields (
avg_time_used, avg_delay, avg_allowed) are computed exclusively from rows where return_time IS NOT NULL. Open permissions — those still in progress — are excluded from the average calculations to avoid skewing results with incomplete data.setInterval hook, ensuring the counters stay current without a manual refresh.
Summary Report
GET /api/reports/summary returns aggregate statistics filtered by an optional date range. It is designed for end-of-shift or end-of-period review and is accessed from the Reports screen in the frontend.
Query parameters
| Parameter | Type | Description |
|---|---|---|
startDate | string (ISO 8601) | Include permissions with created_at ≥ startDate |
endDate | string (ISO 8601) | Include permissions with created_at ≤ endDate |
| Field | Description |
|---|---|
summary.total | Total permission count in the date range |
summary.compliant | Permissions where is_compliant = true |
summary.non_compliant | Permissions where is_compliant = false |
summary.avg_time | Average time_used_minutes (2 decimal places) |
summary.avg_delay | Average delay_minutes across all permissions |
summary.max_delay | Worst single delay in the period (2 decimal places) |
by_admin | Top 10 operators ranked by total permissions processed, with individual compliance counts |
hourly_distribution | Permission counts grouped by the hour component of exit_time — useful for identifying peak exit windows |
Overdue Detection
The dashboard’soverdue count surfaces a critical real-time metric: permissions where an employee has not yet returned and their allowed time has already elapsed.
The SQL condition used is:
active (no return has been recorded) and the current time is past the originally authorized deadline. For example, if an employee was granted 15 minutes starting at 09:00 and it is now 09:18 with no return recorded, that permission counts as overdue.
Frontend Reports Screen
The Reports page (/reports) in the React frontend presents the summary data with two side-by-side visualizations:
Hourly Distribution Chart
A horizontal bar chart showing permission counts for each hour of the day the
exit_time falls in. Bars are scaled relative to the busiest hour, with the count displayed inside each bar. Only hours with at least one permission appear.By-Operator Table
A ranked list of the top 10 operators (by total permissions). Each row shows the operator’s compliance rate as an inline progress bar, their total permissions, and a compliance percentage.