RayInTheDark: the operations platform, its bots, integrations and security

One engagement with an ecommerce marketing agency, and seven problems solved inside it. Each section below is one of them.

Client
RayInTheDark, an ecommerce marketing agency
Work
Build, maintain, repair and improve, secure
Runs on
Next.js, TypeScript, PostgreSQL, Vercel and Fly.io
In use
Daily, by the agency's team

RayInTheDark runs its client operations on an internal platform VXSec built from zero. VXSec also looks after everything connected to it: the bots, the store and advertising data, the releases and the security.

The operations platform

The agency's earlier system had no automated tests, no real version control and one shared login. VXSec built the replacement from zero on Next.js, TypeScript and PostgreSQL. It holds the client book, the money pages, the sales pipeline and team roles, and the agency's staff use it every day across more than 200 client accounts.

Underneath, every database write goes through one service template, the app's database role has only the access it needs, and background jobs are claimed with row locks and retried with backoff, so a crashed job never hangs. Advertising data from Meta arrives on a schedule, with a freshness check that alerts a person when it goes stale. About 1,000 automated tests run across four packages.

Access control

One database holds every client's data, and about twenty staff with different jobs need different views of it. Access is enforced in the database itself: every table that holds client data has row-level security, and the app sees nothing until a request says which client workspace it belongs to.

Staff see what their role allows. Admins can view the platform as a given teammate, read-only, to check what that person sees. New members join through invites instead of hand-made grants, and credentials for connected services are stored encrypted. A read-only audit of production found 34 of 34 client-data tables fenced, and an isolation test runs on every push.

The Shopify app

The agency needed live revenue from every client store without collecting store admin passwords. VXSec built a Shopify public app for it. The app is built so a store owner connects through Shopify's own sign-in instead of sharing a password, its access tokens expire, and uninstalling it disconnects the store and clears its data. The last 30 days of revenue appear right after connecting, and a sync keeps them current.

One bug worth knowing about: the app's webhooks had been registered with relative addresses, so every delivery was redirected and all four uninstall notices failed. Registering absolute addresses fixed it. Sync, uninstall and reinstall were then verified end to end on a test store.

The AI client-concern monitor

Client conversations happen across many Discord channels, and a client who was unhappy could go unnoticed for too long. A bot now reads those channels, groups messages into bursts, and makes one small model call per burst, not per message, to judge whether a client needs attention. Alerts reach the right people ranked by severity, a plain-English digest goes out daily, and a promise followed by silence is flagged on day three.

An all-clear message proves each sweep ran, and failure notices go only to the technical team. Before launch, the monitor was tested read-only against real past client concerns. It runs every day.

Security review and fixes

The platform holds financial data, and nobody owned its security. VXSec took that on: an inventory of credentials with a rotation log, an audit of the database access rules, and a graded review of the application, the bot host, the worker machine and the platform settings.

The critical and high findings were fixed, then a second review of the live systems rechecked each fix.

Data accuracy

Staff noticed numbers that looked wrong. The agency keeps client status in Notion, and the platform had drifted from it. VXSec checked it read-only in four passes: the Notion export against the database field by field, every page against the live database and the code, the platform against the bot's records, and an independent re-check of the biggest claims. Each finding came with its code location and the query that proved it.

Every serious wrong-data bug was fixed. The money pages now read the real billing ledger, clients who had left were removed from every count, and corrections ran through reviewed scripts that do a dry run first, never as hand edits to the database.

The release pipeline

Early on, deploys broke often, and once a deploy finished before its tests did. VXSec built the pipeline from nothing: tests, pinned dependencies, secret scanning and the isolation test on every push. A deploy fires only after a green test run and ships that exact commit. Database changes never run from the pipeline, and the publish script refuses a schema change until the production migration has run.

For the team it is now one command to save, review and publish. What reaches production is always the commit that was tested.

What needs building or fixing?

Tell VXSec what the system does, what you want to change, and what is getting in the way. Include links if you have them. Within two business days you get a written reply with the next step.