Skip to content
AM
← Work

ElectraStock

An inventory automation and consumption-analytics system for PCB manufacturing, built under 48 hours for the Invictus Hackathon covering real-time stock tracking, production-triggered deductions, and procurement forecasting.

2026React·Node.js·Express·PostgreSQL

Problem

PCB manufacturing runs on a fragile link between production and inventory: every unit built consumes a fixed set of components, but most small-scale operations track that consumption manually, a process that's slow, error-prone, and gives no early warning before a shortage stalls a production line. The Invictus Hackathon's problem statement asked for an automated system to close that gap: track component inventory in real time, tie consumption directly to production activity, and surface procurement needs before they become blockers.

Approach

Built the system end-to-end across a time constrained window, prioritizing correctness in the one place it mattered most: the production-entry flow. Recording a production run needs to check every required component's stock, deduct it, and log the consumption atomically, so two simultaneous entries can't both pass a stock check that only one should. I implemented this as a single PostgreSQL transaction with row-level locking (SELECT ... FOR UPDATE) on the affected components, validating availability per component before any deduction runs, and rolling back the entire transaction if any one component falls short. A drop below 20% of monthly requirement automatically raises a procurement trigger in the same transaction, so alerts stay in sync with actual stock rather than a separate scheduled check. On top of that core, I built a bottleneck-analysis feature that calculates, per PCB, the maximum producible units by taking the minimum ratio of available stock to required quantity across its full bill of materials — surfacing the actual limiting component rather than a generic low-stock list. The rest of the system (JWT-authenticated API, Excel import/export for bulk operations, a React dashboard with Recharts visualizations) rounds out ten functional views: inventory, BOM management, production entry and jobs, forecasting, reorder recommendations, consumption history, and component health tracking.

Outcome

The project passed the qualifying round of the Invictus Hackathon, though it didn't place in the final standings. It's a complete, working system with the kind of correctness guarantees (atomic stock deduction, row-level locking) that matter in a real inventory context.