# How to Vibe Code Your Own DataFast (and Stop Paying for It)

> Discover which marketing channels drive your revenue

- Site: https://datafa.st
- Category: Web Analytics & Revenue Attribution
- Verdict: **Solid side project** (68/100 vibecodeable)
- Estimated effort: 2-3 weeks part-time

## Verdict

Build a personal subset for your own SaaS analytics; payment webhook attribution and MCP scaffolding will test your patience.

DataFast combines a standard event tracking pixel with a complex multi-provider payment webhook reconciler and a custom MCP server. While an AI coding agent can scaffold the Next.js frontend, charts, and API endpoints instantly, stitching together reliable cross-domain revenue attribution with Stripe and LemonSqueezy webhooks requires careful database schema design and local tunnel debugging. Building a clean personal analytics clone for your own projects is a rewarding multi-weekend endeavor, but replacing a polished commercial tool with thousands of users is impractical.

### What you can't replicate

- Pre-existing integrations with 21,000+ active indie hacker users
- Direct cross-promotion loops from the ShipFast ecosystem
- Instant trust and brand authority of the creator

## What it does

Revenue-first analytics platform tracking traffic sources, custom goals, conversion funnels, and payment processor webhooks for indie hackers.

### Core features

- Lightweight tracking snippet injection (cookie & cookieless modes)
- Event ingestion pipeline for pageviews, custom goals, and funnels
- Payment gateway webhook receiver (Stripe, LemonSqueezy) linking sessions to buyers
- Analytics dashboard with charts, referrer breakdowns, and revenue-per-visitor metrics
- Model Context Protocol (MCP) server for AI coding agent queries
- Command Line Interface (CLI) for terminal-based analytics inspection
- Social mention tracking for X and Reddit

## The business

### Pricing

- Starter: $9 / mo — For solo founders getting started with a single website.
- Growth: $19 / mo — For established businesses with multiple sites.

Founded 2026.
Team size: 1 (Solo founder - Marc Lou).

## The hard parts

- Asynchronous webhook reconciliation matching browser session cookies to external payment processor customer IDs
- High-frequency event aggregation and time-series rollups without hitting database bottlenecks
- Designing a robust MCP transport server with safe token scoping and confirmation gates

## How to vibe code DataFast

### Prerequisites

- Node.js (free): Required for running the Next.js development server, building the CLI tool, and executing MCP scripts.
- GitHub (free): Version control and automated deployment configuration for the tracking backend and dashboard.
- Cursor (free tier / $20/mo Pro): AI-native code editor to rapidly build out the dashboard views, event ingestion router, and MCP protocol handlers.

### Recommended AI tools

- Cursor: Best-in-class IDE for iterating rapidly across backend API routes, tracking scripts, and complex dashboard UI layouts.
- Claude Code: Ideal agentic CLI companion for scaffolding the `@datafast/cli` package and implementing the MCP server specification.

### Stack

- Frontend: Next.js with Tailwind CSS and Recharts
- Backend: Next.js API Routes / Server Actions
- Database: Turso (SQLite at the edge for ultra-fast analytics inserts)
- Auth: better-auth
- Payments: Stripe
- Other: TypeScript, Zod for request validation, Model ContextProtocol SDK

### Hosting

- Vercel (Hosting the Next.js web application, dashboard, tracking script endpoints, and the MCP Streamable HTTP server.): $0/mo (Hobby Tier)
- Turso (Serverless SQLite database storing high-volume analytics events, website metadata, and goal configurations.): $0/mo (Free Tier)

### Build guide

1. **Project Scaffolding & Database Schema** — Initialize the Next.js project with Tailwind CSS, configure Turso database connection, and define schemas for websites, events, visitors, and revenue attribution.

```
Create a new Next.js project with TypeScript, Tailwind CSS, and App Router. Set up Turso client using `@libsql/client` with environment variables `TURSO_DATABASE_URL` and `TURSO_AUTH_TOKEN`. Write a migration script to create tables: `websites` (id, domain, user_id, created_at), `events` (id, website_id, visitor_id, event_type, path, referrer, utm_source, utm_medium, utm_campaign, timestamp), `visitors` (id, website_id, first_seen, user_agent, country), and `payments` (id, website_id, visitor_id, amount, currency, processor, external_id, created_at). Ensure proper indexes on `website_id`, `visitor_id`, and `timestamp` for fast analytics querying.
```

2. **Lightweight Tracking Script & Ingestion API** — Build the client-side JavaScript tracking snippet (`script.js`) and the high-throughput ingestion endpoint to record pageviews and custom events.

```
Build an ingestion API route at `POST /api/send` that accepts analytics events containing `site_key`, `event_type`, `path`, `referrer`, and UTM parameters. Extract visitor IP and User-Agent headers, hash them securely for GDPR compliance if needed, assign a persistent visitor cookie if not present, and asynchronously batch insert records into the `events` and `visitors` tables in Turso. Next, create a lightweight vanilla JavaScript tracking script (`public/js/script.js`) that captures page views using `navigator.sendBeacon` or `fetch`, automatically parsing document.referrer and URL query parameters.
```

3. **Payment Webhook Attribution Engine** — Implement webhook listeners for Stripe and LemonSqueezy to capture checkout events and link external customer payments back to visitor sessions.

```
Create API route handlers for payment webhooks at `POST /api/webhooks/stripe` and `POST /api/webhooks/lemonsqueezy`. When a checkout session completes or an invoice is paid, extract the customer email, payment amount, and metadata (or fallback to matching recent visitor sessions by metadata or customer fingerprint). Store the transaction in the `payments` table linked to the appropriate `website_id` and `visitor_id`. Compute revenue attribution metrics by aggregating event traffic sources leading up to the matched `visitor_id`.
```

4. **Analytics Dashboard UI & Revenue Metrics** — Construct the main analytics dashboard with overview charts, referrer tables, goal tracking, and revenue-per-visitor metrics.

```
Build the main analytics dashboard UI in Next.js using Tailwind CSS and Recharts. Create components for: 1) Overview summary cards (Total Visitors, Pageviews, Conversion Rate, Total Revenue, Revenue per Visitor), 2) Time-series line chart for traffic and revenue trends, 3) Referrer breakdown table with traffic counts and attributed revenue, and 4) Goal and conversion funnel configuration screens. Add date-range filtering (today, 7d, 30d, custom) and website selector dropdowns querying internal analytics endpoints.
```

5. **Model Context Protocol (MCP) Server** — Implement a Streamable HTTP MCP server allowing AI coding assistants like Claude Code and Cursor to query analytics data and manage website settings in natural language.

```
Implement an MCP server endpoint at `POST /api/mcp` using the Model Context Protocol TypeScript SDK supporting Streamable HTTP transport. Authenticate requests via Bearer token validation checking against user account tokens (`dft_...`) or website keys (`df_...`). Implement tools following the naming convention `datafast_<resource>_<action>`: `datafast_analytics_overview`, `datafast_visitors_search`, `datafast_websites_list`, and `datafast_goals_create`. Enforce safety checks: require `confirm: true` for destructive tools, ensure API keys never expose full secret strings, and validate token permissions against the requested website ID.
```

6. **Command Line Interface (CLI)** — Build the `@datafast/cli` package allowing users to log in, manage websites, and query analytics directly from the terminal.

```
Create a companion Node.js CLI package `@datafast/cli` using Commander.js. Implement commands: `datafast login` (opens browser or prompts for token input, saving credentials securely to `~/.config/datafast/config.json`), `datafast websites list`, `datafast analytics overview`, and `datafast visitors search`. Add global flags `--json` for compact JSON output and `--verbose` for request debugging. Support environment variable overrides via `DATAFAST_TOKEN` and `DATAFAST_API_BASE`.
```

### Cost vs paying

**Starting costs (one-time):**

- Custom domain (optional): $12/yr
- Total: ~$12 one-time

**Ongoing costs (monthly):**

- Vercel Hobby & Turso Free Tier: $0/mo
- Total: $0/mo

- Paying for the SaaS instead: $9 - $19 / mo
- Build time: 25-35 hours
- AI tool credits: $20 (Cursor Pro)
- Break-even: N/A (Built for personal use)

## Sources

- [DataFast Official Website](https://datafa.st)
- [DataFast MCP Documentation](https://datafa.st/docs/mcp-introduction)
- [DataFast CLI Documentation](https://datafa.st/docs/cli-introduction)
- [DataFast GDPR and Cookieless Tracking](https://datafa.st/docs/gdpr-cookieless-tracking)
- [DataFast Twitter Mentions](https://datafa.st/docs/twitter-mentions)
- [DataFast Twitter Link Attribution](https://datafa.st/docs/twitter-link-attribution)