Sublime TechnoCorp#02

Morix – Digital Signage Platform

A cloud-based digital signage SaaS with a multi-tier distribution model, split payment settlements, full media lifecycle management, and real-time device sync over MQTT — backed by a PostgreSQL database layer with triggers, functions, and stored procedures for business-critical operations.

Tech Stack

Node.jsExpress.jsTypeScriptPostgreSQLMongoDBMQTTPayUREST APIsStored ProceduresDatabase TriggersViteReact.js

Responsibilities

  • Architected the full backend for a multi-tier SaaS — Admin, Distributor, and Sub-Distributor with scoped access control
  • Designed the PostgreSQL schema with triggers, stored procedures, and database functions to handle business-critical workflows at the data layer
  • Built inventory, license, lead, and order management modules across the distribution layer
  • Integrated PayU Payment Gateway with split payment logic to automatically divide commission and actual amount across the distribution hierarchy
  • Engineered the client-side backend for media, playlist, schedule, and cloud publish workflows
  • Implemented MQTT-based device communication for real-time playlist publishing to signage hardware
  • Designed offline sync logic to reconcile the currently playing playlist when a device reconnects after being offline

Case Study

Digital signage businesses operate across layers — manufacturers, distributors, sub-distributors, and end clients — each needing their own scoped view of inventory, licensing, and revenue. Off-the-shelf SaaS tools either ignore this hierarchy entirely or require expensive customisation. Morix was built from scratch to own the full distribution stack: from the cloud dashboard where media is uploaded and scheduled, down to the physical screens displaying content in real time.

The two hardest constraints were financial and physical: payments had to split automatically across a three-tier hierarchy, and screen devices had to stay in sync even after hours of being offline.

The system has four distinct layers. At the top, three role-scoped dashboards give Admin, Distributor, and Sub-Distributor users access only to the data relevant to their tier. Beneath that sits a PostgreSQL core that handles every operation touching money or licensing — using stored procedures and triggers so critical business logic executes atomically at the database level, not scattered across API calls. The media pipeline handles upload, playlist assembly, scheduling, and S3 publish flows. Below that, an MQTT broker pushes playlist updates to physical screen hardware in real time.

PostgreSQL over MongoDB for the core: payment splits and license transfers need ACID guarantees. Moving business logic into stored procedures and triggers meant complex multi-step operations — order processing, license provisioning, inventory deductions — executed as single atomic units. A failure mid-operation rolls back cleanly instead of leaving half-written state across multiple collections.

MQTT for device communication rather than HTTP polling: polling would have introduced 5–30 second lag between a publisher uploading a new playlist and it appearing on screen. MQTT's pub/sub model lets the server push updates to every subscribed device the moment a playlist is published — sub-second delivery regardless of fleet size.

Split payment at the gateway layer rather than batch reconciliation: PayU's split API divides each transaction at checkout time. The formula per order — actual product value to the vendor, distributor commission, sub-distributor residual — is enforced transaction by transaction, not in a monthly accounting run. This eliminates the reconciliation error surface entirely.

Offline reconciliation by schedule timestamp: a device offline for hours cannot simply load the 'latest' playlist on reconnect — it may have missed scheduled transitions. On reconnect, the device sends its last-known schedule timestamp; the server resolves which playlist should be playing at that exact moment and pushes only that. The screen resumes the correct content without any manual re-publish.

End to end, I owned the full backend of both the distribution SaaS and the client signage platform — REST APIs, role-based access control across three tiers, PostgreSQL schema design with stored procedures and triggers, PayU split payment integration, media pipeline backend, MQTT device communication layer, offline sync reconciliation, and the React and Vite client dashboards.

Key Decisions

  • PostgreSQL over MongoDB

    Payment splits and license transfers need ACID guarantees. Stored procedures run atomically — no half-written state if an API call fails mid-transaction.

  • MQTT over HTTP polling

    Polling introduces 5–30s lag. MQTT push delivers playlist updates to every subscribed device in under a second, regardless of fleet size.

  • Split payment at the gateway layer

    PayU's split API divides each transaction at checkout time — actual product value to vendor, commission to distributor, residual to sub-distributor — enforced per order, not in a monthly accounting run.

  • Offline reconciliation by schedule timestamp

    A device offline for hours cannot load the 'latest' playlist on reconnect — it may have missed scheduled transitions. The device sends its last-known timestamp; the server resolves which playlist should be playing at that exact moment.