{"id":44682160,"url":"https://github.com/metehankurucu/litemetrics","last_synced_at":"2026-04-22T19:01:14.020Z","repository":{"id":337228075,"uuid":"1152177080","full_name":"metehankurucu/litemetrics","owner":"metehankurucu","description":"Open-source analytics SDK you can integrate into your product. Give your users a beautiful analytics dashboard in 5 minutes.","archived":false,"fork":false,"pushed_at":"2026-03-24T20:18:18.000Z","size":3545,"stargazers_count":3,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2026-03-26T01:28:04.392Z","etag":null,"topics":["analytics","analytics-tracking","litemetrics","react","self-hosted","tracking"],"latest_commit_sha":null,"homepage":"https://litemetrics.dev","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/metehankurucu.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2026-02-07T13:35:44.000Z","updated_at":"2026-03-25T17:39:05.000Z","dependencies_parsed_at":null,"dependency_job_id":null,"html_url":"https://github.com/metehankurucu/litemetrics","commit_stats":null,"previous_names":["metehankurucu/litemetrics"],"tags_count":5,"template":false,"template_full_name":null,"purl":"pkg:github/metehankurucu/litemetrics","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/metehankurucu%2Flitemetrics","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/metehankurucu%2Flitemetrics/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/metehankurucu%2Flitemetrics/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/metehankurucu%2Flitemetrics/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/metehankurucu","download_url":"https://codeload.github.com/metehankurucu/litemetrics/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/metehankurucu%2Flitemetrics/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":32150396,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-22T17:06:48.269Z","status":"ssl_error","status_checked_at":"2026-04-22T17:06:19.037Z","response_time":58,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.5:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["analytics","analytics-tracking","litemetrics","react","self-hosted","tracking"],"created_at":"2026-02-15T05:01:25.631Z","updated_at":"2026-04-22T19:01:13.927Z","avatar_url":"https://github.com/metehankurucu.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"\u003cp align=\"center\"\u003e\n  \u003cimg src=\"logo.png\" alt=\"Litemetrics\" width=\"200\" /\u003e\n\u003c/p\u003e\n\n\u003ch1 align=\"center\"\u003eLitemetrics\u003c/h1\u003e\n\n\u003cp align=\"center\"\u003e\n  \u003cstrong\u003eOpen-source analytics you can integrate into your product.\u003c/strong\u003e\u003cbr/\u003e\n  Give your users a beautiful analytics dashboard in 5 minutes.\n\u003c/p\u003e\n\n\u003cp align=\"center\"\u003e\n  \u003ca href=\"https://demo.litemetrics.dev\"\u003e\u003cstrong\u003eLive Demo\u003c/strong\u003e\u003c/a\u003e •\n  \u003ca href=\"#quick-start\"\u003eQuick Start\u003c/a\u003e •\n  \u003ca href=\"#packages\"\u003ePackages\u003c/a\u003e •\n  \u003ca href=\"#deploy\"\u003eDeploy\u003c/a\u003e •\n  \u003ca href=\"#docs\"\u003eDocs\u003c/a\u003e •\n  \u003ca href=\"https://github.com/metehankurucu/litemetrics/issues\"\u003eIssues\u003c/a\u003e\n\u003c/p\u003e\n\n\u003cp align=\"center\"\u003e\n  \u003ca href=\"https://demo.litemetrics.dev\"\u003e\u003cimg src=\"https://img.shields.io/badge/%E2%96%B6%EF%B8%8F_Live_Demo-demo.litemetrics.dev-00c853?style=for-the-badge\u0026labelColor=1a1a2e\" alt=\"Live Demo\" /\u003e\u003c/a\u003e\n\u003c/p\u003e\n\n\u003cp align=\"center\"\u003e\n  \u003ca href=\"https://railway.com/template/OQI8lX?referralCode=LpQIoM\"\u003e\u003cimg src=\"https://railway.com/button.svg\" alt=\"Deploy on Railway\" /\u003e\u003c/a\u003e\n\u003c/p\u003e\n\n\u003cbr/\u003e\n\n\u003cp align=\"center\"\u003e\n  \u003cimg src=\"examples/demo.png\" alt=\"Litemetrics Dashboard\" width=\"100%\" style=\"border-radius: 8px;\" /\u003e\n\u003c/p\u003e\n\n\u003cbr/\u003e\n\n\u003cp align=\"center\"\u003e\n  \u003cstrong\u003eAI Agent Skill:\u003c/strong\u003e\u0026nbsp; \u003ccode\u003enpx skills add metehankurucu/litemetrics\u003c/code\u003e\u003cbr/\u003e\n  \u003csub\u003eGives your AI coding agent (Claude Code, Cursor, Windsurf) full knowledge of Litemetrics integration patterns.\u003c/sub\u003e\n\u003c/p\u003e\n\n\u003cbr/\u003e\n\n## Why Litemetrics?\n\n| | |\n|---|---|\n| **Embed into your product** | Drop a full analytics stack into your app — tracker, server, query API, and a pre-built dashboard UI. Your customers get analytics without you building anything. |\n| **Your brand, your colors** | 10 built-in theme presets. CSS custom properties for full control. Dark mode included. Ship analytics that look like they belong in your app. |\n| **Multi-tenant ready** | Each customer gets isolated analytics via `site_id`. One database, zero cross-contamination. Built for SaaS from day one. |\n| **Lightweight tracker** | ~3 KB gzipped. Auto-tracks pageviews, sessions, scroll depth, button clicks, outbound links — or go fully manual. |\n| **ClickHouse \u0026 MongoDB** | Choose the database that fits. ClickHouse for speed at scale, MongoDB for simplicity. Swap with one env var. |\n| **One-click deploy** | Docker Compose, Railway, or a single Docker container. Up and running in under a minute. |\n\n\u003cbr/\u003e\n\n## Quick Start\n\n### 1. Add a dashboard to your app\n\n```bash\nnpm install @litemetrics/ui\n```\n\n```tsx\nimport { LitemetricsProvider, AnalyticsDashboard } from '@litemetrics/ui';\n\nfunction CustomerDashboard({ customerId }) {\n  return (\n    \u003cLitemetricsProvider baseUrl=\"/api/stats\" siteId={customerId}\u003e\n      \u003cAnalyticsDashboard theme=\"midnight\" /\u003e\n    \u003c/LitemetricsProvider\u003e\n  );\n}\n```\n\n### 2. Add tracking to your site\n\n```html\n\u003cscript src=\"https://your-server.com/litemetrics.js\"\u003e\u003c/script\u003e\n\u003cscript\u003e\n  Litemetrics.createTracker({\n    siteId: 'your-site-id',\n    endpoint: 'https://your-server.com/api/collect'\n  });\n\u003c/script\u003e\n```\n\n### 3. Add the server (Express)\n\n```bash\nnpm install @litemetrics/node\n```\n\n```ts\nimport express from 'express';\nimport { createCollector } from '@litemetrics/node';\n\nconst app = express();\napp.use(express.json());\n\nconst collector = await createCollector({\n  db: { url: 'http://localhost:8123' },\n});\n\napp.all('/api/collect', (req, res) =\u003e collector.handler()(req, res));\napp.all('/api/stats', (req, res) =\u003e collector.queryHandler()(req, res));\n\napp.listen(3002);\n```\n\n\u003e For MongoDB: `db: { adapter: 'mongodb', url: 'mongodb://localhost:27017/myapp' }`\n\n### 4. Run the mobile app (Expo)\n\n```bash\ncd apps/mobile\nbun install\nbun run start\n```\n\nFor platform-specific launches:\n\n```bash\nbun run ios\nbun run android\n```\n\n### 5. Query from the terminal (CLI)\n\n```bash\nbun add -g @litemetrics/cli\n```\n\n```bash\n# Configure once\nexport LITEMETRICS_URL=https://your-server.com\nexport LITEMETRICS_ADMIN_SECRET=your-secret\nexport LITEMETRICS_SITE_ID=your-site-id\n\n# Overview of all metrics\nlitemetrics overview -p 7d --compare\n\n# Top pages\nlitemetrics stats top_pages -p 30d -l 10\n\n# Time series\nlitemetrics timeseries visitors -p 30d -g day\n\n# JSON output for AI agents\nlitemetrics overview -p 7d -f json\n```\n\nSee [`packages/cli/README.md`](./packages/cli/README.md) for all commands.\n\n\u003cbr/\u003e\n\n## Deploy\n\n### Docker Compose (recommended)\n\n```bash\ngit clone https://github.com/metehankurucu/litemetrics.git\ncd litemetrics\nADMIN_SECRET=your-secret docker compose up -d\n```\n\nOpen `http://localhost:3002` for the dashboard.\n\n### Docker (standalone)\n\n```bash\ndocker build -t litemetrics .\ndocker run -p 3002:3002 \\\n  -e CLICKHOUSE_URL=http://your-clickhouse:8123 \\\n  -e ADMIN_SECRET=your-secret \\\n  litemetrics\n```\n\n### Railway (one click)\n\n1. Click the **Deploy on Railway** button above\n2. Add a ClickHouse plugin (or MongoDB)\n3. Set `CLICKHOUSE_URL` (or `MONGODB_URL`) and `ADMIN_SECRET`\n4. Done — dashboard, API, and tracker served from one container\n\n### Environment Variables\n\n| Variable | Description | Default |\n|----------|-------------|---------|\n| `DB_ADAPTER` | Database adapter (`clickhouse` or `mongodb`) | `clickhouse` |\n| `CLICKHOUSE_URL` | ClickHouse connection URL | `http://localhost:8123` |\n| `MONGODB_URL` | MongoDB connection string | `mongodb://localhost:27017/litemetrics` |\n| `ADMIN_SECRET` | Secret for admin access and site management | _(none)_ |\n| `PORT` | Server port | `3002` |\n| `GEOIP` | Enable GeoIP lookup | `true` |\n| `TRUST_PROXY` | Trust X-Forwarded-For headers | `true` |\n\n\u003e `DATABASE_URL` and `LITEMETRICS_ADMIN_SECRET` also work as aliases.\n\n\u003cbr/\u003e\n\n## Architecture\n\n```\n┌──────────────────┐         ┌──────────────────┐         ┌──────────────────┐\n│                  │  POST   │                  │  GET    │                  │\n│  @litemetrics/   │ /collect│  @litemetrics/   │ /stats  │  @litemetrics/   │\n│  tracker         ├────────\u003e│  node            │\u003c────────┤  dashboard       │\n│                  │         │  (collector)     │         │                  │\n│  ~3KB, browser   │ events  │  ClickHouse /    │ queries │  React UI        │\n│                  │         │  MongoDB         │         │                  │\n└──────────────────┘         └──────────────────┘         └──────────────────┘\n     Browser / App                Your Server           ▲     Dashboard\n                                                        │\n                                                   ┌────┴─────────────┐\n                                                   │  @litemetrics/   │\n                                                   │  cli             │\n                                                   │  Terminal / AI   │\n                                                   └──────────────────┘\n```\n\nThe tracker handles session management, visitor IDs, batching, and SPA detection client-side. The server stores events and runs queries. The CLI provides terminal access to all analytics data — designed for both humans and AI agents. The Docker image bundles everything into a single container.\n\n\u003cbr/\u003e\n\n## Packages\n\n| Package | Description |\n|---------|-------------|\n| [`@litemetrics/ui`](./packages/ui) | Pre-built React dashboard components (10 themes, dark mode, CSS variables) |\n| [`@litemetrics/tracker`](./packages/tracker) | Browser tracker (~3 KB gzipped) |\n| [`@litemetrics/node`](./packages/node) | Server collector, ClickHouse/MongoDB adapters, query API |\n| [`@litemetrics/react`](./packages/react) | React provider and hooks |\n| [`@litemetrics/react-native`](./packages/react-native) | React Native / Expo provider |\n| [`@litemetrics/client`](./packages/client) | Typed client for reading analytics data |\n| [`@litemetrics/cli`](./packages/cli) | CLI tool for querying analytics and managing sites |\n| [`@litemetrics/core`](./packages/core) | Shared types and constants |\n\n### Apps\n\n| App | Description |\n|-----|-------------|\n| [`@litemetrics/dashboard`](./apps/dashboard) | Analytics dashboard (React + Vite + Tailwind) |\n| [`@litemetrics/server`](./apps/server) | Self-hosted server (serves dashboard + API) |\n| [`@litemetrics/mobile`](./apps/mobile) | Native mobile analytics app (Expo Router + React Native) |\n| [`@litemetrics/landing`](./apps/landing) | Landing page (React + Vite + Tailwind) |\n\n\u003cbr/\u003e\n\n## Metrics\n\n`pageviews` · `visitors` · `sessions` · `events` · `conversions` · `top_pages` · `top_referrers` · `top_countries` · `top_cities` · `top_events` · `top_conversions` · `top_exit_pages` · `top_transitions` · `top_scroll_pages` · `top_button_clicks` · `top_link_targets` · `top_devices` · `top_browsers` · `top_os` · `top_os_versions` · `top_device_models` · `top_app_versions` · `top_utm_sources` · `top_utm_mediums` · `top_utm_campaigns` · `top_utm_terms` · `top_utm_contents` · `top_channels` · `timeseries` · `retention`\n\n\u003cbr/\u003e\n\n## Auto Events \u0026 Insights\n\n- Auto events are tagged with `event_source=auto` and a subtype (`scroll_depth`, `button_click`, `link_click`, `outbound_click`).\n- Manual `track()` events default to `event_source=manual` and `event_subtype=custom`.\n- All metrics and time series support segmentation filters (geo, device, UTM, referrer, event metadata).\n- The dashboard **Insights** view surfaces exit pages, transitions, scroll-heavy pages, and click hotspots.\n\n\u003cbr/\u003e\n\n## Docs\n\n- [Getting Started](./docs/getting-started.md)\n- [Integration Guide](./docs/integration-guide.md) — React, React Native, Next.js, Vue, Python, PHP, Ruby, Go\n- [API Reference](./docs/api-reference.md)\n- [Dashboard](./docs/dashboard.md)\n- [CLI](./packages/cli/README.md)\n- [Mobile App](./apps/mobile/README.md)\n- [Self-Hosting](./docs/self-hosting.md)\n- [Scaling](./docs/scaling.md)\n\n\u003cbr/\u003e\n\n## Development\n\n```bash\ngit clone https://github.com/metehankurucu/litemetrics.git\ncd litemetrics\nbun install\nbun run build\n```\n\n\u003cbr/\u003e\n\n## License\n\nMIT\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmetehankurucu%2Flitemetrics","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmetehankurucu%2Flitemetrics","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmetehankurucu%2Flitemetrics/lists"}