~/dev.jaspreetsingh
Full-Stack

Multi-Tenant ERP — Label Manufacturing

Production-grade multi-tenant ERP for label manufacturers — real-time order management, automated production scheduling, and machine load balancing across multiple companies and locations.

Next.jsTypeScriptSupabasePostgreSQLSentry
↗ Live Demo

Problem

Label manufacturers operating across multiple locations had no unified system — production orders were tracked in spreadsheets, machine scheduling was manual, and there was no real-time visibility into order status or capacity.

Solution

A multi-tenant ERP where each company and location is fully isolated. As a production order comes in, the system auto-schedules it based on current machine load — no manual dispatch needed. Role and permission-based access ensures each user sees only what they're authorised to. Built through many iterations to get the scheduling logic and data model right.

System Architecture

Next.js App Router frontend and API routes. Supabase for database, auth, realtime subscriptions, and storage. Tight Row Level Security policies in PostgreSQL ensure complete tenant isolation — no cross-company data leakage is architecturally possible. Webhooks for external integrations. Sentry for error tracking and alerting. Bot protection on all public-facing endpoints. CSV export for reporting.

# system diagram

Company A / Company B (isolated tenants)

└─ Next.js App Router (UI + API)

├─ Supabase Auth → role + permission check

├─ PostgreSQL + RLS → tenant-scoped data

├─ Auto-scheduler → machine load balancing

├─ Supabase Realtime → live order board

└─ Sentry → error tracking + alerts

DevOps & Deployment

Deployment

Vercel (frontend + API) · Supabase (DB + auth + realtime + storage)

CI/CD

GitHub Actions — lint → type-check → build → deploy

Challenges

Designing the automated production scheduling engine that accounts for machine load, order priority, and shift availability — and making it reliable enough that operators trust it over manual scheduling. Went through multiple iterations of the scheduling algorithm and data model before it was production-ready.

Key Learnings

Row Level Security in Postgres is the right foundation for multi-tenant SaaS — but it requires careful, systematic policy design. Realtime subscriptions via Supabase made the live order board possible without any custom WebSocket infrastructure.


BookDrive — UK Driving License Prep PlatformTrainEasy Web — Health & Measurements Tracker

Have a project in mind? Let's talk.

Open to full-time remote roles, freelance projects, and interesting collaborations. I'll get back within 24 hours.

new-message.md