Golden Vats Inventory
Offline-first procurement and stores software for a site with no server room.
Overview
Golden Vats Inventory is an offline-first desktop application for a manufacturing-style operation. Departments raise material requests, purchasing turns them into orders, stores receive and issue material, and every movement carries an audit trail. It runs on a single SQLite file on the client machine, with no server to maintain.
Business context
Departmental procurement is mostly a paper trail: an indent from a department, an approval, a purchase order, a goods receipt, an issue to production, and a statement at month end. When the trail is paper, the closing stock figure is an opinion rather than a calculation.
The site has no server room and no IT staff. The application has to live on one Windows PC, survive being switched off mid-entry, and be restorable from a backup by someone who is not a database administrator.
Both constraints point the same way: a local database with strong rules of its own, packaged as an application a non-technical user can double-click.
Problem statement
- Requests, purchasing, receiving and issuing must form one chain with no re-typing between stages.
- Stock quantity, value and department-wise consumption have to reconcile without a spreadsheet.
- Every correction needs a reason and an author, because stock disputes are arguments about history.
- The install must be a packaged application with a local database that can be backed up and moved.
- Upgrades must not destroy data on an installed machine.
Solution overview
An Electron shell with a React and TypeScript renderer. The Electron main process owns the database and the filesystem; the renderer talks to it over typed IPC channels and never touches SQLite directly.
The schema is applied through numbered migrations with a version table, so an installed client can be upgraded in place. Audit rows and immutability rules are enforced by database triggers, which means they hold even when a code path forgets them.
Documents are part of the product: indents, vouchers, receipts and reports have print templates, because paper still leaves the building.
Core modules & workflows
Departments & requests
- Department master and official department list
- Material indent forms
- Approval and status tracking
- Project-wise request lines
Purchasing
- Purchase orders and line items
- Indent vouchers
- Supplier records
- Purchase history
Stores
- Goods receipt and issue
- Returns and adjustments
- Stock ledger with opening and closing balances
- Department-wise issue history
Financial control
- Financial year handling
- Historical opening balances
- Valuation
Documents & reports
- Printable orders, vouchers and receipts
- Department report
- Audit report
- Stock and consumption reports
Operations
- Google Drive backup (implemented, unverified)
- Licence activation
- LAN mode for multiple machines
System architecture
Electron main process owns the SQLite database, file system access and backup; the renderer has no direct database access.
React and TypeScript renderer, typed IPC channels between renderer and main process.
SQLite: 42 tables, schema applied through 18 numbered migrations, 19 unique triggers guarding audit and immutability.
Vitest suite: 22 files, 204 tests passing at last run, executed against a temporary database built from the migrations.
Packaging produces a Windows installer and a portable build. Licence tooling generates and validates activation keys.
Technology stack
Electron shell, React and TypeScript renderer, SQLite owned by the main process, Vitest for verification. There is no server component at all — that was the point.
Engineering decisions
Migrations, not a schema file
Numbered migrations with a version table let an installed client upgrade in place. Foreign key enforcement is suspended only for the duration of a migration that needs it, then restored.
Triggers own the audit trail
Audit and protection rules live in SQLite triggers rather than application code. On a single-developer codebase that guarantee matters more than the small overhead.
Offline-first, one file
A single database file is easier to back up, copy between machines and reason about than a server install. The backup feature copies that file off the machine.
The documents are the product
Indents, vouchers, receipts and reports leave the building every day. Their templates were designed and tested as features, not generated at the end.
Tests run the real migrations
The suite builds a temporary database by applying migrations, so a schema change is exercised the same way a client upgrade would be.
My contribution
Mine. Workflow model, schema, migration strategy and the audit rules.
AI-assisted. Feature code developed with AI assistance against written specifications, reviewed and corrected module by module.
Mine in design and review: 204 tests across 22 files covering migrations, workflows, documents and reports.
Mine. Electron build, portable release and the licence activation tooling.
Challenges
Upgrading without losing data
A client machine may hold years of movements. Migrations run inside a transaction with foreign keys temporarily suspended, and the version table makes a partial upgrade visible instead of silent.
Making corrections legitimate
Adjustments are not edits. They are new movements with a reason, an author and a timestamp, and the trigger layer blocks the shortcut.
Testing an Electron application properly
The database and business rules were kept out of the renderer so the suite can test them directly, without driving a UI. That is why 204 tests run in about ninety seconds.
Shipping to a site with no IT staff
Installer, portable build, backup path and licence activation all had to work without a technician on the phone.
Verified results
- 204 tests pass across 22 files at last run. Developer-run Vitest suite, not a CI pipeline.
- 42 tables, 18 migrations and 19 triggers in the shipped schema.
- Packaged Windows installer and portable build are ready for installation.
- No client production deployment has happened yet.
Status & limitations
- Google Drive backup is implemented but has not been verified against a real client account.
- LAN mode for multiple machines on one database is implemented but not verified in production.
- Installation at the client site is pending, so there is no production usage to report.
- Licensing tooling works; commercial terms are still being settled.
- Single-developer project.
Additional screenshots