< all projects

ORRN

Multi-tenant ERP for aluminum extrusion plants: dies, bundles, stock, label printing, dispatch, and an audit trail.

status
Live
role
Founder-engineer
when
2025 to now
kind
Manufacturing ERP
the TSPL2 that prints this label
SIZE 101.6 mm, 50.8 mm
GAP 3 mm, 0 mm
DIRECTION 1
CLS
TEXT 32,28,"4",0,1,1,"ORRN"
TEXT 32,92,"2",0,1,1,"Manufacturing ERP"
TEXT 32,124,"2",0,1,1,"2025 to now"
BARCODE 32,196,"128",120,0,0,1,2,"https://ansh.bhalala.org/projects/orrn"
PRINT 1,1

ORRN is the fifth version of an ERP I've been building since 2022 for an aluminum extrusion plant. Earlier versions were for one plant. ORRN is multi-tenant, so other plants can run on it.

What it does

Plants track dies, extruded bundles and receipts, stock, dispatch, and customers. Every bundle gets a label printed through orrn-spool, and every change lands in an audit trail.

How it's built

  • Bun and Turborepo monorepo. Vite, React, and TanStack Router and Query on the web.
  • Expo React Native apps for iOS, iPadOS, and Android, sharing a Tamagui design system with the web.
  • tRPC end to end, served by Hono on Cloudflare Workers, with D1 and Drizzle underneath.

Decisions I made, and why

  • Tenant isolation lives on the server. The API derives companyId from the session. A client can send whatever it likes; it never gets read.
  • One permission matrix. The same table drives the server middleware and the client's <Can> components, so the UI can't drift from what the API allows.
  • Impersonation is time-boxed and audited. Support can see what a user sees, for a limited window, and that session is recorded.

What's next

The Workers and D1 version reached its milestones, and then the plant floor asked for things it can't do well, such as working through an internet outage. I'm rebuilding around ISA-95: a Postgres core with row-level security per tenant, and a box in each plant that runs offline and talks MQTT to the machines.

Built with

  • Bun
  • Turborepo
  • React
  • TanStack Router
  • Expo
  • Tamagui
  • tRPC
  • Hono
  • Cloudflare Workers
  • D1
  • Drizzle