siraaj

command module
v1.0.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 8, 2025 License: AGPL-3.0 Imports: 18 Imported by: 0

README ΒΆ

Siraaj Logo

Siraaj Analytics

Privacy-First, Self-Hosted Web Analytics

Go DuckDB License Docker

Fast, lightweight analytics platform built with Go and DuckDB. Track your web traffic without cookies or compromising privacy.


✨ Features

  • πŸ”’ Privacy-First - No cookies, GDPR compliant
  • ⚑ Lightning Fast - DuckDB delivers sub-50ms queries
  • πŸ“Š Real-Time Dashboard - Beautiful Svelte UI
  • 🎯 Simple Integration - Drop-in JavaScript SDK (< 5KB)
  • 🌍 Multi-Project - Track unlimited websites
  • πŸ“ˆ Funnel Analysis - Measure conversions
  • πŸ€– Bot Detection - Filter automated traffic
  • 🎨 Channel Attribution - Understand traffic sources

πŸš€ Quick Start

Docker:

docker run -d -p 8080:8080 -v $(pwd)/data:/data mohamedelhefni/siraaj:latest

Docker Compose:

version: '3.8'
services:
  siraaj:
    image: mohamedelhefni/siraaj:latest
    ports: ["8080:8080"]
    volumes: ["./data:/data"]
    environment:
      - DUCKDB_MEMORY_LIMIT=4GB
    restart: unless-stopped

Build from Source:

git clone https://github.com/mohamedelhefni/siraaj.git && cd siraaj
go build -o siraaj && ./siraaj

Dashboard: http://localhost:8080/

Pre-built binaries coming soon! ⭐


οΏ½ Usage

Add SDK to your website:

<script>
  !function(){var s=document.createElement('script');
  s.src='http://your-server:8080/sdk/analytics.js';s.defer=!0;
  document.head.appendChild(s);s.onload=function(){
    window.siraaj=new Analytics({
      apiUrl:'http://your-server:8080',
      projectId:'my-website',
      autoTrack:true
    });
  }}();
</script>

Track custom events:

siraaj.track('purchase', { product: 'Premium', price: 99 });
siraaj.identify('user-123', { plan: 'premium' });

Framework integrations: React, Vue, Svelte, Next.js β†’ SDK Docs


βš™οΈ Configuration

Key Environment Variables:

PORT=8080                           # Server port
DB_PATH=data/analytics.db           # Database path
DUCKDB_MEMORY_LIMIT=4GB             # Memory limit
DASHBOARD_USERNAME=admin            # Optional auth
DASHBOARD_PASSWORD=secret           # Optional auth
CORS=https://example.com            # CORS origins

API Endpoints: /api/track, /api/stats, /api/funnel, /api/channels β†’ Full API Docs


πŸ—οΈ Tech Stack

Backend: Go 1.24 + DuckDB + Parquet
Frontend: SvelteKit 5 + Tailwind
SDK: Vanilla JS/TypeScript
Architecture: Clean Architecture (domain, repository, service, handler)


🀝 Contributing

Contributions welcome! Fork, create a feature branch, and submit a PR.

go mod download && cd dashboard && pnpm install && cd .. && make test

Built with ❀️ by Mohamed Elhefni

⭐ Star this repo if you find it useful!

Documentation ΒΆ

The Go Gopher

There is no documentation for this package.

Directories ΒΆ

Path Synopsis
internal
mocks
Package mocks is a generated GoMock package.
Package mocks is a generated GoMock package.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL