Skip to main content

Documentation Index

Fetch the complete documentation index at: https://revlytics.co/docs/llms.txt

Use this file to discover all available pages before exploring further.

Docker Compose

Revlytics includes a docker-compose.yml for running ClickHouse and Redis locally:
docker-compose.yml
version: "3.8"
services:
  clickhouse:
    image: clickhouse/clickhouse-server:latest
    ports:
      - "8123:8123"
      - "9000:9000"
    volumes:
      - clickhouse_data:/var/lib/clickhouse
    environment:
      CLICKHOUSE_DB: default
      CLICKHOUSE_USER: default
      CLICKHOUSE_PASSWORD: changeme
    ulimits:
      nofile:
        soft: 262144
        hard: 262144

  redis:
    image: redis:7-alpine
    ports:
      - "6379:6379"
    volumes:
      - redis_data:/data

volumes:
  clickhouse_data:
  redis_data:

Setup steps

1

Start services

docker compose up -d
2

Apply ClickHouse schema

cat schema/clickhouse.sql | curl -s 'http://localhost:8123/' \
  --data-binary @-
Or use a ClickHouse client:
docker exec -i $(docker compose ps -q clickhouse) \
  clickhouse-client --multiquery < schema/clickhouse.sql
3

Configure environment

cp env.example .env
Edit .env with your ClickHouse, Supabase, and other credentials. See Environment Variables.
4

Install and build

npm install
npm run build
5

Start the app

npm start
The dashboard is now available at http://localhost:3000.

Production considerations

  • ClickHouse — Use ClickHouse Cloud or a managed instance for production workloads
  • PostgreSQL — Use Supabase or a managed PostgreSQL service
  • SSL — Put the app behind a reverse proxy (Nginx, Caddy) with TLS
  • Domain — Point your domain to the server and update NEXT_PUBLIC_APP_URL
  • Script hosting — Update the tracking script URL in your sites to point to your domain

Using the tracking script with self-hosted

Point the script to your self-hosted instance:
<script
  defer
  data-site="YOUR_SITE_ID"
  src="https://your-domain.com/script.js"
></script>
The script automatically detects the API endpoint from its own URL, so no data-endpoint attribute is needed when the script is served from your domain.