Skip to content
All projects

Case study · 2026 to present · Anonymized

Digital life record of the metering system at energy trading points

I digitized the official 18-section form that keeps the life record of every energy trading point. Each change is captured in a draft, reviewed and published as a version with its official PDF.

Areas

  • Backend
  • Frontend
  • Data and BI
  • Infrastructure
A metering point's record: how complete the sheet is, the sections of the form and the equipment, with the draft change at the bottom (fictitious points, people and data in this capture).

Project facts

Role
Full-stack engineer, sole developer (requirements, architecture, backend, frontend, database, deployment)
Period
Sep 2026 to present
Technologies
React · TypeScript · Vite · Tailwind CSS · TanStack Query
Public links
Internal system: the code is private, and names, data and diagrams were left out or recreated.

At a glance

Each metering point kept its life record on paper, and every site visit or equipment change meant filling in the official form again.

  • 950+

    automated test cases across unit, integration, end-to-end and accessibility suites

    Source: Vitest and Playwright suites in the repository, October 2026

  • 13

    architecture decisions documented in five weeks

    Source: Architecture decision records (ADR) in the repository, September and October 2026

  • 60

    commits between kickoff and the test deployment

    Source: Git history, September 22 to October 28, 2026

The problem

Every energy trading point must keep an up-to-date life record of its metering system, in an official 18-section form with hundreds of numbered fields. It was filled in on paper. Every visit, calibration or meter or modem change meant redoing it, and the history of equipment and seals was spread across documents.

  1. Before:Every change in the field was copied by hand onto the paper form.

    After:Each change is captured in a draft, reviewed field by field and published as a new version.

  2. Before:Finding out what the record said before a change meant searching through documents.

    After:Every published version is frozen and can be compared with any other.

  3. Before:Removed equipment and seals got lost between sheets.

    After:Equipment and seals are removed with a date and keep their history; a seal can be found by its serial number.

  4. Before:The official PDF was put together by hand.

    After:The PDF and Word file of each version come out with the official form structure and numbering.

The solution

My role

Full-stack engineer, sole developer (requirements, architecture, backend, frontend, database, deployment)

  1. I gathered the requirements with the metering team and took the ambiguities of the official form, including its numbering errors, to a decision log for the business owners.

  2. I designed the layered architecture and built the API, the client, the SQL Server data model and the document generator.

  3. I integrated corporate sign-in with roles and the invitation of external users as guests.

  4. I turned the company's brand manual into a design system with tokens and lint rules, and built pixel for pixel the sign-in page the project lead designed in Figma.

  5. I documented 13 architecture decisions and the deployment, restore and secret rotation runbooks, and left the app in a test deployment with Docker.

Constraints

  • The official form rules. Its structure and numbering, errors included, do not change without a decision from the business owners.

  • A database shared with other company systems. The app lives only in its two schemas, with least-privilege users.

  • Nothing published is deleted. Traceability of every record is a requirement.

  • Records carry personal data of the designated person, with a right to erasure.

  • Internal users sign in with their corporate account and external operators come in as guests.

Decisions

  1. Every edit happens inside a draft change

    Each edit lives in a draft with its change type, is reviewed with its old and new value, and publishing it stores a snapshot of the whole record with its SHA-256 fingerprint. Earlier versions never change, and two versions are compared without rebuilding anything.

    Ruled out

    • Edit the record in place and keep a per-field change history
  2. A section registry instead of one hand-written screen per section

    Each section declares its contract, its fields and how it is assembled into the record. The assembler, the review, the completeness score and the PDF all come from that registry, so adding a section does not touch the change workflow.

    Ruled out

    • A hand-written form and endpoint for every section
  3. The PDF is HTML printed by an offline Chromium

    The template reproduces the official form in HTML, and a background job prints it with a browser that has no network and no JavaScript, so nothing a record carries can reach the internet. The Word file comes from the same structure.

    Ruled out

    • Draw the PDF by coordinates with a PDF library
  4. What must never be deleted is denied in the database

    Insert-only tables, such as versions, changes and the audit log, deny UPDATE and DELETE to the app's user. A new table of that kind must add its permission in the same migration, and the script that copies the schema refuses to run if one is missing.

    Ruled out

    • Rely on application code alone

Architecture

The browser talks to a Node.js API that validates every input, authorizes by role and stores everything in SQL Server. A background worker generates the PDF and Word file of each version and handles attachments, and sign-in goes through Microsoft Entra ID.
  1. 01Users

    • Web appReact, per-section forms and change review
  2. 02Services

    • REST APIExpress, Zod and an OpenAPI contract
    • WorkerPDF, Word and attachments in the background
  3. 03Data

    • SQL ServerTwo schemas of its own, least-privilege users
    • Attachment storeFiles outside the database, with their SHA-256
  4. 04Integrations

    • Microsoft Entra IDRoles and external guests
    • Offline ChromiumPrints the official form

How data moves

  1. Web apptoREST APICaptures, reviews and publishes changes
  2. REST APItoSQL ServerStores changes and versions
  3. REST APItoMicrosoft Entra IDChecks the session and role
  4. WorkertoSQL ServerPicks up queued jobs
  5. WorkertoOffline ChromiumRequests the PDF of each version
  6. WorkertoAttachment storeStores documents and attachments

Results

  • The app runs in a test deployment on the company network, with corporate sign-in, while the business owners validate the form's rules.

  • Every published version generates its PDF and Word file with the official form structure and numbering, and the list of metering points exports to Excel.

  • The views pass automated accessibility tests with axe at 1280, 768 and 360 pixels, and a lint rule enforces AA contrast for every color pair.

What I would do differently

  • I would have asked the business owners earlier for the decisions that block whole sections, such as the meters, instead of moving ahead on provisional decisions.

  • I would have set up a containerized database as the only test database from day one, so tests never shared data with the test deployment.

Technologies

  • TanStack Query
  • Kysely
  • SQL Server
  • Microsoft Entra ID
  • Microsoft Graph
  • Playwright
  • WCAG 2.2