Engineering Deep Dive — Architectural Battle Scars from Rebuilding an Open-Source Social Scheduler
HookpostHookpost
Engineering Post-Mortem

Why We Rewrote Postiz:
5 Architectural Gotchas & Battle Scars

Postiz gained 35,000+ GitHub stars with an ambitious vision for open-source social media management. But when we took it into real production, we hit five serious architectural limitations that forced us to rebuild it as Hookpost.

By Mohan Bhanushali, Founder & Lead OperationsJR Consulting Co.September 2026

1Turbopack OOM Exit Code 137 on Modest VPS Hosts

Postiz is structured as an Nx monorepo using Next.js 16 with Turbopack. While local builds on 32GB developer Macs finish in under 10 seconds, running next build on a standard 2GB RAM / 1 vCPU cloud server triggered the Linux Out-Of-Memory killer (Exit Code 137).

The Fix: We separated the build artifact pipeline. Turbopack generates a 6.8 GB development cache, but only 46 MB of lean compiled assets are needed for runtime. We created a local CI bundling workflow that packages only production JS chunks, dropping server memory consumption from 1,900 MB down to 640 MB.

2Meta Graph API v20 Error 190 (The 2-Hour Silent Disconnect)

During early testing, scheduled Instagram Reels and Facebook Pages would suddenly fail with OAuthException (Code 190, Subcode 463: Error validating access token) exactly two hours after account connection. Postiz was storing short-lived user tokens directly from the OAuth callback.

The Fix: We rewrote the Meta OAuth callback to immediately execute an automated exchange with oauth/access_token?grant_type=fb_exchange_token, securing long-lived 60-day tokens and initiating automated background renewal cron jobs before expiration.

3Neon Serverless Connection Exhaustion

When connecting to cloud serverless Postgres providers like Neon, Prisma ORM in Postiz rapidly opened 20+ persistent connections during background cron syncs, throwing max_client_conn reached errors.

The Fix: We split database operations into dual connection strings: a PgBouncer pooled connection (?pgbouncer=true&connection_limit=5) for runtime queries, and a dedicated DIRECT_URL exclusively for schema migrations.

4The Western Payment Monopoly: Adding Native Razorpay Support

Postiz assumed all creators have an international USD credit card. Millions of creators across India and emerging markets rely on instant UPI (Unified Payments Interface), RuPay, and domestic banking.

The Fix: We engineered native Razorpay billing inside Hookpost with cryptographic HMAC SHA-256 webhook validation, letting creators subscribe via Google Pay, PhonePe, Paytm, NetBanking, and cards starting at ₹699/month.

5AI Agent Revolution: Building the Claude MCP Server

The way creators produce content changed in 2026. Nobody wants to copy-paste between Claude Desktop or ChatGPT and a web calendar dashboard. We wanted AI agents to schedule posts autonomously via natural conversation.

The Fix: We built an official Model Context Protocol (MCP) server directly into the Hookpost ecosystem (npx hookpost mcp), allowing Claude Desktop, Cursor, and Windsurf to manage queues programmatically via standard JSON-RPC.

Experience the Re-engineered Architecture

Enjoy 100% open-source power, reliable direct API auto-publishing, and native Claude MCP integration.

Start Free for $0 →