Skip to content

Repository files navigation

ArrowTech ERP

A multi-tenant ERP built for wristband & badge manufacturing businesses — sales, design proofing, print-floor production, inventory, and Saudi VAT/ZATCA-ready accounting, all in one system, with the software wired directly into the printers making the product.

CI Next.js Supabase TypeScript License Stars Follow


Why this exists

Most ERPs stop at the browser. A wristband/badge print shop's real bottleneck is the floor: a job approved in the office has to become a correctly-labeled TSPL/ZPL print job on the right physical printer, with no double-prints and no lost jobs if a machine reboots mid-batch. ArrowTech ERP owns that whole chain — quote → design proof → client e-signature → production queue → physical label — instead of stopping at "order created."

Modules

Module What it does
Sales & CRM Leads, customers, orders
Design & Proofing Upload design proofs, client approval via signed public link + e-signature
Production Realtime job queue dispatched straight to shop-floor printers
Inventory Stock movements and levels
Accounts Invoicing with Saudi VAT / ZATCA-compliant tax math
Memos & Tasks Internal comms and task assignment
SEO Marketing campaign tracking

Every module is scoped by role (admin, sales, designer, production, accounts, seo) through three independent layers: sidebar nav filtering, a server-side requireRole() guard on every route, and Postgres Row-Level Security on every table — so access control isn't just a hidden link.

Architecture

flowchart LR
    subgraph Browser
        UI[Next.js App Router UI]
    end
    subgraph Server["Next.js Server (Vercel)"]
        RSC[Server Actions / Route Handlers]
        Auth[requireRole guard]
    end
    subgraph Supabase
        PG[(Postgres + RLS)]
        RT[Realtime]
        ST[Storage: design proofs]
    end
    subgraph Floor["Shop floor PC"]
        Agent[Print Agent - Node.js]
        Printer[[TSPL / ZPL printer :9100]]
    end

    UI -->|Server Actions| RSC --> Auth --> PG
    UI -->|public proof link| ST
    PG -- production_jobs --> RT
    RT -- job dispatched --> Agent
    Agent -->|TCP 9100 / Windows spooler| Printer
Loading

The print agent is a standalone Node.js service that watches production_jobs over Supabase Realtime and streams TSPL/ZPL label commands straight to the printer — it auto-reconnects, reconciles jobs missed while offline, and resumes a batch left mid-print after a crash.

Tech stack

  • Framework: Next.js 15 (App Router) + React 19, TypeScript
  • Backend: Supabase (Postgres, Row-Level Security, Realtime, Storage, Auth)
  • Styling: Tailwind CSS v4
  • Print floor: standalone Node.js agent, TSPL (BAOBI) / ZPL (Zebra) over TCP or the Windows spooler
  • Testing: Vitest (unit + multi-tenant RLS integration), Playwright (E2E), a realtime-dispatch perf benchmark
  • CI: GitHub Actions — typecheck, unit, integration (against a real local Supabase stack), E2E, and perf, on every PR

Getting started (local dev)

git clone https://github.com/abdullahwaseem-dev/arrowtech-wristband-erp.git
cd arrowtech-wristband-erp
npm install
cp .env.local.example .env.local   # fill in your own Supabase project's keys
npm run dev

Runs against placeholder credentials by default. For a real Supabase project, staff logins, and going live, follow docs/mvp-setup.md end to end — it covers schema migrations, auth settings, bootstrapping the first tenant, and deployment.

Tests

npm run test:unit          # Vitest, no DB required
npm run test:integration   # RLS / tenant-isolation, needs a local Supabase stack
npm run test:e2e           # Playwright, full workflow
npm run test:types         # typecheck the test suite itself

Project structure

app/                  Next.js App Router: (dashboard) module routes, auth, public proof pages
components/            UI components, grouped by module (sales, design, production, accounts, ...)
lib/                  Auth guards, Supabase clients, invoicing/VAT math, nav config
supabase/migrations/  Schema, RLS policies, triggers — applied in filename order
print-agent/          Standalone shop-floor printer service (see its own README)
scripts/              Tenant/user bootstrap scripts (service-role only, run from your own machine)
tests/                Unit, integration, and E2E suites
docs/                 Setup and deployment guides

Status

Actively developed. Sales/CRM and Accounts have RLS policies and nav entries in place; dedicated UI for both is next. See the "What's still a gap" section of docs/mvp-setup.md for the current punch list.

Get the full package

This repo is the software half. If you run a wristband, badge, or label production business and want the complete package — RFID/paper wristband stock, TSPL/ZPL label printers, and this ERP deployed and supported for your operation — get in touch:

📧 maw112266@gmail.com

Support this project

If this is useful or interesting to you, a ⭐ on the repo and a follow genuinely help it reach more people:

Star this repo Follow @abdullahwaseem-dev

License

Proprietary — all rights reserved. This repo is public for demonstration purposes; it is not open source. See LICENSE, or reach out at the email above for commercial licensing.

About

Multi-tenant ERP for wristband & badge manufacturing — sales, design proofing, realtime print-floor dispatch, inventory, and Saudi VAT/ZATCA accounting.

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages