MAKKANI AI × COASTEX ENTERPRISE OS v4.3
Audited Production Telemetry • Sovereign 5-Tier AI & ERP Architecture

Coastex Enterprise OS (v4.3) — System Architecture, Code Audit & Hybrid AI Token Engine

Engineered, cryptographically hardened, and operated 24/7 by Makkani AI (Mr. Murtaza Makkani) exclusively for COASTEX (PVT.) LTD. (KEPZ, Karachi). Unlike stitched third-party SaaS tools, Coastex runs on a unified 414,478-line custom sovereign stack combining zero-waste edge AI vision, OCR document automation, 7-carrier maritime container tracking, anti-error gate-pass blocking, buyer self-service with online chat, and double-entry finance.

Combined Sovereign Codebase
414,478 LOC
318,563 ERP + 95,915 Makkani AI Core (427 Files)
Unique REST & SSE API Endpoints
336 APIs
Across 20+ Enterprise Domains (60,620 Server LOC)
Zero-Waste Hybrid AI / OCR Hooks
261 Hooks
0-Token Edge Vision + Schema-Constrained Gemini AI
UI Components & Global Carriers
204 Views • 7 Lines
Maersk, MSC, CMA, Hapag, COSCO, ONE, Evergreen
Cryptographic IP Protection
384-Bit Vault
48-Byte HKDF AES-256-GCM + Hardware Motherboard Lock

1. 5-Tier Sovereign System Architecture Map

Tier 1 — Edge TLS, Static File Shield & Security Sentinel WAF
HTTPS • Bot & Intrusion Defense
Serves strict TLS domains (cstpvtltd.com, erp.cstpvtltd.com), isolates SEO/LLM discovery routes (/robots.txt, /sitemap.xml, /llms.txt, /llms-tech.txt, /LICENSE.txt, /.well-known/security.txt), stamps sovereign IP headers (X-Powered-By: Makkani AI), and actively drops unauthorized path probes & honeypot scanners.
Tier 2 — Offline-First React 19 PWA (v38), Native Desktop App & Buyer Portals
256,215 LOC • 204 Components
Full enterprise ERP modules plus dedicated external interfaces: International Self-Service Customer Portal (accessible orders, invoices, packing lists, ledgers & Built-In Online Chat), Interactive Container Wishlist Builder synced to factory capacity, Read-Only Live Container Packing Tracker (25s auto-sync), Offline Mutation Queue, and Native Windows Desktop App.
Tier 3 — 336-Endpoint Node/Express Core, Gate Pass Scan Blocking & Maritime Engine
60,620 Server LOC • Zero-Mixup Control
Executes Strict Customer Monitoring Lists on every Outward Sale Gate Pass barcode scan — automatically BLOCKING & REJECTING wrong items, unapproved customer grades, duplicates, or raw bales before loading. Runs 7-Carrier Container Auto-Tracking (Maersk, MSC, CMA CGM, Hapag-Lloyd, COSCO, ONE, Evergreen) and Autonomous WhatsApp Integration for daily EOD & document coordination.
Tier 4 — Makkani AI Zero-Waste Hybrid AI Token Engine & 30-Cam Edge Vision
95,915 AI Core LOC • >85% Token Savings
Local-First 0-Token Edge AI: Continuous 30-camera factory surveillance, 360° face-verified gate attendance (ArcFace-R50, SCRFD-10G), neural posture analytics (YOLO11-Pose), RapidOCR clearing extraction, and deterministic barcode compliance consume zero cloud LLM tokens.
Schema-Constrained Cloud Multimodal AI (Google Gemini): Invoked selectively for complex unstructured Commercial Invoices, Clearing Bills, CNIC batch verification, Bank Statement reconciliation, PDF Vector Studio, and CEO Profit Intelligence — using compressed ROIs & strict JSON schemas to eliminate wasted prompt/output tokens.
Tier 5 — Double-Entry Multi-Currency Ledger & 384-Bit AES-256-GCM Vault
PKR / USD / GBP / AED / EUR • Hardware Locked
Enforces balanced Chart of Accounts across all 8 voucher workflows (BPV/CPV/BRV/CRV/JV/PV/RV/SV), automated monthly payroll & staff loan EMIs, EPZA customs ledgers, and 48-Byte (384-Bit) HKDF-SHA384 AES-256-GCM encrypted server/Python execution bound strictly to authorized hardware IDs.

2. Audited Codebase & API Endpoint Breakdown

Verified Source Code Metrics (Coastex × Makkani AI)

Layer / SubsystemFilesAudited LOC
Frontend ERP, Buyer Portal & AI UI (src/)265256,215
Custom Express Backend & Engines—60,620
Encrypted Python OCR & PDF Services41,559
Native Windows Desktop Launcher (C#)1169
Coastex ERP Standalone Total270318,563
Makkani AI 24×7 Vision, WhatsApp & Agent Core15895,915
Combined Sovereign Stack Total428414,478

336 Unique API Endpoints by Domain

API Route DomainUnique RoutesRole
/api/erp/* & /api/admin/*44Realtime SSE Sync, Core State & Ops
/api/mail/*36Enterprise Mail & Attachment PDF Engine
/api/sales/* & /api/buyer-portal/*50Export Orders, Chat, Tracking & Portal
/api/production/* & /api/barcodes/*316/9-Pack Bales & Anti-Error Scan Blocks
/api/finance/* & /api/ledger/*25Multi-Currency COA, Vouchers & Bank Match
/api/hr/* & /api/gate/*26Payroll, AI Attendance, Loans & Gate
/api/security/* & /api/auth/*36WAF, Watermark Integrity & RBAC
/api/ceo-suite/*, /api/tracking/*, /api/customs/*, /api/inventory/*, /api/pdf/*, /api/setup/*50AI Insights, 7-Carrier Shipments, EPZA & OCR

Responsible & Practical Industrial AI — Global Award Impact Highlights