Installation
Run the Open Analytics dashboard on your machine or deploy it to any Node.js host that supports Next.js (Vercel, Docker, etc.).
Requirements
- Node.js 18+ (LTS recommended)
- One Supabase project for the app (sign-in + site list — see Supabase setup)
- One Supabase project per website you measure (your analytics data)
- npm, pnpm, or yarn
Clone and configure
git clone <your-repo-url> open-analytics cd open-analytics cp .env.example .env.local
.env.local is only for the dashboard app, not for your analytics projects:
| Variable | Description |
|---|---|
NEXT_PUBLIC_SUPABASE_URL | App Supabase project URL |
NEXT_PUBLIC_SUPABASE_ANON_KEY | App publishable key (sign-in) |
SUPABASE_SERVICE_ROLE_KEY | App Secret key — server saves sites to app DB after sign-in |
NEXT_PUBLIC_APP_URL | Public URL of this app (used in embed snippets and geo proxy), e.g. https://analytics.example.com |
Run supabase/schema-app.sql on the app Supabase project in .env. When you add a website, run supabase/schema-analytics.sql on your tracking project and enter its Project ID + publishable key.
Run locally
npm install npm run dev
Open the URL shown in the terminal (often port 3000). Sign in, then add a website with your analytics Supabase credentials.
Production build
npm run build npm run start
Set NEXT_PUBLIC_APP_URL to your HTTPS origin before building. Add https://your-domain.com/auth/callback to Supabase Auth redirect URLs.