Skip to content

Repository files navigation

InsightBoard logo

InsightBoard

A self-hosted product analytics platform: a tracking SDK, an event pipeline, and a dashboard.

Backend Frontend Analytics SDK

InsightBoard is a Mixpanel/Amplitude-style product analytics stack you run yourself: drop the JS SDK into a web app, events flow through a FastAPI ingestion API and Kafka into ClickHouse, and a React dashboard turns that into event trends, retention funnels, session heatmaps, and custom boards.

Features

  • Event ingestion API: JWT-authenticated, Redis-backed sliding-window rate limiting, batches published to Kafka.
  • JS/TS tracking SDK: batches events client-side, buffers to localStorage when offline, flushes on an interval.
  • Streaming aggregation: a Kafka consumer batches events into ClickHouse (MergeTree/SummingMergeTree tables, partitioned by month) and rolls up hourly/daily aggregates for fast dashboard queries.
  • Dashboard: event trends, a funnel builder, session heatmaps, a drag-and-drop custom dashboard builder, and a live event feed, all in React + TypeScript + Tailwind.

Architecture

flowchart LR
    APP[Your web app] -->|track events| SDK[InsightBoard JS SDK]
    SDK -->|batched POST /track| API

    subgraph API["Ingestion API (FastAPI)"]
        AUTH[JWT auth]
        RATE[Redis rate limiter]
    end

    API -->|events| KAFKA[(Kafka)]
    KAFKA --> AGG[Aggregator\nbatch consumer]
    AGG -->|raw + rollups| CH[(ClickHouse)]

    DASH[React Dashboard] -->|queries| CH
    DASH -->|auth| API
Loading

Quickstart

git clone https://github.com/Heet852003/InsightBoard.git
cd InsightBoard
docker compose up -d

Or run each piece directly:

# Ingestion API
cd backend/api
pip install -r requirements.txt
uvicorn app.main:app --reload

# Aggregator (separate terminal)
cd backend/aggregator
pip install -r requirements.txt
python app/main.py

# Dashboard (separate terminal)
cd frontend/dashboard
npm install
npm start

Prerequisites: Node 16+, Python 3.9+, PostgreSQL, Kafka, Redis, ClickHouse (or just use docker compose up -d).

Using the SDK

import InsightBoard from "insightboard-sdk";

const ib = new InsightBoard({ apiKey: "YOUR_KEY", apiUrl: "https://your-api/track" });
ib.init("user-123");

ib.track("signed_up", { plan: "pro" });

Events are queued client-side and flushed every 5 seconds (configurable), so calling track never blocks the caller on a network round trip.

Repository layout

backend/api/          FastAPI ingestion API: auth, rate limiting, Kafka producer
backend/aggregator/    Kafka consumer that batches events into ClickHouse
frontend/dashboard/    React + TypeScript dashboard
sdk/js/                TypeScript client SDK (published as insightboard-sdk)

License

MIT. See LICENSE for details.

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages