
// [1/2] The PostScript main dashboard and activity monitor.
Project Overview
PostScript is a high-throughput listing engine designed to bridge the gap between physical garment inventory and the eBay Marketplace. Architected to serve the Grand Strand's dynamic resale market from its roots in Murrells Inlet, SC, the system leverages a multi-modal AI pipeline and real-time socket communication to reduce "Photo-to-Listed" latency by ~85% compared to manual entry.
Total time saved per item listing compared to manual entry.
Successful data extraction from high-contrast garment tags.
Average time from asset upload to review-ready status.
Core Logic
The system treats a physical storage box as a volumetric data structure. Rather than simple item counts, PostScript implements a Fractional Volumetric Capacity model, where garments consume box "units" based on their physical density (e.g., Heavy Outerwear = 3.5u vs. Lightweight T-Shirts = 0.65u).
01 // Node.js Architecture & Process Flow
The backend is architected as a decoupled event-driven system to handle the high-computational cost of image processing and AI extraction without blocking the main event loop.
Process Choreography
- Ingestion Layer: A RESTful Express API receives multi-part image buffers.
- Job Orchestration: New items are committed to a PostgreSQL
job_queuewith a status ofprocessing. - Background Worker: A dedicated Node.js child process (forked from
server.js) polls the queue.- Phase A (Visual): Uses
sharpto generate optimized thumbnails and medium-res assets. - Phase B (Extraction): Routes the clothing tag buffer to the AI Tiered Fallback Engine.
- Phase C (Persistence): Asynchronously uploads assets to Cloudinary and updates the local RDBMS.
- Phase A (Visual): Uses
- Real-Time Feedback: Progress is streamed via Socket.io directly to the frontend
ActivityMonitor, ensuring the user has millisecond-level visibility into the background worker’s status.
02 // eBay API Integration Layer
Integrating with the eBay Trading API requires strict adherence to rate limits and data consistency. PostScript implements a custom Managed Promise Queue to govern all outbound traffic.
Efficiency & Reliability Specs
- Rate Limiting: All
AddItemandReviseItemcalls are throttled to a 2000ms cooling window to prevent429 Too Many Requestspenalties. - Orphan-Protection Sync: eBay frequently omits "Ended" or "Sold" items from the
ActiveListresponse. PostScript’s synchronization engine performs a diff-check between the local database and the eBay response. - Bulk Sync Engine: Deploys a background loop that iterates through all global inventory, refreshing watch counts, prices, and status with a 2500ms delay per box, ensuring zero API drift.
03 // Volumetric Inventory Metrics
PostScript replaces legacy inventory tracking with a predictive fullness model.
| Garment Type | Volumetric Weight (u) | Max Capacity (20u Box) | | :--- | :--- | :--- | | Heavy Jacket | 3.50 | ~5 Items | | Jeans / Denim | 1.00 | 20 Items | | Polo Shirt | 0.85 | 23 Items | | Standard T-Shirt | 0.65 | ~30 Items |
Algorithm: Box_Fullness = Σ (Item_Type_Weight)
04 // Technical Stack Breakdown
[Backend]
- Runtime: Node.js 20+
- Database: PostgreSQL (Structured JSONB for item specifics)
- AI Integration: OpenRouter API (Gemini / NemoTron)
- Networking: Socket.io (Shared Instance architecture)
[Frontend]
- Framework: React 18 / Vite
- State Management: TanStack Query & React Hook Form
- UX: Live Preview Footer & Global Activity Monitor
05 // Efficiency KPIs
- OCR Accuracy: 94% on high-contrast tag images.
- Processing Latency: ~12s from Upload to "Review Ready".
- Concurrency: Parallel background worker handles up to 5 concurrent item enrichments.
- Sync Speed: 100-item box synchronization in
< 45seconds.