Skip to content

Routes and Pages

Rod Christiansen edited this page Oct 8, 2026 · 3 revisions

Routes and Pages

Every route in the App Router at HEAD: the pages a user can open, and the server route handlers that back them.

Pages

"Calls" lists the same-origin routes the page fetches. Pages marked (via useDeviceData) fetch /api/v1/devices for inventory context plus /api/v1/<module> for the module rows.

Route What you see Calls
/ A spinner that redirects to /dashboard once the session resolves —
/dashboard Live event feed, fleet summary tiles, fleet status donut, connection status /api/dashboard (every 30 seconds), /api/v1/negotiate
/devices The fleet device list with inventory columns and filters, including a Storage status that shows the storage room as the location and searches by lease number /api/v1/devices
/device/[deviceId] One device, tabbed: Info, Installs, Applications, System, Management, Identity, Hardware, Peripherals, Security, Network, Events. A stored device shows an In storage pill with its room and lease number. The System tab shows the license source under the activation badge. The Management tab carries the Management Tools Logs viewer (below) /api/device/<id>/info, /api/device/<id>/modules/<module>, /api/admin/device/<serial> for archive/delete
/device/list A minimal device list, useful when the main list misbehaves /api/v1/devices
/events Event feed with filtering and an expandable raw payload per event /api/events, /api/events/<id>/payload
/events/failures Devices that reached the server but were rejected during registration or check-in /api/events/failures
/applications Applications report: version spread, usage, and "missing" modes, with inventory filters /api/v1/applications, /api/v1/applications/filters, /api/v1/applications/usage
/applications/coverage Collection health — how fresh applications data is across the fleet /api/v1/applications/collection-health
/applications/usage/[appName] Per-device usage drill-down for one application /api/v1/applications/usage/by-device
/installs Managed-install state across the fleet, with status and inventory filters /api/v1/installs, /api/v1/installs/filters
/hardware Hardware report (model, CPU, memory, storage). The Storage column lists every drive, internal first, with its size, free space and an External label; drive letters sit in a pill on the left, and the disk holding C: lists first (via useDeviceData) /api/v1/hardware
/system Operating system, build, activation, license source, uptime, architecture. The search also matches installed updates (KB id, title, install date). Selecting a Windows version in the version chart drills into the installed KBs on that build, by device count; selecting a KB searches for it (via useDeviceData) /api/v1/system
/management Enrollment and configuration-profile state /api/v1/management
/identity Local and directory account state, join state. The Selections filters narrow both the table and the widgets /api/v1/identity
/network Interfaces, addressing, connectivity (via useDeviceData) /api/v1/network
/peripherals Displays, printers and other attached devices /api/v1/peripherals
/security Security posture, plus a certificates view /api/v1/security, /api/v1/security/certificates
/inventory Redirects to /devices — inventory is folded into the device list —
/settings General, Inventory Mapping, Security Rules, Kiosk Displays, Maintenance. Demo mode hides Maintenance /api/settings, /api/admin/installs/clear-errors, /api/admin/device/<serial>, /api/admin/devices/bulk-delete
/settings/onboarding First-run wizard that writes the initial settings document /api/settings, /api/settings/inventory/discover
/live-installs Install activity view /api/live-installs — no such route handler exists in this repo, so the page has no data source at HEAD
/progressive, /dashboard/progressive Progressive-loading dashboard variant /api/v1/devices-list, /api/v1/chart-data
/dashboard/test, /basic Development scratch pages (a device-fetch harness and a plain HTML/CSS render check) /api/v1/devices (test page only)
/auth/signin Sign-in page, provider buttons NextAuth endpoints
/auth/error Sign-in failure, optionally with a support mailto link —
/kiosk Not a page — exchanges ?token= for a read-only viewer session and redirects /api/settings (server-side, for the kiosk home path)

Every report page shows the same device status pills, Storage included; see Architecture for the rule.

Management Tools Logs

On the device Management tab, one tab per management-tool log root the device reports (the MDM root first), with a picker listing every file in the root — tailed files first, the rest under Not tailed. A file whose tail holds an error gets a red dot, one with warnings an amber dot. Text logs (the logging convention's own lines, CMTrace, Intune daemon, Munki and syslog-style lines) render as one-line event rows that expand to the full message; JSONL is read by its level field, and session.json / status.json render as a typed tree. Errors, Warnings and Debug toggles filter by level (debug is hidden by default), beside a text filter. The root facts include the version of the tool that owns the root, from the client or, failing that, the installs module. A tool's tails are fetched from /api/device/<serial>/logs/<tool> the first time its tab opens.

Legacy redirects

next.config.mjs permanently redirects /devices/<module> and /devices/<module>/<rest> to the top-level /<module> for: applications, hardware, identity, installs, inventory, management, network, peripherals, profiles, security, system. Query strings are preserved.

Server routes

All of these are Next.js route handlers under app/api. Unless noted, they proxy the matching path on reportmate-api and require a session (the middleware returns JSON 401 otherwise).

Fleet data

Route Method Upstream
/api/v1/devices GET /api/v1/devices
/api/v1/devices-list GET /api/v1/devices, reshaped for the progressive dashboard
/api/v1/applications GET /api/v1/applications
/api/v1/applications/filters GET /api/v1/applications/filters
/api/v1/applications/distribution GET /api/v1/applications/distribution
/api/v1/applications/collection-health GET /api/v1/applications/collection-health
/api/v1/applications/usage GET /api/v1/applications/usage
/api/v1/applications/usage/by-device GET /api/v1/applications/usage/by-device
/api/v1/hardware GET /api/v1/hardware
/api/v1/identity GET /api/v1/identity
/api/v1/inventory GET /api/v1/inventory
/api/v1/management GET /api/v1/management
/api/v1/network GET /api/v1/network
/api/v1/peripherals GET /api/v1/peripherals
/api/v1/security GET /api/v1/security
/api/v1/security/certificates GET /api/v1/security/certificates
/api/v1/system GET /api/v1/system
/api/v1/installs GET /api/v1/installs, or per-device /api/v1/device/<id> when a device is named
/api/v1/installs/data GET Devices with installs + inventory only, from the shared installs cache
/api/v1/installs/filters GET /api/v1/installs/filters
/api/v1/installs/progress GET Derived from /api/v1/devices and per-device /api/v1/device/<serial>
/api/v1/chart-data GET Derived from /api/v1/devices plus per-device detail
/api/v1/profiles GET Returns HTTP 410. Profiles were merged into the management module

/api/v1/identity, /api/v1/security and /api/v1/system accept an include_archived flag and forward it upstream.

Devices and events

Route Method Notes
/api/device POST, HEAD Forwards a device payload to /api/v1/device, which reportmate-api does not serve (agents post to /api/v1/events), so it has no working upstream. Returns 503 if the upstream is unreachable
/api/device/[deviceId] GET Full device record, with an events lookup for last-seen
/api/device/[deviceId]/info GET Header/summary data for the device page
/api/device/[deviceId]/modules/[moduleName] GET One module's payload for a device tab
/api/device/[deviceId]/events GET Device event history
/api/device/[deviceId]/install-events GET Install-level events. Proxies /api/v1/device/<id>/install-events, which reportmate-api does not serve, so it returns an error
/api/device/[deviceId]/install-sessions GET Grouped install sessions. Proxies /api/v1/device/<id>/install-sessions, which reportmate-api does not serve, so it returns an error
/api/device/[deviceId]/install-analytics GET Install analytics for the device. Proxies /api/v1/device/<id>/install-analytics, which reportmate-api does not serve, so it returns an error
/api/device/[deviceId]/installs/log GET Raw managed-install log
/api/device/[deviceId]/package-history GET Per-package install history. Proxies /api/v1/device/<id>/package-history, which reportmate-api does not serve, so it returns an error
/api/device/[deviceId]/logs/[tool] GET Management-tool log tails, from /api/v1/device/<id>/logs/<tool>
/api/device/resolve/[identifier] GET Resolves an asset tag / name / hostname to a serial, or 404
/api/device-names GET ?serials=a,b,c → serial-to-name map, from an in-process cache
/api/dashboard GET /api/v1/dashboard
/api/events GET /api/v1/events, enriched with device names
/api/events/failures GET /api/v1/events/failures
/api/events/[eventId]/payload GET Raw event payload, 10-second upstream timeout

Settings and admin

Admin routes call requireAdmin() from lib/auth-roles.ts, which returns 401 without a session and 403 without the admin role.

Route Method Guard Effect
/api/settings GET session Read the settings document
/api/settings PUT admin Replace the settings document
/api/settings/inventory/discover GET admin Inventory keys observed across devices, with counts and samples
/api/admin/device/[deviceId] DELETE admin Permanently delete a device and its data
/api/admin/device/[deviceId]/archive POST admin Archive a device
/api/admin/device/[deviceId]/unarchive POST admin Unarchive a device
/api/admin/devices/bulk-delete POST admin Delete several devices, reporting per-serial results
/api/admin/installs/clear-errors DELETE admin Clear stale install errors older than ?days=

Auth, health and diagnostics

Route Method Notes
/api/auth/[...nextauth] GET, POST NextAuth handler. Public
/api/healthz GET, HEAD Liveness plus whether API_BASE_URL and the internal secret are set. Public
/api/version GET Version, build id, build time, image tag. Public
/api/diagnostic GET Calls upstream devices and events and reports what happened
/api/test-auth GET Reports which auth environment variables are set and whether the provider list loads
/api/v1/negotiate GET Web PubSub negotiate token for the live event stream. Session required; returns 502 {"error":"Negotiate failed"} when the upstream call fails
/api/cache/status GET Static description of the intended cache layout
/api/cache/invalidate POST Acknowledges an invalidation request; no cache is actually cleared

app/api/auth/auto-signin/route.ts exports a default function rather than a route-handler verb, so it is not a working endpoint despite its name.

Clone this wiki locally