# Build brief — a focused alternative to Grow or Die

> **Verdict:** Partly, if you narrow it · **Buildability:** 49/100 · **Category:** Analytics
> **Source:** https://www.canitbevibecoded.com/grow-or-die
> Independent editorial assessment from Can It Be Vibe Coded? Not affiliated with, endorsed by, or derived from Grow or Die. Verify current pricing and capabilities before acting.

## Context

**Grow or Die** — Profit analytics that joins product activity, payment revenue, and server-side AI usage. It currently costs $24.08/mo.

An agent can build the honest personal version: a first-party tracker, a Stripe webhook, an OpenAI usage wrapper, and a SQLite join keyed by your own account ID. That is enough to show which customers make money. The paid product starts earning its fee when the inputs stop being tidy. Analytics exports drift, refunds arrive late, model prices change, streaming calls fail after consuming tokens, and anonymous visitors do not naturally become the same people who paid. A focused build can give one founder a useful ledger for one stack. Matching Grow or Die's connector coverage, SDKs, missing-data discipline, retention, and production reliability is ongoing analytics infrastructure, not a prompt.

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

Join first-party product activity, Stripe revenue, and server-side OpenAI usage by a stable account ID, then show revenue, AI cost, and contribution profit per customer.

- Ingest a known data source, calculate a focused metric set, and render a useful dashboard.
- A responsive interface with real empty, loading, success, and error states.

## Requirements

### Functional

- Node.js 22.
- VPS with a domain and TLS.
- First-party tracker and identify call.
- SQLite backups.

### Data and integrations

- Stripe webhook secret.
- OpenAI API key.

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 single-tenant AI contribution-profit dashboard for one product, replacing the narrow personal core of Grow or Die.
Use Node.js 22, TypeScript, Fastify, better-sqlite3, and server-rendered HTML with no frontend framework.
Run as one process behind Caddy; store everything in one SQLite file with a documented backup command.
Ship a first-party browser tracker that records pageviews and product events with a random anonymous visitor ID.
Add POST /identify so my app can bind that visitor ID to my own stable account_id; never use email as the join key.
Verify Stripe webhooks for checkout.session.completed, invoice.paid, charge.refunded, and subscription deletion.
Read account_id from Stripe metadata and store each payment or refund idempotently in an append-only revenue ledger.
Provide a thin wrapper around the official OpenAI Node SDK that returns the provider response unchanged.
The wrapper records account_id, model, token usage, cached input tokens, latency, status, and occurred_at.
Never collect prompts, generated output, or the OpenAI API key; the key stays in .env and goes only to OpenAI.
Keep model prices in a versioned JSON catalog with effective dates and calculate cost on the server.
Join product events, revenue, and AI cost only by account_id and only across the same finalized 7, 30, or 90 day window.
Never turn a missing payment, unknown model, partial import, or unmatched identity into zero. Show it as unknown.
Dashboard: visitors, paying accounts, revenue, AI cost, contribution profit, margin, and a customer profit table.
Every total links to the underlying ledger rows and shows source freshness, unmatched counts, and unpriced calls.
Recommend one next action only when complete observed data supports it; otherwise recommend the missing connection or identity fix.
Protect the dashboard with one admin bearer token from .env; add no accounts, billing, telemetry, cookies, or third-party analytics.
Include clearly labelled demo data that can be deleted in one command and never appears after real data arrives.
Write unit tests for webhook idempotency, identity joins, price effective dates, refunds, and unknown-state propagation.
Add one end-to-end test that tracks a visitor, identifies an account, records a payment and model call, and shows profit.
README: setup, tracker and identify snippets, Stripe CLI testing, SDK wrapper usage, deployment, backup, and limitations.
Explicitly exclude GA4, PostHog, Lemon Squeezy, Anthropic, multi-currency, cross-device identity, teams, and automated model-price discovery.
Run tests and a production build before finishing, and fix every failure.

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

- Ready-made GA4, PostHog, Stripe, and Lemon Squeezy connectors.
- Maintained OpenAI and Anthropic pricing rules, including cached tokens.
- Seven language SDKs with streaming, failure, timeout, and cancellation tracking.
- Careful unknown, unpriced, unmatched, and incomplete data states.
- Managed retention, backups, source health, and production reliability.

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

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

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

## Prior art

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

- [PostHog](https://github.com/PostHog/posthog) — Open-source product analytics and LLM observability that covers two large pieces of the build
- [OpenMeter](https://github.com/openmeterio/openmeter) — Open-source usage metering infrastructure for turning model calls into auditable usage facts

---

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