https://github.com/remcostoeten/analytics
Private, first-party analytics platform with centralized ingestion, SDK, and dashboard. Cookie-free, GDPR-friendly, self-hosted on Neon Postgres.
https://github.com/remcostoeten/analytics
analytics bun cookie-free drizzle-orm first-party gdpr hono neon nextjs postgres privacy react self-hosted typescript vercel
Last synced: 15 days ago
JSON representation
Private, first-party analytics platform with centralized ingestion, SDK, and dashboard. Cookie-free, GDPR-friendly, self-hosted on Neon Postgres.
- Host: GitHub
- URL: https://github.com/remcostoeten/analytics
- Owner: remcostoeten
- License: mit
- Created: 2026-02-12T15:18:18.000Z (4 months ago)
- Default Branch: master
- Last Pushed: 2026-04-22T15:14:52.000Z (about 2 months ago)
- Last Synced: 2026-04-22T15:29:08.862Z (about 2 months ago)
- Topics: analytics, bun, cookie-free, drizzle-orm, first-party, gdpr, hono, neon, nextjs, postgres, privacy, react, self-hosted, typescript, vercel
- Language: TypeScript
- Size: 1.01 MB
- Stars: 0
- Watchers: 0
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
- Agents: AGENTS.md
Awesome Lists containing this project
README
# Remco Analytics
Premium, first-party analytics platform with centralized ingestion, dedicated SDK, and a high-performance dashboard. Cookie-free, privacy-first, and self-hosted on Neon Postgres.
[](https://opensource.org/licenses/MIT)
[](https://www.typescriptlang.org/)
[](https://www.npmjs.com/package/@remcostoeten/analytics)
[](https://remcostoeten-analytics-demo.vercel.app)
[Live Demo](https://remcostoeten-analytics-demo.vercel.app) | [NPM Package](https://www.npmjs.com/package/@remcostoeten/analytics)

## Packages
| Package | Purpose | Tech |
| :--- | :--- | :--- |
| `apps/example-dashboard` | Modern analytics UI with ⌘K command palette | Next.js 16.2, React 19, Recharts |
| `apps/ingestion` | High-throughput Hono ingestion service | Hono, Zod, Vercel Edge |
| `packages/sdk` | Client-side tracking library (@remcostoeten/analytics) | TypeScript, Fetch/Beacon API |
| `apps/ingestion/src/db` | Database schema and client | Neon Postgres, Drizzle ORM |
## Tech Stack
- **Framework:** Next.js 16.2 (Turbopack), React 19
- **Database:** Neon Postgres (Serverless)
- **ORM:** Drizzle
- **Styling:** Vanilla CSS, Lucide Icons
- **Runtime:** Bun
- **Hosting:** Vercel
## Installation (Ingestion Service)
The ingestion service is the core entry point for all tracking events.
```bash
# Clone and install
git clone https://github.com/remcostoeten/analytics.git
cd analytics
bun install
# Configure environment
cp .env.example .env
# Set DATABASE_URL and IP_HASH_SECRET (min 32 chars)
# Setup Database
cd apps/ingestion
bun run db:push
# Start Ingestion
cd ../../apps/ingestion
bun run dev
```
## Ingestion Contract
- `GET /health` - Service health monitor
- `POST /ingest` - Accepts event payloads (validated via Zod)
- Bot detection (40+ patterns)
- Geo-extraction (headers)
- Secure IP hashing (no raw IP storage)
## Hosting
### 1. Database (Neon)
Create a project on [Neon.tech](https://neon.tech) and get your `DATABASE_URL`.
### 2. Dashboard & Ingestion (Vercel)
Both `apps/example-dashboard` and `apps/ingestion` are designed for Vercel deployment.
```bash
# Deploy Dashboard
cd apps/example-dashboard
vercel --prod
# Deploy Ingestion
cd apps/ingestion
vercel --prod
```
### Required Environment Variables
| Variable | Description |
| :--- | :--- |
| `DATABASE_URL` | Neon Postgres connection string |
| `IP_HASH_SECRET` | Secret key for hashing visitor IP addresses |
## SDK Quick Start
```bash
bun add @remcostoeten/analytics
```
```tsx
import { Analytics } from '@remcostoeten/analytics'
export default function App() {
return (
<>
>
)
}
```
---
MIT © Remco Stoeten