SYSTEM: LOCALHOST // PATH: ~/projects/autotaskx
INDUSTRIAL TEXTILE OS & ENTERPRISE ERP INTEROPERABILITY GATEWAY
Architected an end-to-end industrial software ecosystem combining Textile OS—a high-density, multi-window web operating environment engineered in Next.js 16 and React 19—with a high-throughput enterprise integration gateway built in FastAPI (Python 3.12, AsyncIO). Backed by PostgreSQL 16, TimescaleDB hypertables, and Redis 7.2 Pub/Sub, the platform unifies mathematical dye formulation (Kubelka-Munk NNLS), 8K optical inspection (ASTM D5430), sub-second jet vessel telemetry, and real-time bi-directional synchronization across SAP S/4HANA, Datatex NOW MES, and Infor ION.
RESTRICTED ACCESS: If you wish to explore the full source code, review private production modules, or schedule a technical walkthrough, please contact me directly on WhatsApp: +8801771659336.
I designed and developed AutoTaskX to solve this by directly bridging the gap between advanced academic research and mission-critical vertical textile manufacturing operations. The platform replaces isolated terminals and physical clipboards with an industrial multi-window operating system, synchronized in real time with enterprise ERP backbones and high-speed dyeing vessels.
The genesis of AutoTaskX was highly unconventional. The client approached me not with traditional software wireframes or product specification documents, but with an exhaustive, in-depth academic thesis. This thesis was authored by a brilliant student and researcher at the Bangladesh University of Textile Engineering (BUTEX).
The core of the research focused on predicting exact dye formulations via complex non-linear optical equations, and automating fabric defect grading using high-speed optical physics. To accurately translate this vision into reality, I collaborated closely with a highly professional researcher from BUTEX.
My primary objective was to master these concepts—spending 20 intensive days studying textile chemistry, spectrophotometric reflectance, and ASTM grading standards—and architect a scalable software infrastructure that could execute this academic theory in real-time on a production factory floor.
AutoTaskX operates as a synchronized industrial pipeline. The browser-based Textile OS client interfaces over persistent WebSockets with an asynchronous FastAPI microservices tier, which orchestrates time-series telemetry persistence, computational colorimetry solvers, and bidirectional transactional gateways into corporate ERP ledgers.
Textile OS Multi-Window Desktop Engine · Spectro Formulation Studio · 8K Fabric HUD · Vessel Telemetry Monitor · Shift Logbook · Unix Virtual File System (VFS)
Sub-25ms WebSocket Connection Manager · Asynchronous Task Queues · Token Bucket Rate Limiters · AST-Constrained SQL Parser · Mutual TLS 1.3 / AES-256-GCM
ACID State Persistence · Row-Level Pessimistic Locking (`with_for_update`) · Automated Chunk Compression for 124ms PLC Sensor Streams & ASTM Defect Passports
Shopfloor-to-Ledger Bi-Directional Synchronizer (SAP MM, SAP QM, SAP PP) · Bangladesh Multi-Association Verification Engine (BTMA, BGMEA, BKMEA, DIFE)
Industrial PLC Modbus/TCP relays · Automated Take-up Doffer Cut Solenoids · Chemical Valve Actuators · 8K GigE Optical Line-Scan Cameras
Textile dyehouse control rooms suffer from extreme software and hardware fragmentation. Operators juggle physical clipboards, detached machine dial gauges, legacy spectrophotometer desktop software, and isolated inspection perches. This manual friction causes shift-handover delays, uncalibrated batch dosing, and delayed defect mitigation.
Architected Textile OS—a purpose-built, high-density web operating system engineered with Next.js 16 and React 19 specifically for mill control room touchscreen consoles and desktop workstations.
Engineered a full desktop window management layer supporting concurrent industrial applications. Features dynamic Z-index stacking coordinates, smooth pointer-captured dragging, edge-boundary resizing with aspect-ratio locking, window minimization to the system taskbar, and persistent desktop layout state across operator browser sessions.
Structured on a Unix-standard path convention (`/home/operator/Desktop`, `/Documents`, `/Recipes`). Supports asynchronous file creation, batch recipe storage, ASTM quality passports, and operator-level permissions, interfacing directly with mill persistence backends without requiring external operating system privileges.
Enforces mill-isolated session guards (`mill_id`), persistent session restoration, and live hardware node status telemetry. Displays active node connectivity, buffer saturation rates, and sub-20ms PLC polling health directly in the system status tray.
Centralized configuration console for hardware link credentials, cryptographic cipher negotiation, and operator node privileges. Connects direct sensor streams to front-end visualization canvases with requestAnimationFrame rendering loops to avoid UI jank.
Ingests raw spectrophotometer spectral curves, computes perceptual CIEDE2000 tolerances (ΔE00), and dispatches automated dosing formulations to chemical dispensers.
Real-time fabric inspection HUD capturing warp/weft defects at 60 m/min, linking penalty scores directly to sub-25ms automated take-up doffer cut relays.
Real-time sensor stream curves tracking temperature, pressure, pH, and liquor ratios with sub-second alerting and historical hypertable trend comparison.
Structured digital logbook capturing shift handovers, operator overrides, chemical batch numbers, and audit events saved directly to `/home/operator/Documents/ShiftLogs`.
Operator node credentials management, Mutual TLS cipher validation, and live PLC/SCADA connection health monitoring.
Physical dyehouse hardware (automated chemical dispensers, stenter perches, and high-pressure jet vessels) traditionally operates in complete isolation from enterprise management systems (SAP, Datatex, Infor). Plant accountants and supply chain managers rely on manual, end-of-day clipboard data entry, resulting in massive stock discrepancies, unaccounted chemical waste, and delayed shipment approvals.
Designed and implemented a high-performance, asynchronous integration gateway powered by FastAPI (Python 3.12, AsyncIO) that serves as the bi-directional intelligence bridge between physical shopfloor machinery and corporate ERP ledgers.
Employs asynchronous FastAPI background workers to automatically debit chemical stock (reactive dyestuffs, sodium hydrosulfite, soda ash) the millisecond automated dispensers release raw batches, eliminating inventory drift and eradicating manual transcription errors.
Generates and streams cryptographic roll passports with Grade A/B/Reject status directly into enterprise Quality Management inspection lots upon perch completion. Eliminates quarantined warehouse bottlenecks by enabling real-time commercial dispatch.
Streams high-frequency, 124ms isothermal cycle curves, cooling ramp rates, and batch execution receipts into central enterprise production planning modules, ensuring exact utility accounting and line balance synchronization.
MULTI-PROTOCOL GATEWAY HUB
STATUTORY INDUSTRIAL COMPLIANCE ENGINE
Implemented an intelligent compliance verification layer specifically tailored for Bangladesh’s export-oriented textile ecosystem:
Handling Extreme Domain Ambiguity
The Challenge: Requirements were rooted in a dense 150+ page BUTEX academic thesis containing chemical kinetic equations, spectrophotometer physics, and international textile standards (ASTM, ISO, AATCC).
The Solution: Dedicated 20 full days solely to deep academic domain research. Mastered optical reflectance spectroscopy, Kubelka-Munk theory, and jet dyeing mechanics to break down complex theory into maintainable software microservices.
Translating Optical Physics into Matrix Math
The Challenge: Matching target shades requires combining multiple dyes such that their combined absorption curve matches 31 individual wavelengths (400nm to 700nm), ensuring concentrations aren't negative.
The Solution: Formulated the problem as a Non-Negative Least Squares (NNLS) matrix optimization using `scipy.optimize.nnls`. The system computes exact dye concentration vectors in under 15 milliseconds and includes CIEDE2000 evaluation.
Real-Time Edge Computer Vision & WebSockets
The Challenge: Defect events from 8K cameras arrive in bursts at 60 meters/minute line speeds. Naive WebSocket servers and concurrent database writes lead to corrupted scores and desynced UI HUDs.
The Solution: Implemented an async WebSocket manager backed by a Redis Pub/Sub backplane to sync all HUDs instantly. Used PostgreSQL pessimistic row locking (`with_for_update`) to guarantee ACID consistency when calculating ASTM cut-plans.
AST-Constrained Text-to-SQL
The Challenge: Managers wanted to ask natural language questions (e.g., "Show me yesterday's high temp batches"). Deploying raw LLMs for SQL generation risks accidental data deletion and SQL injections.
The Solution: Built a 4-stage safety pipeline: Intent extraction, AST parsing via `sqlglot`, strict read-only enforcement (blocking DDL/DML), and whitelist verification scoped only to safe production tables.
High-Frequency Multi-Window Control Room Rendering
The Challenge: Concurrently displaying 8K defect inspection canvases, live Fong's PLC thermal curves, and spectrophotometric formulations across multiple draggable windows caused UI micro-stutters and high CPU overhead on shopfloor workstations.
The Solution: Engineered a decoupled rendering architecture in Next.js 16 and React 19. Telemetry data is buffered via WebSockets and flushed to visual canvas components using `requestAnimationFrame`, preventing DOM re-render thrashing while preserving 60fps window dragging and stacking.
Distributed Bi-Directional ERP Transactional Consistency
The Challenge: Transient network partitions between mill-floor dispensing valves and corporate SAP/Datatex servers risked double-debiting raw dye inventory or dropping batch consumption receipts.
The Solution: Architected a Transactional Outbox pattern in PostgreSQL 16 managed by asynchronous FastAPI background workers. Every dispensing event writes an immutable dispatch record; background workers poll outbox tables using idempotent transaction keys and exponential backoff retry policies.
| DIMENSION | TRADITIONAL APPROACH | AUTOTASKX IMPLEMENTATION |
|---|---|---|
| Color Formulation | 3–5 manual lab dips taking 24–72 hours; visual subjective matching. | Kubelka-Munk NNLS matrix solver across 31 spectral wavelengths (400–700nm) in <15ms. |
| Color Tolerance | Simple RGB/HEX distance or legacy CIE76 (inaccurate for human eye). | Comprehensive CIEDE2000 (ΔE00) + Multi-illuminant metamerism indexing (D65, TL84). |
| Quality Inspection | Human inspector on manual perch; optical fatigue; 20-30% missed defects. | 8K GigE line-scan ingestion, sub-25ms ASTM D5430 grading, automated cut relay. |
| Machine Telemetry | Handwritten operator logs; disconnected machine dial gauges. | Sub-second PLC telemetry ingestion (Fong’s, Thies) into TimescaleDB hypertables. |
| Control Room UX | 4+ disconnected hardware terminals, legacy desktop software, paper clipboards. | Next.js 16 / React 19 Textile OS multi-window desktop with Unix VFS and status telemetry. |
| ERP Inventory Sync | End-of-day clipboard entry into SAP; unaccounted chemical drift & stockouts. | FastAPI asynchronous background workers auto-debiting SAP MM & Datatex Dyes at batch release. |
| Inspection Lots (QM) | Physical paper grading slips stapled to finished fabric rolls. | Cryptographic ASTM roll passports auto-streamed directly into SAP QM inspection lots. |
| Multi-Worker Sync | Single-node in-memory WebSockets (fails when scaled across containers). | Distributed WebSocket connection manager with Redis Pub/Sub cluster backplane. |
| Database Concurrency | Naive read-then-write (causes race conditions and corrupted roll scores). | Pessimistic row locking (`with_for_update`) ensuring atomic penalty accumulation. |
| Query Safety | Raw LLM Text-to-SQL (vulnerable to prompt injection & drops). | 4-stage AST parsing with sqlglot, whitelist enforcement, read-only sandboxing. |
| Statutory Compliance | Manual paper binder audits across trade associations taking days. | Automated verification engine cross-checking BTMA, BGMEA, BKMEA, and DIFE registries. |
In AutoTaskX, 8K line-scan inspection cameras stream fabric defect events at speeds up to 60 meters per minute. To solve concurrent writes (multiple defect events arriving simultaneously), I utilized PostgreSQL pessimistic row locking (`with_for_update`) within SQLAlchemy AsyncSession to ensure atomic score accumulation. For real-time HUD synchronization across multiple Docker container instances, I implemented a distributed WebSocket manager with a Redis Pub/Sub backplane. Any worker processing a defect publishes to Redis, instantly updating all connected operator HUDs with sub-25ms latency.
Executing LLM-generated SQL on production machinery databases is dangerous. I built a 4-stage validation pipeline: First, we provide strict schema context to the LLM. Second, before execution, the generated SQL passes through `sqlglot` to parse its Abstract Syntax Tree (AST). Third, we enforce a strict whitelist of allowed tables and explicitly verify that the root AST expression is a read-only `SELECT`. Any query attempting `DROP`, `ALTER`, or accessing system tables is instantly rejected. Finally, the query is executed with scoped read-only credentials, ensuring complete immunity to SQL injection.
Physical dyehouse environments experience transient network partitions between shopfloor dispensing valves and corporate ERP servers. To prevent double-debiting or dropped consumption records, I architected a Transactional Outbox pattern in PostgreSQL 16. When an automated dispenser actuates, the consumption event is committed atomically alongside the batch state in PostgreSQL. Asynchronous FastAPI background workers read this outbox queue and dispatch payloads to SAP MM (via RFC/BAPI) or Datatex NOW MES (via EDI XML) using idempotent transaction keys (`sha256(batch_id + valve_id + timestamp)`). If an ERP endpoint is unreachable, the gateway retries with exponential jitter while preserving ordering in a Dead Letter Queue (DLQ), ensuring complete financial and stock ledger reconciliation without human clipboard intervention.
In industrial control rooms, operators require simultaneous visibility into spectrophotometer formulation curves, 8K fabric inspection perches, and vessel thermal streams. Building a multi-window manager in React 19 required solving DOM thrashing and telemetry update bottlenecks. I separated the window layout state (Z-indices, dragging boundaries, dimensions) from high-frequency telemetry streams. Sensor curves and defect feeds bypass React component tree reconciliation: incoming WebSocket payloads are buffered in memory and rendered directly into Canvas elements using `requestAnimationFrame`. Desktop state transitions (minimizing, maximizing, restoring) utilize React 19 concurrent transitions and persist to a Unix-standard Virtual File System (VFS), maintaining smooth 60fps interaction even during burst telemetry.