TruPath Admin Dashboard Guide

The admin dashboard (dashboard/) is a separate, session-authenticated area used to manage reference data, review generated reports, and manage dashboard accounts. It is unrelated to the report-generation API's shared-secret key (see API docs) - dashboard pages are gated by a logged-in session, not by X-API-Key/Basic Auth.

Logging in

dashboard/login.php checks the submitted username/password against the users table with PHP's password_verify() against a bcrypt hash stored in password_hash. There is no password-reset-by-email flow - resetting a password means editing the row directly, via the Users page below or SQL.

A default account is seeded by database/schema.sql:

username: admin
password: TruPath@2026
Change this before any production deployment. The seeded password is documented in plaintext in dashboard/login.php and this guide - treat it as a known value, not a secret, until it's rotated.

Session mechanics

All session handling lives in includes/dashboard_session.php:

FunctionPurpose
dashboard_start_session()Starts the PHP session if one isn't active yet. Called internally by the functions below.
dashboard_current_user(): ?arrayReturns the logged-in user's session data (id, username, full_name, role), or null if nobody is logged in.
dashboard_require_login(): arrayRedirects to login and exits if nobody is logged in; otherwise returns the current user. Every dashboard page calls this first.
dashboard_require_role(string $role): arrayCalls dashboard_require_login(), then responds 403 and exits if the user's role doesn't match. Only dashboard/users.php uses this today (gated to 'admin') - the only page with role-based access control.
dashboard_login(array $user): voidCalled by login.php after a successful password_verify(). Regenerates the session id first, to prevent session fixation.
dashboard_logout(): voidClears and destroys the session. dashboard/logout.php calls this then redirects to login.

Dashboard pages

All pages share a common header/nav/footer via dashboard/_layout.php, and a common list+modal CRUD pattern (POST action=create|update|delete handled at the top of the same file, ?edit=<id>/?new=1 opening an add/edit dialog, a DataTables-enhanced list). dashboard/pathogens.php is the clearest example of this pattern.

PagePurpose
dashboard/index.phpOverview - record counts and data-library metadata.
dashboard/reports.phpBrowse/filter previously generated reports, download their PDFs.
dashboard/pathogens.phpManage the pathogens table - this product's own 12-organism fungal/dermatophyte/yeast panel.
dashboard/antimicrobials.phpManage the antimicrobials table (this product's CLINICAL table - every field is actually consumed by ClinicalEngine::profile()).
dashboard/recommendations.phpManage per-organism-source antimicrobial recommendation rankings (EMBEDDED_MASTER_ROWS).
dashboard/icd10.phpManage ICD-10 codes, including which are "primary" tier - this drives the real codingWarning API response flag.
dashboard/users.php admin onlyManage dashboard accounts - see below.
No "Resistance Genes" page and no "Dosing Profiles" page - this product has neither concept at all.

How this product's clinical engine actually differs

This instance is cloned from tpl-womens-health-plus's PHP/MySQL architecture, and its underlying organism panel / drug-info table / master recommendations table are content-identical to tpl-derm's own fungal-drug data - but its clinical algorithms and 1102x1427 report layout are this product's own, ported from the approved TRUFungal PCR Report Generator v1.10 standalone generator:

No client-side spreadsheet-upload feature. The approved source lets a user upload an updated master-mapping .xlsx in the browser and cache it in localStorage. This build intentionally does not replicate that - update the mapping via the dashboard pages above, or by editing reference_source/TruPath_Generator_Data_Library_Fungal.json and re-running tools/import_data_library.php, the same server-side admin-managed convention every sibling product already uses.

Users (add/remove dashboard accounts)

dashboard/users.php is an admin-role-only page for managing who can log into the dashboard:

There is currently only one permission distinction: admin (can access the Users page) vs. everything else (cannot). No per-page/per-action granularity beyond that single check.

What the Admin Dashboard does NOT do

← Back to dashboard