Sanitized private implementation
PHPHESKMariaDBPythonFastAPI.NET 8JavaScriptApacheOAuth 2.0MarkdownCommonMarkMermaidHTML PurifierGitHub Actions

Current platform state

The Portal now covers domains with different maturity levels. Distinguishing what is operational from what is still under rollout prevents public documentation from presenting partial implementation as completed capability.

AreaCurrent sanitized state
Support and requestsOperational, preserving the HESK workflow and departmental extensions.
Knowledge baseLegacy HTML preserved; Markdown, Mermaid, preview, drafts, and AI-assisted automation implemented with controlled writes and audit.
Devices and assetsPortal acts as the human interface for identity, asset linkage, possession, reassociation, offboarding, reviews, and operations governed by an integration service.
Identity and onboardingPeople records, periodic directory synchronization, and controlled provisioning were incorporated with credentials outside source and restricted permissions.
ERP servicesMonitoring, health checks, individual actions, global operations, batch selection, dependency-aware execution, and audit are integrated through a dedicated API and Agent.
Remote and VPN sessionsRemote-session and VPN evidence have dedicated modules, event correlation, and bidirectional navigation with explicit privacy safeguards.
Maintenance / ERP work ordersPortal → ERP creation is validated with a normalized contract. The asynchronous completion path is implemented in the Portal and integration layer, while final ERP emission and end-to-end validation remain rollout gates.
Delivery and dataVersioned migrations, reproducible staging, selective snapshots, and automated deployment are part of the normal delivery workflow.

Why incremental modernization beat a rewrite

The Portal already contained years of operational history, categories, users, attachments, permissions, and working business processes. Rewriting the system before delivering new workflows would have created a large migration window with limited immediate value.

The strategy became:

  1. preserve validated HESK behavior;
  2. extract shared responsibilities only when repetition or risk justified it;
  3. create independent modules for domains with their own persistence and business rules;
  4. move persistent or privileged integrations into specialized services;
  5. version schema, deployment, tests, and recovery alongside each change;
  6. treat observability and rollback as design concerns rather than afterthoughts.

This kept compatibility with the legacy core while allowing Python, FastAPI, and .NET components to emerge without turning the PHP application into an even larger monolith.

Sanitized architecture

Sanitized Enterprise Operations Portal architecture
01 Authenticated users and operators Business areas, support staff, administrators, and operators with different capabilities
02 Apache/PHP Portal on HESK Session, RBAC, CSRF, navigation, modules, server-side proxies, previews, and human confirmations
03 Modules and shared application layer Bootstrap, configuration, permissions, UI components, local rules, and explicit persistence-boundary resolution
04A Domain databases and schemas Help-desk data plus independent databases for modules with distinct entities, migrations, and release cycles
04B Specialized APIs and services Device integration, service control, remote sessions, jobs, workers, and external adapters with dedicated authentication
04C Persistent state outside source Attachments, local configuration, controlled caches, reports, and other files preserved through deployment
05 Audit and observability Health checks, logs, worker state, operation history, deployment evidence, alerts, and recovery procedures

The architecture does not require every new feature to become its own service. The rule is simpler: a responsibility stays in the Portal when it directly depends on the web flow and HESK rules; it moves behind a service boundary when it requires persistent execution, privileged credentials, retries, reconciliation, external-system access, or an independent lifecycle.

Trust boundaries

The current design uses several trust layers instead of treating “internal network” as sufficient authorization.

The browser receives only what it needs for interaction. Integration keys, external API credentials, and agent secrets are not delivered to JavaScript. The Portal validates session, permissions, and CSRF before forwarding operations to internal services.

Those services still enforce their own policy. An authorized Portal button does not mean a mutation will automatically be accepted. Higher-impact operations may require:

  • preview and explicit confirmation;
  • health preconditions;
  • expected state or fingerprint;
  • idempotency key;
  • service or environment lock;
  • post-validation;
  • audit evidence;
  • blockers instead of forced execution.

Another important rule is that unavailable does not mean empty. If an integration does not respond, the Portal does not silently convert missing evidence into “no issue,” “no assignment,” or “no session.” Unknown states remain explicit.

Modules and capabilities

Support and departmental workflows

The help desk remains the foundation of the Portal. Tickets, categories, ownership, status, attachments, history, and communication with users stay compatible with HESK.

Around that core, the platform added maintenance, marketing, internal-service, and other departmental workflows. They reuse session handling, navigation, and shared components while retaining their own fields, permissions, and persistence where appropriate.

Knowledge base with Markdown, Mermaid, and AI

The knowledge base is an important example of modernization without forced migration.

Legacy articles remain in HTML. New content can use Markdown as the canonical source, rendered server-side with CommonMark/GFM, sanitization, and code highlighting. Mermaid diagrams are delivered as locally versioned assets rather than through a CDN, which makes version and deployment behavior controllable.

The editor and viewer share the same rendering pipeline. Code blocks gained copy actions, and diagrams can be opened fullscreen without changing the source content.

AI automation never receives direct database access. An intermediate gateway exposes bounded capabilities for reading, previewing, and controlled writing. The current flow supports search, retrieval, preview, draft creation, append operations, and controlled draft editing within authorized scopes.

Writes use request IDs, content hashes, and audit state. Manually reconciled requests are terminal and are not automatically re-executed by retry. The result is a knowledge base that remains practical for people while also offering a structured and verifiable source for agents.

The detailed architecture is documented in Modernizing a Legacy Knowledge Base with Markdown, Mermaid, and AI.

Devices and assets as a human control plane

The asset area evolved from local CRUD and relationships into a surface that presents technical identity, physical-asset linkage, possession, newly discovered asset candidates, reassociation after reimage, check-in, offboarding, reviews, and operational history.

The Portal did not become the authority for every fact. Device identity, physical assets, and possession remain owned by the appropriate systems. An integration API owns correlation, reconciliation, and write safety; the Portal presents state, blockers, previews, and allowed actions.

The chain is intentionally directional:

Operator intent and bounded integration
01 OperatorAuthorizes an intentional operation.
02 Enterprise Operations PortalPresents the current state, preview, and explicit confirmation.
03 Authenticated integration APIReceives a bounded request with authenticated system credentials.
04 Domain rules and auditApplies policy, reconciliation, and an auditable execution plan.
05 Authoritative systemsReceive only authorized, verified changes.

This allows the UI to become more capable without distributing privileged keys into the web layer.

The authority, idempotency, and reconciliation model is documented separately in Designing a Failure-Safe Device & Asset Integration Control Plane.

Identity and onboarding

The Portal also became part of the corporate identity lifecycle.

A people module maintains the operational employee record and compares that state with the corporate directory. Periodic synchronization imports or links identities in a controlled way, while provisioning operations use a service credential stored outside the repository.

The Portal avoids turning every divergence into an automatic correction. Relevant differences are surfaced for review, and create/update operations remain subject to permissions and validation.

This keeps people administration in the Portal without turning the directory into the master database for every administrative attribute.

ERP service manager

One of the most recent evolutions was bringing a control plane for the Windows services behind the ERP into the Portal.

The implementation uses three boundaries:

Restricted Windows service-management chain
01 OperatorExpresses the requested control operation.
02 PortalSession, RBAC, CSRF, and preview before control.
03 Control APIPolicy, exclusive locks, idempotency, audit, and orchestration.
04 Windows AgentClosed catalog, health checks, and local preconditions.
05 Windows Service Control ManagerPerforms only permitted individual service operations.

The project started read-only, with inventory, state, and probes. It then gained individual preview/apply actions with safety preconditions. Global operations later moved to an asynchronous, auditable model.

The current version also supports selecting multiple services within one operational intent. Independent stops can be triggered concurrently; starts respect dependency waves; global restarts separate the stop phase from the start phase. Critical dependencies that must remain available are treated as prerequisites rather than automatic targets of every global operation.

The Portal tracks progress through steps and counters instead of pretending that a concurrent orchestration has one meaningful “current step.” RBAC also separates the operational surface from administrative audit.

The browser never talks directly to the Agent and never receives Agent keys.

Remote sessions and VPN

The Portal gained dedicated modules for remote-access evidence.

RDP/SSH sessions are queried through a dedicated API and presented with history and detail views. VPN sessions have their own surface, with the ability to relate a VPN connection to remote-session evidence when correlation is sufficiently reliable.

Navigation works both ways: remote evidence can open the related VPN session, and a VPN session can lead to relevant remote-session evidence.

The implementation also went through a privacy review. Sensitive filters are not placed indiscriminately into browser query strings, and deep links use information that does not need to persist in normal server URL logs.

The goal is not to turn the Portal into the source of truth for these events. It acts as an investigation interface over APIs that preserve authoritative collection and history.

Maintenance and ERP integration

The maintenance workflow illustrates another important boundary.

On the Portal → ERP path, work-order creation was hardened to preserve the user’s original text in the Portal and normalize only the copy sent to the ERP. The observation contract gained deterministic markers, reducing fragile free-text parsing.

Authentication was also hardened. Secrets moved out of code; token renewal moved to refresh tokens, file locking, and atomic cache writes; HTTP 401 failures have a single recovery cycle; transport uses TLS; and authentication logs avoid recording tokens or passwords.

The ERP → Portal completion path is architecturally separated from the ERP close operation. The Portal already has an idempotent internal endpoint that can record completion, reply to the ticket, close it, and notify the requester. The integration layer already provides persistence, retry, and asynchronous delivery for those events.

The remaining gate is the final ERP-side emission point: publishing and validating the safe completion event and then executing the full end-to-end acceptance test. For that reason, this study does not present bidirectional completion as fully finished.

Scheduling, reservations, and dashboards

Vehicle reservations, travel, and other scheduling flows have their own availability, date, and conflict rules while sharing the same authenticated entry point.

Dashboards consolidate ticket statistics, integration state, workers, backups, and infrastructure evidence. These views are operational summaries, not replacements for source-system authority.

Persistence, migrations, and staging

The Portal does not force every module into one database.

Each domain with its own lifecycle may maintain a dedicated schema or database while a shared layer resolves configuration and connectivity. The operating rule is simple: each module must know which tables it owns, and an applied migration is not rewritten; a new version is created.

The current database workflow includes:

  • versioned migrations by module;
  • explicit schema-version tracking;
  • rollback when a safe reverse operation exists;
  • selective post-migration snapshots for reproducing state in staging;
  • guardrails that prevent staging from pointing to the production database.

Staging uses an isolated Linux environment in WSL with a compatible web and database stack. Restored snapshots make it possible to reproduce schema problems and validate migrations without running destructive tests against the operational server.

These synchronization snapshots are not treated as a disaster-recovery backup strategy. Backup, restore, and rollback remain separate operational concerns.

Deployment

Production deployment runs through GitHub Actions on a self-hosted runner.

The pipeline preserves local configuration and persistent data, synchronizes the checkout to the approved revision, executes migrations, creates snapshots only for databases that changed, and adjusts permissions only on runtime directories that actually require write access.

The PHP application can usually be updated without restarting the web server. Independent services are restarted only when the change requires it.

This replaced the older pattern of editing production manually and relying on operator memory to know which files, databases, or services required attention.

Observability and audit

The platform now produces evidence across several layers:

  • web and PHP logs;
  • service and worker logs;
  • health endpoints;
  • job state and heartbeats;
  • audit of privileged operations;
  • operation and step history;
  • monitoring of knowledge-base drafts and writes;
  • remote and VPN sessions;
  • deployment and migration results.

An important change was separating presentation state from authoritative operational state. The Portal can show that an operation is pending, blocked, partially complete, or waiting for convergence without duplicating the backend state machine.

This also prevents caches and dashboards from becoming accidental databases.

Security

Modernization added controls without depending on a single barrier.

Current decisions include:

  • reuse the Portal’s authenticated identity and enforce authorization on routes and actions;
  • keep secrets in local configuration outside version control;
  • use server-side proxies for internal APIs;
  • separate read and control keys when an integration requires different privilege levels;
  • apply preview, confirmation, locks, and idempotency before sensitive writes;
  • use closed catalogs in privileged agents instead of accepting arbitrary names or commands;
  • represent unavailable and ambiguous states explicitly;
  • keep tokens and passwords out of logs;
  • preserve persistent files during deployment;
  • keep authoritative systems separate from UI state;
  • review what can appear in URLs, screenshots, and public documentation.

“Internal” is never treated as synonymous with “authorized.”

Results

The main change was not simply adding more screens. The Portal developed a consistent operational language across different domains.

One entry point, multiple authorities

Users work through a common interface while each domain preserves its own authority. The Portal does not need to become the asset master, session collector, service-orchestration engine, or integration state-machine owner to provide a useful operational experience.

Human control over privileged automation

Higher-impact workflows use previews, blockers, confirmation, and audit. Operators remain in the loop without receiving credentials that belong to services.

A knowledge base ready for people and agents

Markdown, Mermaid, drafts, and automation contracts made documentation more reusable without breaking the existing HTML collection.

Infrastructure operations inside the same authenticated context

Service health, individual actions, batch operations, remote sessions, VPN evidence, and integration state can be investigated without distributing administrative consoles or privileged keys to browsers.

More reproducible delivery

Migrations, staging, CI/CD, reproduction snapshots, and runbooks reduced dependence on manual server changes.

No percentage improvement in productivity, availability, cost, or volume is published because those indicators have not been prepared for public release.

Limitations and current gates

The platform still carries real constraints:

  • HESK conventions continue to shape parts of the application;
  • multiple databases require stronger migration, backup, and restore discipline;
  • not every module has the same depth of automated tests;
  • specialized services create dependencies that must degrade without breaking normal Portal pages;
  • some historical HESK configuration still requires extra care during deployment;
  • the ERP work-order completion path still requires its final emission trigger and end-to-end acceptance;
  • the architecture is modular but does not aim for one microservice per screen.

These constraints are explicit because the purpose of the case study is to document real operational engineering rather than an idealized architecture.

Lessons learned

Incremental modernization can be cleaner than a rewrite

Preserving what already works and moving only responsibilities that gained a clear boundary reduced risk while allowing continuous delivery.

The Portal should coordinate decisions, not absorb every state machine

The interface works better when it presents state and intent while specialized services own reconciliation, retries, locking, and external writes.

Preview and idempotency are both UX and safety features

A strong preview reduces human error. Idempotency protects against retries, lost responses, and replay. Together they make sensitive operations more predictable.

“No data” and “backend unavailable” are different states

Turning unavailability into empty state creates false negatives. The UI must preserve uncertainty when the authoritative source did not respond.

Deployment and data belong in the architecture

Schema, configuration, runtime, persistent files, and rollback cannot be designed after the feature is considered finished.

Next steps

The direction remains to separate responsibilities without fragmenting the user experience.

Current priorities include:

  • complete and validate the ERP work-order completion path;
  • expand tests for permissions, migrations, contracts, and partial failures;
  • standardize health, audit, and worker-state reporting across modules;
  • continue evolving the Markdown- and agent-oriented knowledge base with human review;
  • improve backup/restore and rollback exercises;
  • reduce remaining legacy configuration coupling;
  • keep the Portal tolerant of supporting-service outages;
  • measure adoption and operational quality before publishing impact metrics.

Confidentiality statement

This study uses a generic identity and sanitized architecture. It contains no private source code, credentials, addresses, hostnames, internal IDs, users, asset numbers, ticket contents, real database names, certificate material, production screenshots, or operational topology.