# Build brief — a focused alternative to ManyChat

> **Verdict:** Not faithfully · **Buildability:** 16/100 · **Category:** Social Media
> **Source:** https://www.canitbevibecoded.com/manychat
> Independent editorial assessment from Can It Be Vibe Coded? Not affiliated with, endorsed by, or derived from ManyChat. Verify current pricing and capabilities before acting.

## Context

**ManyChat** — Visual flow builder for automated Instagram, Messenger, WhatsApp and SMS conversations. It currently costs $39/mo.

The flow builder is the visible part and it is not the hard part: keyword triggers, branching, delays and tags are a focused implementation of CRUD and a state machine. The hard part is that every message goes through Meta, and Meta decides who gets to send it. To reply to arbitrary strangers who DM your Instagram account you need a reviewed app with advanced messaging permissions, a linked Facebook page, business verification, and compliance with the 24 hour window and human agent tag rules. ManyChat has already cleared all of that and maintains it as the APIs churn. A DIY bot works fine for accounts you personally control in dev mode, which is exactly the audience that does not need automation.

This brief describes a focused, single-operator replacement for the part of ManyChat that is genuinely reproducible. It is deliberately narrower than the product it replaces, and it says so in writing. Build the useful core; do not pretend to have rebuilt the rest.

## What you are building

A self-hosted webhook server that receives Instagram or Messenger events and runs your keyword-triggered reply flows from a JSON config, storing contacts and state in SQLite.

- Draft, queue, and track content for the few networks you actually use.
- A responsive interface with real empty, loading, success, and error states.

## Requirements

### Functional

- Meta developer app with a professional Instagram account linked to a Facebook page.
- App review for advanced messaging permissions if you want to reply to non-testers.

### Data and integrations

- Publicly reachable HTTPS endpoint for the webhook (tunnel or small VPS).
- Willingness to fix the integration whenever Meta changes the API.

Each of these needs a real account, credential, or quota. Set them up before writing feature code.

### Non-functional

- Accessibility: semantic markup, labelled controls, visible focus, and reduced-motion support.
- Security: server-side secrets, validated input, and no credentials in the client bundle.
- Reliability: retries with backoff on external calls, and a clear failure state when a provider is down.
- Portability: the operator can export their data and leave without losing it.

## Implementation brief

Build a self-hosted Instagram/Messenger DM autoresponder called "dmflow". Node 20, TypeScript, Fastify, better-sqlite3, no ORM, no frontend framework.

Stack decisions are final, do not offer alternatives.

What it does:
1. POST /webhook receives Meta Messenger and Instagram messaging webhook events. GET /webhook handles the hub.challenge verification using VERIFY_TOKEN from .env.
2. Verify the X-Hub-Signature-256 header against APP_SECRET and reject anything that fails.
3. Store contacts (platform, psid, first_seen, last_inbound_at, tags) and a messages log in SQLite at ./data/dmflow.db. Create the schema on boot if missing.
4. Load flows from ./flows/*.json. A flow has: id, triggers (array of keyword strings, matched case-insensitively on the inbound text, plus an optional "default" fallback flow), and steps. Step types: send_text, send_buttons (title plus up to 3 postback buttons), wait (seconds), add_tag, set_field, goto (another flow id).
5. Run a small state machine per contact: current flow id, current step index, collected fields. Persist state so a restart resumes correctly.
6. Outbound sends go to the Graph API /me/messages with PAGE_ACCESS_TOKEN. Respect the 24 hour window: if last_inbound_at is older than 24 hours, refuse to send and log the reason instead of retrying forever.
7. Retry failed sends up to 3 times with exponential backoff, then dead-letter the message into a table.
8. Serve a single read-only HTML page at / rendering contacts, their tags, and the last 50 messages. Plain server-rendered HTML, no JS build step.

Out of scope: WhatsApp, SMS, email, a visual flow editor, multi-user auth, analytics dashboards, broadcast sending.

Secrets in .env only: VERIFY_TOKEN, APP_SECRET, PAGE_ACCESS_TOKEN, PORT. Ship .env.example. No telemetry, no third party services beyond Meta's Graph API.

Include two example flows in ./flows: a keyword flow for "price" and a default greeting flow.

Write a README that states plainly that until the Meta app passes review for advanced messaging permissions, this will only reply to accounts added as app testers, and that this is a limitation of Meta, not of the code.

## Delivery standard

- Inspect the repository first, then write a short implementation plan before writing code.
- Deliver the smallest complete end-to-end workflow first; every primary control must work against persisted data.
- Use real validation and storage; never substitute fake dashboards, decorative controls, hard-coded success states, or mock integrations.
- Include responsive layouts plus genuine empty, loading, success, validation, and failure states.
- Keep secrets server-side in environment variables, provide .env.example, and never commit credentials or user data.
- Add structured logs around every external call and return actionable errors without leaking sensitive details.
- Write unit tests for the core logic and one automated test of the main user journey.
- Finish with a README covering setup, architecture, data location, backups, tests, deployment, and known limitations.

## Acceptance criteria

- [ ] A clean install starts the app using only the README and .env.example.
- [ ] The primary journey works from first visit through saved result, reload, edit, export, and deletion where applicable.
- [ ] Invalid input, missing configuration, provider failure, and an empty database each have a usable state.
- [ ] The interface works at 390px and 1440px, is keyboard navigable, and shows visible focus on every control.
- [ ] Tests, type checking, linting, and a production build all pass with no ignored failures.
- [ ] No part of the interface implies a live integration, security guarantee, or scale capability that was not actually built and verified.

## Non-goals

Do not build these, and do not claim to have replaced them:

- Pre-approved Meta Business Partner status, so your bot only talks to testers until review passes.
- The visual flow editor that non-engineers can actually edit without touching JSON.
- Multi-channel parity: WhatsApp, SMS and email in one contact record.
- Comment-to-DM triggers, story reply triggers, ads-click entry points and other Meta surface coverage.
- Deliverability guardrails: 24 hour window handling, message tags, broadcast policy compliance baked in.

## What you still own after launch

- Secure credentials, rotate secrets, and handle provider rate limits.
- Run migrations, backups, restores, and dependency updates.
- Test the critical journey after every model, API, or hosting change.
- Monitor failures and fix the edge cases a first prompt will miss.
- Maintain every third-party integration as APIs and OAuth rules change.

## Risk

**High consequence.** Use this as a prototype or personal aid. Keep a qualified human and an established provider in the loop for consequential decisions.

Editorial confidence in this assessment: medium. No reviewed project implementation is linked yet.

---

Generated by [Can It Be Vibe Coded?](https://www.canitbevibecoded.com) · Full report: https://www.canitbevibecoded.com/manychat
