Skip to content

Repository files navigation

Indeks

Self-hosted, privacy-first web analytics platform — the dashboard and ingestion service that powers the @indeks/* SDK.

TypeScript Next.js Bun ClickHouse

What is this

Indeks is the dashboard + ingestion backend you self-host to receive, store, and visualize events sent by the Indeks SDK (@indeks/core, @indeks/react). Events land in ClickHouse for fast analytical queries, while app data — users, projects, auth — lives in Postgres.

Architecture

Layer Tech
Dashboard UI Next.js 16 (Turbopack), Tailwind v4, Radix UI / Base UI, lucide-react
Ingestion API Elysia (@elysiajs/cors, @elysiajs/openapi)
Event storage ClickHouse (@clickhouse/client)
App data PostgreSQL via Neon (@neondatabase/serverless) + Drizzle ORM
Auth better-auth
Email Plunk, React Email, Nodemailer
Live visitor view cobe (interactive globe)

Events captured by the SDK are processed by the ingestion service and persisted to the database — see indeks.md for the full event schema (clicks, scrolls, sessions, rage clicks, form abandonment, performance metrics, and more).

Getting Started

Prerequisites

  • Bun
  • A PostgreSQL database (Neon recommended)
  • A ClickHouse instance

Installation

git clone https://github.com/ru-dr/indeks.git
cd indeks
bun install

Environment Variables

Create a .env in the project root. At minimum you'll need credentials for:

# Postgres (app data — users, projects, sessions)
DATABASE_URL=

# ClickHouse (event storage)
CLICKHOUSE_URL=
CLICKHOUSE_USER=
CLICKHOUSE_PASSWORD=

# Auth
BETTER_AUTH_SECRET=

# Email (Plunk)
PLUNK_API_KEY=

Exact variable names should match what's read in your config/auth setup — adjust these to whatever your code actually expects.

Development

bun run dev      # start dev server (Turbopack)
bun run build    # production build
bun run start    # start production server
bun run check    # typecheck + lint
bun run lint     # lint only

Open http://localhost:3000.

Database

Schema is managed with Drizzle (drizzle.config.ts). Use the Drizzle Kit CLI directly for generating/running migrations, e.g.:

bunx drizzle-kit generate
bunx drizzle-kit migrate

Event Schema

Full documentation of every event type and its payload — base event fields, device data, session events, rage/frustration detection, form events, performance metrics, and custom events — lives in indeks.md.

Privacy

Indeks is self-hosted by design: your event data stays in your own ClickHouse and Postgres instances. Nothing is sent to a third party.

Related

  • indeks-sdk@indeks/core, @indeks/react, @indeks/shared, the client SDK that sends events to this platform.

Deployment

Includes a vercel.json — deployable to Vercel out of the box for the Next.js app. ClickHouse and Postgres should be hosted separately.

License

No license file is currently set on this repo. Add a LICENSE to make the terms explicit (the SDK repo uses MIT, for reference).

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

Packages

Contributors

Languages