# Build brief — a focused alternative to Eloqra

> **Verdict:** Partly, if you narrow it · **Buildability:** 58/100 · **Category:** Customer Support
> **Source:** https://www.canitbevibecoded.com/eloqra
> Independent editorial assessment from Can It Be Vibe Coded? Not affiliated with, endorsed by, or derived from Eloqra. Verify current pricing and capabilities before acting.

## Context

**Eloqra** — Free live-chat widget for your site that lands in your Telegram. It currently costs $4.99/mo.

The first half is a one-sitting build and the second half isn't. A script tag that injects a chat panel, a websocket, and a bot that forwards messages so your native Telegram reply reaches the visitor · that works by dinner, and the prompt below builds it. The gap is the operator side. Replying inside a bot chat is fine for one conversation a week; the moment you have several going you want a real inbox, and in Telegram that means a Mini App, which is a second application with its own platform rules: auth is HMAC-validating initData against your bot token, the webview lies about its own height so you size from viewportStableHeight instead of dvh, fullscreen hides content under the status bar until you combine two different safe-area insets, and it disables text selection outright, so even copying a message means hand-rolling a long-press with a clipboard fallback. None of that is hard. All of it is discovered the slow way, on a phone, after the prompt has finished.

This brief describes a focused, single-operator replacement for the part of Eloqra 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

One script tag injects a chat widget into your site, messages arrive in your Telegram, and replying to the bot message replies to the visitor · one conversation at a time.

- Build a focused single-user workflow with real persistence, search, and export.
- A responsive interface with real empty, loading, success, and error states.

## Requirements

### Functional

- An HTTPS host for the websocket · Telegram will not load a Mini App over plain http.
- BotFather registration of the Mini App URL and menu button, if you want a real inbox rather than bot replies.

### Data and integrations

- A Telegram bot token from @BotFather.

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 me a self-hosted live-chat widget whose inbox is Telegram. Requirements:

- Stack: a single Node + TypeScript service (Fastify) with SQLite via better-sqlite3.
  No Docker, no separate frontend build, no accounts system.
- Embeddable widget: GET /widget.js returns a script that injects a launcher button and
  chat panel into any page via one tag with data-site-id, rendered in a shadow DOM so the
  host page's CSS can't leak in. No iframe. Read theme (light/dark), accent color, and
  corner position from data- attributes.
- Transport: a websocket (ws) between visitor and server, with a long-poll fallback when
  the socket won't open. Persist every message. Give the visitor a signed cookie id so
  their thread survives a reload.
- On a conversation's first message, capture page URL, referrer, and user agent parsed to
  device/browser/OS, plus coarse IP geolocation from a free API.
- Telegram: a grammY bot posts each new conversation to OWNER_CHAT_ID with that visitor
  context. The operator answers using Telegram's native reply-to-message · map the
  replied-to message id back to its conversation and push the text to the visitor live.
- Typing indicators in both directions, and an optional pre-chat form (name + email)
  toggled per site.
- An /admin page behind basic auth listing conversations, each full thread, and a reply box,
  so the widget still works when Telegram is unreachable.
- Secrets in .env: BOT_TOKEN, OWNER_CHAT_ID, ADMIN_PASSWORD, ALLOWED_ORIGINS for CORS.
- Ship a README with the exact snippet to paste and VPS deploy steps (systemd + Caddy for
  TLS, since websockets need it).
- Deliberately out of scope: a phone operator console. That is a Telegram Mini App, a
  second project with its own rules (initData HMAC auth, viewportStableHeight sizing,
  safe-area insets); budget separate days for it. Also out: multiple operators,
  billing, canned replies, AI autoresponders, and analytics dashboards.

## 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:

- A real operator inbox · the Mini App console with a combined thread list across sites, unread badges, typing indicators and deep links from a notification straight into the conversation · bot replies cover one chat at a time, not five at once.
- The week you spend learning Telegram's webview rather than writing features · initData HMAC auth, sizing from viewportStableHeight because dvh overshoots, two safe-area insets to stay clear of the status bar in fullscreen, and text selection disabled so copying a message needs a hand-rolled long-press.
- A free tier · you would be spending days plus a monthly VPS bill to replace something that costs nothing for one site.
- Everything that isn't the happy path · socket reconnects, duplicate sends, message ordering on flaky mobile networks, Telegram rate limits and retry queues, bot token rotation.
- Reliability at the vendor's scale is an operations problem, not a prompt.
- The last 20 percent is sync, migration fidelity, speed, and edge cases.

## 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.

## Risk

**Operational risk.** The code is achievable; dependable data, integrations, and ongoing operations are the real cost.

Editorial confidence in this assessment: high. No independent one-shot implementation is linked yet.

## Prior art

Working open-source software you can read, fork, or borrow from before starting:

- [Chatwoot](https://github.com/chatwoot/chatwoot) — self-hostable customer engagement suite · far heavier, but open source and battle-tested

---

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