About this project

## Overview Talivia is an open-source, self-hosted analytics platform focused on revenue attribution for founders. It provides web analytics, Session Replay, team collaboration features, shared analytics dashboards, and import/export capabilities alongside direct connections to customer revenue data from payment processors. The project represents the self-hosted subset of the commercially hosted Talivia Cloud service. Managed hosting adds integrations with Google Search Console, Bing Webmaster Tools, GitHub activity, and social mentions from platforms such as X, Reddit, and TikTok. ## Features - **Web analytics**: visit tracking via an embeddable JavaScript snippet. - **Session Replay**: optional replay of user sessions on websites. - **Revenue attribution**: subscription lifecycle, refunds, disputes, first-touch and last-touch attribution. - **Payment integrations**: Stripe, LemonSqueezy, Polar, Dodo, Yolfi, and a Manual Payment API. - **Collaboration**: website collaborators and shared analytics dashboards. - **Import/export**: data migration and backup workflows. - **Crypto conversions**: optional exchange-rate conversion through CoinGecko. - **AI Agent Kit**: an open-source MCP-compatible toolkit for Codex, Claude Code, ChatGPT, and other agents to install tracking snippets, generate setup plans, verify live events, and connect visits to payment attribution. ## Technology Stack - Runtime: Node.js 22 LTS or 24 LTS - Package manager: pnpm 10+ - Database: PostgreSQL - ORM: Prisma - Containerization: Docker Engine with Docker Compose ## Setup ### Local development 1. Ensure Node.js 22/24 LTS, pnpm 10+, and a fresh PostgreSQL instance are available. 2. Copy `.env.example` to `.env` and generate a 32-byte secret with `openssl rand -hex 32`. 3. Set `DATABASE_URL` and `APP_SECRET` in `.env`. 4. Install dependencies and run migrations: ```bash pnpm install --frozen-lockfile pnpm exec prisma migrate deploy pnpm dev ``` 5. Open `http://localhost:3000` and sign in with `admin` / `admin`. Change the bootstrap password immediately under **Settings → Account**. ### Docker ```bash cp .env.example .env openssl rand -hex 32 docker compose up --build -d ``` The container applies the OSS database migration automatically before starting the application. After launch, change the default admin password. ## Configuration | Variable | Required | Purpose | |---|---|---| | `DATABASE_URL` | Yes | PostgreSQL connection string | | `APP_SECRET` | Yes | 32-byte random value for session signing and credential encryption | | `COINGECKO_API_KEY` | No | Enables crypto exchange-rate conversion; application remains functional without it | ## First use 1. Create a website entry in Talivia. 2. Insert the provided tracking snippet into the target site. 3. Confirm that a visit appears on the dashboard. 4. Enable Session Replay optionally in website settings. 5. Connect customer revenue under **Website settings → Payments**. When running behind a reverse proxy, forward the original `Host` and `X-Forwarded-Proto` headers so webhook URLs are generated correctly. ## Backups and upgrades Back up the PostgreSQL database before upgrading. For Compose deployments: ```bash docker compose exec -T postgres pg_dump -U talivia -d talivia_oss > talivia-backup.sql ``` Future releases add ordered migrations under `prisma/migrations`. Apply them with `pnpm exec prisma migrate deploy`; the official container runs this automatically on startup. Existing migrations must not be edited. ## AI Agent Kit and MCP Talivia distributes an open-source Agent Kit ([github.com/talivia-group/agent](https://github.com/talivia-group/agent)) compatible with MCP-enabled clients. Agents can install tracking, generate framework-specific setup plans, verify live analytics events, and trace visits to payment attribution. - Hosted OAuth endpoint (Talivia Cloud): `https://talivia.com/mcp` - Local stdio mode: `npx -y @talivia/agent mcp` The self-hosted edition does not expose the Talivia Cloud OAuth endpoint. ## Security and licensing Vulnerability reporting and deployment guidance are in [SECURITY.md](SECURITY.md). Development workflow details are in [CONTRIBUTING.md](CONTRIBUTING.md). Talivia is released under the MIT License. ## Comparison Talivia markets itself as an alternative to Datafast, emphasizing built-in revenue attribution and multi-processor payment integrations within a single self-hosted deployment.