PrintWisePrintWise
Help / TRD

Technical Requirement Document

PrintWise — implementation architecture and operational requirements

Prepared 5 November 2026 · Based on the implemented PrintWise build.

Back to Help

1. System architecture

PrintWise uses server-rendered PHP with a MySQL/MariaDB relational database. index.php dispatches page routes and request handlers; includes/ contains authentication, calculations, decision logic, management, reporting, documentation and backup/restore functions. There is no application framework or Node.js runtime dependency.

The browser renders semantic HTML and the existing CSS/JavaScript. JavaScript enhances the assessment wizard, debounced preview, saved-quote comparison, charts, confirmation controls, theme selection and responsive sidebar; core submission remains server validated.

2. Runtime and hosting requirements

ComponentRequirement
ServerPHP 8.2+; MySQL or MariaDB with InnoDB; Apache-compatible cPanel hosting and functioning private-directory rules.
PHP extensionsPDO MySQL, mbstring, sessions, JSON/iconv; ZIP for application archives; GD for report-logo handling. Development tests also use cURL/DOM and a Chromium browser.
ClientCurrent desktop/mobile browser supporting native forms and JavaScript. Responsive navigation adapts at the established 800px mobile breakpoint.
VisualizationChart.js 4.4.3 loaded from jsDelivr. Google Fonts enhances typography; local data tables/native text provide fallback content.
Private configurationconfig/config.local.php supplies deployment-specific DB connection settings and optional private backup directory. It is not distributed with real secrets.
StorageWritable PHP sessions and owner-controlled private backup/staging storage outside public document roots; adequate disk, memory, time and upload quota.
TransportHTTPS with a valid certificate. Secure cookie behavior is enabled when the request is HTTPS.

3. Main modules and interfaces

Module / routeResponsibility
auth.php / login, register, logoutCurrent user lookup, role guards, password verification, session lifecycle and persistent authentication throttling.
assessment.php + calculator.phpInput validation, server preview, eligible-shop calculation, saved results and transactional assessment creation/update.
dss.php + decision_views.phpPreference normalization, weighted ranking, explanation, budget alternatives and what-if comparison.
management.php + shop_management.phpOwned history, version rendering, shared filters/pagination, user controls, shop/service/rate administration.
analytics.phpPeriod-scoped saved-quote aggregates, recent assessment activity, usage series and estimated-cost distributions.
pdf.php + reports routeSaved-assessment/summary PDF generation and filtered HTML print reports.
application_restore.php + backup_validation.phpPrivate signed ZIP backup/staging/apply/recovery and constrained SQL restore validation.
manual.php + requirements.phpExisting help manuals, Help hub, PRD/TRD rendering, and visible dedicated demo-login instructions.

4. Database entities and relationships

TablePurpose / important relationship
usersIdentity, unique email, password hash, user/admin role, active flag and timestamps. No plaintext password column.
printing_shopsShop identity, active state, demo key, duplex capability and optional configured metadata.
printing_servicesFinishing names/types/fees and active/demo metadata.
shop_servicesMany-to-many shop/service assignments with availability flags.
shop_ratesPaper-specific B&W/color prices and effective dates; unique shop/paper pair.
print_assessmentsOwner and requirements, status, preference JSON and parent_assessment_id. Parent is a logical application-enforced revision link.
assessment_quotesAssessment/shop foreign keys, printing/finishing/total cost, budget flag and complete details_json snapshot.
recommendationsChosen shop, assessment link, explanation and budget-match flag.
assessment_versionsFull previous assessment/quote/recommendation JSON, actor and timestamp before an update. No cascading foreign keys, intentionally preserving archived history.
rate_historyOld/new paper prices and responsible administrator metadata. Historical entries are reviewed alongside shop pricing.
activity_logsActor/name snapshot, action, details, IP and timestamp. User removal does not require losing its name snapshot.
backup_recordsDatabase/application/restore metadata, filename, result and timestamp.
auth_attemptsHashed IP/identity keys, attempt counts and rolling authentication windows.
notificationsSchema-supported user notifications; no broad real-time notification service is claimed.
system_settingsPermitted stored setting keys and values; distinct from private deployment constants.

5. Assessment transaction and consistency

6. Authorization, passwords and sessions

7. Querying, pagination and analytics

8. Reports and document generation

9. SQL backup and restore

10. Application ZIP backup and restore

11. Deployment, migration and demonstration data

12. Verification and known operational limits