{"id":50607250,"url":"https://github.com/remcostoeten/analytics","last_synced_at":"2026-06-06T00:04:07.283Z","repository":{"id":342991617,"uuid":"1156370581","full_name":"remcostoeten/analytics","owner":"remcostoeten","description":"Private, first-party analytics platform with centralized ingestion, SDK, and dashboard. Cookie-free, GDPR-friendly, self-hosted on Neon Postgres.","archived":false,"fork":false,"pushed_at":"2026-04-22T15:14:52.000Z","size":1062,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"master","last_synced_at":"2026-04-22T15:29:08.862Z","etag":null,"topics":["analytics","bun","cookie-free","drizzle-orm","first-party","gdpr","hono","neon","nextjs","postgres","privacy","react","self-hosted","typescript","vercel"],"latest_commit_sha":null,"homepage":null,"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/remcostoeten.png","metadata":{"files":{"readme":"README.md","changelog":null,"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":"AGENTS.md","dco":null,"cla":null}},"created_at":"2026-02-12T15:18:18.000Z","updated_at":"2026-04-22T15:14:56.000Z","dependencies_parsed_at":null,"dependency_job_id":null,"html_url":"https://github.com/remcostoeten/analytics","commit_stats":null,"previous_names":["remcostoeten/analytics"],"tags_count":3,"template":false,"template_full_name":null,"purl":"pkg:github/remcostoeten/analytics","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/remcostoeten%2Fanalytics","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/remcostoeten%2Fanalytics/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/remcostoeten%2Fanalytics/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/remcostoeten%2Fanalytics/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/remcostoeten","download_url":"https://codeload.github.com/remcostoeten/analytics/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/remcostoeten%2Fanalytics/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":33964367,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-26T15:22:16.424Z","status":"online","status_checked_at":"2026-06-05T02:00:06.157Z","response_time":120,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"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","bun","cookie-free","drizzle-orm","first-party","gdpr","hono","neon","nextjs","postgres","privacy","react","self-hosted","typescript","vercel"],"created_at":"2026-06-06T00:04:06.749Z","updated_at":"2026-06-06T00:04:07.259Z","avatar_url":"https://github.com/remcostoeten.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Remco Analytics\n\nPremium, first-party analytics platform with centralized ingestion, dedicated SDK, and a high-performance dashboard. Cookie-free, privacy-first, and self-hosted on Neon Postgres.\n\n[![License: MIT](https://img.shields.io/badge/License-MIT-black.svg)](https://opensource.org/licenses/MIT)\n[![TypeScript](https://img.shields.io/badge/TypeScript-5.7-blue.svg)](https://www.typescriptlang.org/)\n[![npm version](https://img.shields.io/npm/v/@remcostoeten/analytics.svg)](https://www.npmjs.com/package/@remcostoeten/analytics)\n[![Deployment](https://img.shields.io/badge/Deployment-Live-success.svg)](https://remcostoeten-analytics-demo.vercel.app)\n\n[Live Demo](https://remcostoeten-analytics-demo.vercel.app) | [NPM Package](https://www.npmjs.com/package/@remcostoeten/analytics)\n\n![Dashboard Preview](./dashboard_preview.png)\n\n## Packages\n\n| Package | Purpose | Tech |\n| :--- | :--- | :--- |\n| `apps/example-dashboard` | Modern analytics UI with ⌘K command palette | Next.js 16.2, React 19, Recharts |\n| `apps/ingestion` | High-throughput Hono ingestion service | Hono, Zod, Vercel Edge |\n| `packages/sdk` | Client-side tracking library (@remcostoeten/analytics) | TypeScript, Fetch/Beacon API |\n| `apps/ingestion/src/db` | Database schema and client | Neon Postgres, Drizzle ORM |\n\n## Tech Stack\n\n- **Framework:** Next.js 16.2 (Turbopack), React 19\n- **Database:** Neon Postgres (Serverless)\n- **ORM:** Drizzle\n- **Styling:** Vanilla CSS, Lucide Icons\n- **Runtime:** Bun\n- **Hosting:** Vercel\n\n## Installation (Ingestion Service)\n\nThe ingestion service is the core entry point for all tracking events.\n\n```bash\n# Clone and install\ngit clone https://github.com/remcostoeten/analytics.git\ncd analytics\nbun install\n\n# Configure environment\ncp .env.example .env\n# Set DATABASE_URL and IP_HASH_SECRET (min 32 chars)\n\n# Setup Database\ncd apps/ingestion\nbun run db:push\n\n# Start Ingestion\ncd ../../apps/ingestion\nbun run dev\n```\n\n## Ingestion Contract\n\n- `GET /health` - Service health monitor\n- `POST /ingest` - Accepts event payloads (validated via Zod)\n  - Bot detection (40+ patterns)\n  - Geo-extraction (headers)\n  - Secure IP hashing (no raw IP storage)\n\n## Hosting\n\n### 1. Database (Neon)\nCreate a project on [Neon.tech](https://neon.tech) and get your `DATABASE_URL`.\n\n### 2. Dashboard \u0026 Ingestion (Vercel)\nBoth `apps/example-dashboard` and `apps/ingestion` are designed for Vercel deployment.\n\n```bash\n# Deploy Dashboard\ncd apps/example-dashboard\nvercel --prod\n\n# Deploy Ingestion\ncd apps/ingestion\nvercel --prod\n```\n\n### Required Environment Variables\n| Variable | Description |\n| :--- | :--- |\n| `DATABASE_URL` | Neon Postgres connection string |\n| `IP_HASH_SECRET` | Secret key for hashing visitor IP addresses |\n\n## SDK Quick Start\n\n```bash\nbun add @remcostoeten/analytics\n```\n\n```tsx\nimport { Analytics } from '@remcostoeten/analytics'\n\nexport default function App() {\n  return (\n    \u003c\u003e\n      \u003cComponent /\u003e\n      \u003cAnalytics projectId=\"my-app\" ingestUrl=\"https://analytics.yourdomain.com/api/ingest\" /\u003e\n    \u003c/\u003e\n  )\n}\n```\n\n---\nMIT © Remco Stoeten","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fremcostoeten%2Fanalytics","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fremcostoeten%2Fanalytics","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fremcostoeten%2Fanalytics/lists"}