TotalApp Docs

Compliance & Document Control

Centralised document management, multi-step approval workflows, expiry tracking, and a tamper-evident audit trail — all in one compliance mode.

Quick Start

Switch to Compliance Mode from the app-mode switcher in the header. You will see four screens in the sidebar:

Document Library Approval Workflow Expiry Reminders Audit Trail
  1. Open Document Library and click Add Document to upload your first policy or procedure.
  2. Use the ⋯ menu on any document and choose Submit for Approval to start an approval request.
  3. Switch to Approval Workflow → Pending Approvals to approve or reject as a reviewer.
  4. Check Expiry Reminders to see which documents need renewal in the next 30 days.
  5. Use Audit Trail to search and export a complete action history.

All data persists on the server

Every document, approval request, and audit log entry is stored in JSON files on the server under data/ — surviving page refreshes and deployments. All endpoints follow the standard TotalApp /api/data/{resource} GET/POST pattern.

The Four Screens

Document Library

Centralised repository for policies, procedures, work instructions, forms, contracts, and certificates. Full version history, status lifecycle, tag search, and an embedded document viewer.

Approval Workflow

Multi-step approval chains per document category. Authors submit; role-based or user-specific approvers review, approve, or reject — with mandatory comments on rejections.

Expiry Reminders

Colour-coded dashboard showing all documents by days remaining. Configurable reminder schedule (30, 15, 7, 1 day) with owner or custom email recipients. One-click renew.

Audit Trail

Tamper-evident, searchable log of every action. Filter by date range, user, action type, and module. CSV/JSON export. Entry detail panel with before/after diff for update actions.

Document Status Lifecycle

Draft In Review Approved Published

A document can also become Expired (when the review date passes with no renewal) or Archived (manually removed from active use). Expired documents are read-only for standard users — only admins and document owners can view or renew them.

StatusBadge colourWho can viewNext action
DraftSlateOwner + adminsSubmit for approval
In ReviewAmberOwner + reviewers + adminsApprove or reject
ApprovedSky blueOwner + adminsPublish
PublishedEmeraldAll usersSubmit new version when update needed
ExpiredRedOwner + admins onlyRenew (creates new version)
ArchivedSlate (dim)Admins onlyRestore or leave archived

Document Categories

CategoryTypical useExample
PolicyOrganisational mandates and principlesQuality Management Manual, Data Privacy Policy
ProcedureStep-by-step processes for teamsIT Security Incident Response, Onboarding Process
Work InstructionOperator-level how-to guidesMachine Calibration Steps, Packing Line Instructions
FormFillable templates for routine tasksEmployee Onboarding Checklist, Non-Conformance Report
ContractLegal agreements with counterpartiesVendor Contract Template, NDA Template
CertificatePeriodic compliance certificatesWorkplace Health & Safety Certificate, ISO 9001 Certificate

Document Actions

Each document row has a ⋯ context menu with the following actions. Some also appear as toolbar buttons in the document viewer.

ActionWhereWhat it does
ViewRow button + viewerOpens the document viewer modal showing the latest version's metadata, version history list, tags, and a Download button. Every open fires a view audit entry.
Edit⋯ menuOpens the Edit modal — update name, description, category, owner, review frequency, next review date, and tags. Saving updates the document and appends an update audit entry.
Upload New Version⋯ menuOpens the Upload Version modal. Drag-and-drop or click to select a file (up to 20 MB). Optionally add a changelog note. Uploads to POST /api/compliance/upload (multipart), stores the returned URL, increments the version counter, and resets status to Draft.
Submit for Approval⋯ menuOpens the Submit for Approval modal. Shows a dropdown of available approval workflows (filtered to those matching the document's category). Add an optional note and click Submit — creates an approval request and sets document status to In Review.
DownloadViewer footerFetches the file with your session credentials attached (the file endpoint is access-controlled). Creates a temporary object URL, triggers a browser download, then revokes the URL. Every download fires a download audit entry.
Archive⋯ menuSoft-deletes the document (status → Archived). Admins can still view it. Fires a delete audit entry.

Submit for Approval requires a matching workflow

If no approval workflow exists for the document's category, the Submit for Approval option shows a message directing you to the Approval Workflow screen. Create a workflow for the category first, then return to submit.

File Upload & Serving

Compliance files are stored server-side under server/data/tenants/{tenantId}/compliance-files/ and served through a JWT-gated endpoint — they are never publicly accessible via a direct URL.

EndpointMethodDescription
/api/compliance/uploadPOST (multipart)Accepts a single file field named file. Maximum 20 MB. Returns { url: "/api/compliance/files/{tenantId}/{filename}" }. Requires a valid app JWT.
/api/compliance/files/:tenantId/:filenameGETStreams the stored file. Requires a valid app JWT — the browser cannot access this URL without authentication. Files are always downloaded with your session credentials attached, via a temporary object URL.

Why not a signed URL?

Because all storage is local to the server (not S3 or similar), signed URLs are not applicable. Every file request goes through the /api/compliance/files/ handler which validates the JWT and resolves the tenant path — this prevents one tenant from accessing another tenant's files even if the filename is guessed.

Data Storage

All data is persisted on the server as tenant-scoped JSON files under server/data/tenants/{tenantId}/. Seven endpoints serve the four compliance screens:

FileAPI EndpointContents
compliance-documents.json/api/data/compliance-documentsAll documents with embedded version arrays.
compliance-approvals.json/api/data/compliance-approvalsWorkflow definitions + approval requests.
compliance-acknowledgments.json/api/data/compliance-acknowledgmentsPer-user document acknowledgment records.
compliance-reminders.json/api/data/compliance-remindersReminder settings (days, recipients, enabled).
compliance-audit.json/api/data/compliance-auditAppend-only audit log (max 5,000 entries per tenant).
POST /api/compliance/uploadMultipart file upload — stores file, returns serving URL.
GET /api/compliance/files/:tenantId/:filenameJWT-gated file serving for downloaded compliance documents.

Firebase migration path

The storage layer is designed to migrate cleanly to Firebase or any other backend without affecting how the screens work. File upload/serving would migrate to cloud storage (e.g. S3) with no change to how documents are uploaded or downloaded.

AI Assistant

Document Library includes a right-edge AI Assistant panel that reviews your current (filtered) document list — name, category, status, owner, version, next review date, and acknowledgment requirement — and answers natural-language questions about it.

Review Coverage

Flags categories with few or no published documents, or documents stuck in draft/review for a long time.

Expiry / Review Risk

Highlights documents with a near or past-due next review date.

Ownership Gaps

Flags documents with unclear or duplicate owners.

Drafting Help

Describe a new policy or procedure need in plain language and get a proposed document outline (sections, review frequency, category) you can create.

Save Assistant Answers as Reports

Any assistant response can be saved directly to My Reports with one click, so a coverage review or drafted outline doesn't have to be re-generated later.

Frequently Asked Questions

How do I switch to Compliance Mode?
Click the mode pill in the top header (it shows the current mode name, e.g. "Workspace"). In the dropdown or cycle switcher, select Compliance. The sidebar will update to show the four Compliance screens. You can also navigate directly to any compliance screen from the My Apps screen or the landing page.
Can I use Compliance screens from other modes?
Yes. Use Settings → App Modes → Compliance to add individual Compliance screens to any custom mode. Or add them to the sidebar of your current mode via Manage Screens (the + button at the bottom of the sidebar).
Is there a mobile view for the compliance screens?
Yes. All four screens are mobile-first. On small screens the left sidebar in the Document Library is replaced by a compact dropdown menu, and the tables scroll horizontally. The Approval Workflow uses a card-based layout that stacks cleanly on mobile.
Which compliance standards does this module support?
The module is standard-agnostic. The six document categories, version control, approval trails, and acknowledgment tracking are the building blocks required by ISO 9001, ISO 27001, SOC 2, GDPR, and similar frameworks. You configure the workflows and document categories to match your specific requirements.