Our productPre-launch

PagePilot

Multi-tenant SaaS that runs Facebook Pages with AI, safely

AI posts with an approval gate, Messenger replies grounded in each business's knowledge and guarded comment replies, for many businesses at once, with isolation enforced below the code.

Type
Our product
Status
Pre-launch
Timeline
Pre-launch, awaiting Meta App Review
Platforms
Web, Facebook Pages

Illustration. Product screens are not public yet.

Overview

PagePilot is a multi-tenant SaaS that lets businesses and agencies run many Facebook Pages with AI: daily posts behind an approval gate, Messenger replies grounded in each Page's own knowledge base, guarded replies to public comments, and subscription billing in Bangladeshi taka. It began as a conversion of an open-source, single-Page bot and is awaiting Meta App Review before launch.

What we did

  • Product strategy
  • Architecture
  • Backend and AI engineering
  • Dashboard
  • Security
  • QA automation

The challenge

A bot that serves one Page can't simply gain a tenant ID column. One Meta webhook delivers events for many Pages at once, global indexes and in-process caches can leak data between businesses, and scheduled jobs fire once per server replica.

Public comment replies raise the stakes further. Anyone can post text designed to manipulate an AI, and every reply goes out in the business's name.

What we built

Tenant scoping is enforced at the database driver, so code that forgets the tenant fails loudly instead of leaking data. A CI leak suite with fault injection proves the isolation on every change.

Webhook intake is signature-verified and durable: Meta always gets an answer within five seconds, while the work continues on a MongoDB job queue with leases and crash recovery. A per-tenant, timezone-aware scheduler publishes posts at the right local time, safe across daylight saving changes, and Page tokens are encrypted with AES-256-GCM.

Comment replies pass a four-layer prompt-injection guard and stay switched off until Meta approves them. Around that sit sign-in with 3 roles and 11 permissions, knowledge-base version history, usage quotas, data export and erasure, and taka billing through PipraPay with reminder emails.

Design decisions

The Next.js dashboard is built for business owners and agencies rather than marketing specialists: connect Pages, give each one the facts about the business, approve posts, and manage replies, team access and billing in one place.

Safety shapes the product as much as the interface does. Isolation, guards and encrypted credentials were designed in from the start, because a multi-tenant AI product only works if every business can trust it with its Page.

Architecture

A pnpm and Turborepo monorepo of 4 apps and 9 packages on Node.js and MongoDB, with AI services on Gemini and eight key architecture decisions recorded with their trade-offs.

  • Durable webhook intake

    Signature-verified events acknowledged within five seconds and handed to a queue, so nothing is lost when a process restarts.

  • Tenant-scoped data layer

    Isolation enforced at the database driver and verified by a CI leak suite with fault injection.

  • Jobs and scheduling

    MongoDB-backed jobs with leases and crash recovery, and a per-tenant scheduler that is safe across daylight saving changes.

  • AI services

    Gemini-written posts with an approval gate, retrieval-grounded Messenger replies and the four-layer comment guard.

  • Dashboard and billing

    Next.js with Better Auth, roles and permissions, encrypted Page tokens and taka subscriptions through PipraPay.

Technologies

  • TypeScript
  • Node.js
  • MongoDB
  • Gemini API
  • Next.js
  • Better Auth
  • pnpm and Turborepo
  • PipraPay
  • Docker
  • AES-256-GCM

How it was delivered

Phased so that each stage reduced risk and produced something usable.

  1. 01

    Multi-tenant foundations

    Driver-level tenant scoping and the leak suite came before any feature work.

  2. 02

    Durable intake and jobs

    Webhook fan-in from many Pages, the job queue with leases and the timezone-aware scheduler.

  3. 03

    AI features and guards

    Posts with an approval gate, retrieval-grounded replies and the four-layer guard for public comments.

  4. 04

    Billing and launch readiness

    Roles and permissions, taka billing, data export and erasure, and submission for Meta App Review.

Where it stands

  • One dashboard for many Pages, with roles and permissions for agency teams
  • Each business's data kept separate, enforced below the application code
  • Webhooks acknowledged within five seconds, with crash-safe processing
  • Comment replies protected by a four-layer prompt-injection guard
  • Awaiting Meta App Review, live payment keys and production deployment

Related reading

Have a project like this?Let's talk about how we'd approach it.

Tell us what you want to build and where you are today. We'll reply with questions, next steps and an honest view of how we can help.