| Stack | Role | Year | Status |
|---|---|---|---|
| Go, Chi, PostgreSQL, pgx, sqlc, Next.js 14, TypeScript, TanStack Query, Recharts, Railway, Netlify | Lead Systems & Full-Stack Software Engineer | 2026 | Hosted & Operational (Internal Enterprise System) |

Internal Operations & Accountability Platform
Hosted internal enterprise system built with a Go modular monolith, PostgreSQL 16+ and Next.js 14 App Router to centralize asset management, incident reporting, departmental reporting and employee feedback.
An internal operations platform I designed and engineered end-to-end. It gives a company's departments one place to manage assets, report incidents, file weekly reports and collect employee feedback, with permissions, approvals and an audit trail built into the system rather than added afterwards. It includes a controlled Excel ingestion workflow so existing asset spreadsheets can be brought in without corrupting the register.
1. Overview
Most companies run on a quiet web of spreadsheets, chat threads and signed paper. That works until someone asks who has a particular laptop, whether an incident was ever followed up, or whether a weekly report was really approved. This platform replaces that web with one system. Departments register and track assets, staff report operational incidents, managers file and approve recurring reports, and employees give weekly feedback. Every sensitive change is attributed to a person and recorded in an audit trail. I designed and engineered the platform end to end: architecture, database design, the Go backend, the Next.js frontend, authentication and permissions, the asset import workflow, and the production deployment. The business requirements and internal policies it encodes belonged to the organisation. My part was turning them into a system that enforces them. The case study is deliberately sanitised: it describes what the system does and how it is built, not the organisation's records or internal details.
2. Problem and requirements
Before this platform existed, day-to-day internal operations relied on disconnected spreadsheets, messaging threads and manual document sign-offs. Hardware custody and departmental asset transfers were difficult to audit; operational incidents lacked structured triage, deduplication and root-cause tracking; recurring departmental reports had no standardized template or tamper-evident archive; and employee feedback lacked anonymity guarantees. The engineering requirements were clear: consolidate these workflows into a single hosted platform with strict role-based and department-scoped permissions, atomic audit trails for every state transition, durable background job execution and verifiable PDF report archiving.
3. Architecture
The system is architected as a Go modular monolith paired with a Next.js 14 App Router frontend and a managed PostgreSQL 18 database in production (PostgreSQL 16+ for local development compatibility): Browser → Edge/CDN (Netlify) → Backend (Railway) → Managed PostgreSQL 18 Rather than splitting the system into distributed microservices, all operational domains run inside a single Go service with strict package-level boundaries across eight business modules and nine logical PostgreSQL schemas, communicating across domains through typed Go interfaces while sharing a single PostgreSQL transactional engine.
4. Backend implementation
The backend is written in Go using the Chi HTTP router, pgx v5 for connection pooling and transaction management, and sqlc for generating compile-time type-safe data access code from explicit SQL queries. The system is partitioned into eight business modules and nine logical PostgreSQL schemas:
- auth: Stateful session management, authentication, role-based access control (RBAC), and session invalidation on credential or privilege changes.
- org: Organizational hierarchy, departments, teams, user profiles, and department-scoped authorization rules.
- assets: Central asset register, custody tracking, physical inventory cycles, transfer workflows, and condition inspections.
- incidents: Structured incident reporting, severity classification, technical triage, root-cause analysis (RCA), and preventative actions.
- reports: Configurable weekly departmental reporting templates, metric compilation, multi-step approval workflows, and PDF report generation.
- feedback: Structured weekly employee feedback cycles supporting anonymous submissions, small-cohort suppression, and privacy firewalls.
- documents: Document storage metadata, file attachments, and SHA-256 cryptographic digests for tamper-evident archiving.
- jobs: PostgreSQL-backed background job queue and scheduler processing transactional outbox events using SELECT ... FOR UPDATE SKIP LOCKED.
- audit: Dedicated append-only schema storing immutable audit logs recorded atomically with every domain mutation.
5. Frontend implementation
The web client is built with Next.js 14 (App Router), TypeScript, TanStack Query and Recharts. It provides role-scoped operational dashboards showing open incidents, registered assets, active weekly feedback windows and 12-week activity charts. TanStack Query coordinates server-state caching, filter parameterization and deterministic cache invalidation after state transitions (such as approving a departmental report, transferring an asset or resolving an incident).
6. Domain boundaries
Although deployed as a single Go binary, the codebase enforces strict modular monolith boundaries: - Eight Business Modules: auth, org, assets, incidents, reports, feedback, documents, jobs. - Nine Logical PostgreSQL Schemas: Each domain has its own dedicated schema, with the audit schema providing an append-only ledger. - No Cross-Module SQL Joins: Modules never join across schemas. All cross-domain reads and validations execute through strongly typed Go domain interfaces. - Encapsulated Queries: sqlc query definitions and models are isolated within each domain package.
7. Data and transaction handling
PostgreSQL is the single source of truth. A multi-step operation such as an asset transfer updates custody, writes its audit entry and queues any follow-up work inside one database transaction. Either all of it happens or none of it does, so the audit trail cannot drift from the real state of the data. Ordinary records use optimistic concurrency (a version number checked on update) so two people editing the same record cannot silently overwrite each other. Archived departmental PDF reports are stored with a SHA-256 digest so tampering can be detected on retrieval.
8. Deterministic Excel asset ingestion
Asset registers usually start life as spreadsheets, and those spreadsheets are messy. Headers sit on row three instead of row one, columns are named differently from file to file, dates and costs come in mixed formats, and the same asset tag can appear twice. Reading the rows and inserting them would quietly corrupt the register, so the import is a controlled process with a human decision in the middle. It is deterministic: the same file against the same data always produces the same proposed result. What happens to an uploaded file:
- Access and limits: only Super Admins, HR or the head of the relevant department can upload. Files are limited to 15 MB. .xlsx and .csv are accepted; legacy .xls is rejected with guidance instead of being guessed at. The file's SHA-256 checksum is recorded and the original workbook is kept with the batch.
- Interpretation: the importer inspects every worksheet, scans the top rows to find the real header row by scoring them against known header synonyms, and picks the most likely data sheet. Columns are mapped to a fixed set of asset fields. Mappings can be saved as reusable, department-scoped profiles.
- Normalisation: values are trimmed and standardised, and dates and costs are parsed into one format. Values that cannot be parsed become warnings that are reported to the user, not silent guesses.
- Validation: a row without an asset tag, name or category is rejected. A tag that appears twice in the same workbook is rejected as a duplicate. Every physical row is classified as header, empty, valid, warning or error, and the batch records a row-accounting ledger. The totals must add up to the physical row count or the batch is not saved.
- Matching and conflicts: each row is matched to an existing asset by exact tag, then by exact serial number. If the tag points to one asset and the serial number to another, the row is flagged as a conflict and never applied. A matching row with no differences is a no-op, and a blank spreadsheet cell never overwrites an existing value.
- Preview and approval: before anything is written, the user sees what would be created, updated, left unchanged, rejected or flagged, with field-by-field differences and a data-quality score. The uploader cannot approve their own batch, so a second authorised person must confirm it.
- Execution: approved rows are applied in a single database transaction, and any failure means nothing is applied. Only create and update rows are applied; conflicts and rejects are not. A batch cannot be executed twice, and an audit record is written in the same transaction.
- Rollback: each batch stores the previous state of every record it touched, so it can be reversed. A rollback is refused if an imported asset was edited afterwards or has since entered a transfer, disposal, inspection or inventory workflow, so a rollback cannot erase later work.
- Feedback: the user gets a downloadable Excel or CSV outcome report with a summary, the row ledger and the reason for each rejected or warned row.
9. Security and permissions
Internal enterprise systems require fine-grained access control and verifiable accountability: - Role-Based Access Control (RBAC): Enforced at the service boundary with department scoping across all eight modules. - Immediate Stateful Session Revocation: Sessions stored in PostgreSQL are invalidated immediately upon role changes, account deactivation or password resets. - Super Admin TOTP MFA: High-privilege administrative actions enforce Time-Based One-Time Password multi-factor authentication. - Anonymous Feedback Protection: The feedback module enforces an anonymity firewall, stripping user identifiers and applying small-cohort suppression to protect employee privacy in smaller departments.
10. Background processing
Asynchronous tasks—including transactional outbox delivery, notifications, PDF report compilation and recurring weekly reporting deadlines—are managed by a PostgreSQL-backed job processor in the jobs domain. Workers poll the queue using SELECT ... FOR UPDATE SKIP LOCKED, allowing multiple concurrent worker routines to claim available tasks without lock contention or worker starvation. External notification adapters are wrapped in circuit breakers to isolate third-party failures from core application operations.
11. Hosting and deployment
A system is not finished when its pages work. It also has to start correctly, reach its dependencies, keep its data intact and stay observable after a release. The frontend is served from Netlify. The Go API and background workers run as a container on Railway, backed by managed PostgreSQL. Several details matter in production: - Migrations run as a separate pre-deploy step, one transaction per migration, behind a database lock so two deployments cannot migrate at once. If a migration fails, the release is halted and the running version keeps serving traffic. - The application and the migration runner use different database roles. The app role has only the data access it needs, and schema changes need the migration role. - Liveness and readiness endpoints are separate. Traffic moves to a new release only after the readiness check, which verifies the database connection, passes. - The import path has its own unit, integration and acceptance tests, and the project's CI runs Go tests, module-boundary checks, TypeScript checks and frontend tests. No infrastructure identifiers, URLs or credentials appear in this case study.
12. Engineering decisions
1. Why a Modular Monolith over Microservices: Eliminates distributed network serialization, cross-service deployment coordination and distributed transaction complexity while package encapsulation and zero cross-module SQL joins preserve clean domain boundaries. 2. Why sqlc and pgx v5: Compile-time SQL verification eliminated runtime query binding surprises and kept database performance predictable without ORM abstraction leaks. 3. Why PostgreSQL-Backed Job Queue with FOR UPDATE SKIP LOCKED: Using PostgreSQL for both relational state and durable job queuing eliminated dual-write consistency bugs and avoided the operational overhead of an external message broker.
13. Technology stack
Backend: Go, Chi HTTP router, pgx v5, sqlc, PostgreSQL 18 (production) / PostgreSQL 16+ (local development), Modular Monolith architecture. Frontend: Next.js 14 App Router, TypeScript, TanStack Query, Recharts. Security & Operations: Stateful session authentication, RBAC, department-scoped permissions, TOTP MFA, atomic append-only audit logging, SHA-256 document integrity verification, transactional outbox, FOR UPDATE SKIP LOCKED worker queue, circuit breakers, Netlify, Railway.
14. My contribution
I architected, implemented and deployed the platform end to end. That covers the PostgreSQL schema and domain boundaries, the Go backend, the authentication, role and department permission model, the approval and audit mechanisms, the deterministic Excel ingestion workflow, the Next.js frontend across all modules, and the production deployment and verification. What I did not own was the organisation's side: which departments exist, what policies the approvals should enforce and how staff were onboarded were decisions for the organisation. I translated those requirements into software and made the engineering decisions needed to enforce them.
Key Technical Terms
- Enforced Modular Monolith (8 Modules, 9 Schemas):Each business domain (auth, org, assets, incidents, reports, feedback, documents, jobs) is encapsulated in its own Go package with an independent PostgreSQL schema, alongside a dedicated audit schema. Cross-domain interactions occur strictly through typed Go service interfaces with zero cross-module SQL joins.
- Transactional Outbox & Worker Queue (FOR UPDATE SKIP LOCKED):Domain mutations and outbox events commit in the same PostgreSQL transaction. Background workers poll and claim jobs using SELECT ... FOR UPDATE SKIP LOCKED, preventing lock contention and race conditions without an external message broker.
- Optimistic Concurrency & Append-Only Audit Trail:Mutable business entities use optimistic concurrency control to prevent conflicting edits, while state mutations write immutable audit records to the audit schema within the same transaction.
Go Monolith
Modular monolith with Chi, pgx v5 and sqlc
PostgreSQL 16+
ACID state, append-only audit log and transactional outbox
RBAC + TOTP
Department-scoped permissions & stateful session revocation
SHA-256
Cryptographic integrity verification for archived PDFs
Key Engineering Takeaways
A well-structured Go modular monolith with sqlc and PostgreSQL gives internal enterprise systems strong compile-time guarantees and simpler operations than premature microservices.
For internal systems where permissions change, stateful sessions with immediate server-side revocation are safer than stateless tokens.
Pairing domain mutations with an append-only audit log and transactional outbox inside a single PostgreSQL transaction guarantees that audit trails and background jobs never drift from database truth.
Importing a spreadsheet is a data-integrity problem, not a parsing problem. Preview, approval and a guarded rollback let people trust what enters the register.
Project Gallery
