Case study · 03 / 06
AmpereArc Factory ERP
A production-floor ERP for AmpereArc's battery energy storage factory — inventory, overseas procurement, GRN processing, QC inspections, and project material tracking with a six-role permission matrix.
- Running AmpereArc's factory floor daily
- In production
- Permission matrix from admin to technician
- 6 roles
- Trilingual UI — English, Sinhala, Tamil
- EN / සිං / த
- Full audit log of every system action
- Immutable

Context
AmpereArc manufactures battery energy storage systems, inverters, and LV panel boards in-house — cells, enclosures, power electronics, and assemblies. Running that factory means tracking materials from overseas proforma invoice through customs and landed cost, into stores, through QC inspection, and out to specific build projects, with every movement accountable. Spreadsheets and paper GRNs cannot enforce approval chains, role permissions, or an audit trail across that many hands.
I designed and built the entire platform: data model, Firestore security rules, role-based permission system, every module from purchase orders to QC workflows, and the production deployment. It is a single-engineer, full-stack build.
01
Six roles, one permission matrix
The factory has distinct jobs — admin, procurement manager, storekeeper, supervisor, quality engineer, technician — and the system encodes who can do what as a permission matrix rather than ad-hoc checks. Only admins delete records; PO approval sits with procurement; material requests need dual approval from a supervisor and then the storekeeper, with mandatory image proof attached. The same matrix is enforced twice: in the UI and in Firestore security rules, so a bypassed frontend still can't write.
02
Landed cost for overseas procurement
Batteries and power electronics arrive via overseas POs priced in USD, so a GRN's true unit cost isn't the invoice line. The GRN module allocates transport cost proportionally across received items, and the overseas flow computes landed cost from CIF value plus customs duty and CESS at the recorded exchange rate. VAT handling is date-aware — the system switches from 18% to 20.5% on the configured changeover date instead of relying on someone editing a constant.
03
QC as a gate, not a checkbox
Quality inspection sits at both ends of the store: incoming goods off a GRN and outgoing issues to a project each pass through a pass/reject/hold workflow owned by the quality engineer role. Hold is a real state — material can sit quarantined without being either accepted into stock or bounced back to the supplier, which matches how battery cell inspection actually works.
04
Traceability by default
Every inventory item carries QR codes with serial and batch tracking, and a label generator prints scannable tags for the shelf. Underneath, an immutable audit log records every system action — who moved stock, who approved what, when — so disputes resolve from history rather than memory. Analytics sit on top: KPI dashboard, stock-movement trends, and spend analysis from the same Firestore data.
Stack & architecture
- Next.js App Router with React 19 and TypeScript throughout
- Firebase: Authentication, Firestore database, Storage for documents and images
- Firestore security rules mirror the app's role permission matrix server-side
- Radix UI primitives with custom shadcn-style components, Tailwind CSS, dark/light themes
- Recharts for the KPI dashboard and spend/stock-movement analytics
- QR and barcode generation plus printable labels via jsPDF
- CSV/Excel export; drag-and-drop GRN document uploads
- Trilingual UI — English, Sinhala, and Tamil
- Deployed to production behind role-gated authentication
- Next.js
- React
- TypeScript
- Tailwind CSS
- BESS Energy Systems