Automation SaaS

Automations.uz

A multi-tenant Instagram automation platform — comment and DM auto-replies, AI-powered responses, an ice-breaker rule engine, and webhook-driven message processing, plus a published Python SDK for building bots. Built with NestJS, BullMQ, PostgreSQL, and a Next.js dashboard.

Overview

Businesses were losing leads in their Instagram comments and DMs — too many messages, not enough time. Automations.uz lets them set keyword rules, AI-powered replies, and interactive ice-breaker menus that engage followers automatically. I built the platform and also published a Python SDK on PyPI so developers can build their own bots on top of the same API.

What I built

  • Designed and built the entire multi-tenant backend — account management, Instagram OAuth, webhook ingestion pipeline, rule engine, AI reply layer, and bot delivery mode.

  • Built the Next.js customer dashboard and admin panel from scratch — where businesses configure their automation rules and review conversation history.

  • Authored and published the Python SDK on PyPI — async handler decorators, long-poll client, and a full test suite, so developers can consume the API without hosting webhooks themselves.

  • Maintained the full schema migration history, Docker infrastructure, and CI — keeping the system stable as features landed.

Architecture

Instagram sends events (new comments, DMs) as webhooks; the platform verifies each one with a cryptographic signature check, queues it in BullMQ, and processes it asynchronously — so a spike in Instagram traffic never blocks the API. Each business account is fully isolated, and developers who don't want to run webhook infrastructure can poll for events instead using the Python SDK.

Under the hood

  • API keys are hashed at creation time and the raw key is never stored — so even a database leak exposes nothing usable. Lookup works by checking only the key prefix, then comparing the hash, which keeps authentication both fast and safe.

  • Ice-breaker buttons work via token indirection — each call-to-action button gets a stable random token that the platform stores alongside the reply text, then only the token is sent to Instagram. When a user taps, Meta fires back the token, and the platform looks up the right reply. This means reply text can be updated without re-syncing anything with Instagram.

  • The AI reply layer uses OpenAI with tool-calling to capture leads — it injects recent conversation history for context, and if the model decides to capture a phone number, it calls a function tool that routes it to the lead notification service. A timeout and retry cap prevent one stuck AI call from delaying the whole queue.

What I learned

  • Building a queue-backed pipeline early was the right call — it decoupled ingestion from processing and made the system trivially retryable when downstream calls failed.

  • Publishing an SDK forced me to think about the API from the outside — it exposed awkward interfaces I had accepted internally but would never hand to a developer.

Built with

Frontend

  • Next.js 16
  • React 19
  • TypeScript 5
  • Tailwind CSS v4
  • shadcn/ui
  • Vitest
  • TanStack Query

Backend

  • NestJS 11
  • TypeScript 5
  • Node.js 22
  • TypeORM
  • PostgreSQL
  • bcryptjs
  • @nestjs/jwt

Queue & Data

  • BullMQ 5
  • Redis
  • ioredis 5
  • PostgreSQL

Python SDK

  • Python 3.9+
  • httpx
  • pytest
  • pytest-asyncio
  • PyPI

Infra & Tools

  • Docker
  • docker-compose
  • @nestjs/swagger
  • OpenAI API