This file provides guidance to Claude Code (claude.ai/code) when working with code in this repository.
Serla is a developer analytics platform (PostHog alternative) built with Next.js 16, React 19, and TypeScript. The project uses Neon (PostgreSQL) for the database with Drizzle ORM planned for type-safe queries.
npm run dev # Start development server (port 3000)
npm run build # Production build
npm run start # Start production server
npm run lint # ESLint with Next.js rules- Framework: Next.js 16 (App Router)
- Styling: Tailwind CSS 4 with dark mode first design
- Database: Neon (PostgreSQL) with connection pooling
- ORM: Drizzle ORM
- Payments: Polar.sh SDK
- Deployment: Vercel (Edge Functions, Cron Jobs)
/api/v1/events- Event ingestion (Edge Function)/api/v1/events/batch- Batch event ingestion/api/v1/identify- User identification/api/v1/export- Data export
- Use
DATABASE_URL(pooled) for application queries - Use
DATABASE_URL_UNPOOLEDfor migrations only - Index on (project_id, timestamp), (project_id, name), (session_id)
- Use pre-aggregated daily_metrics table for dashboard queries
- API keys:
Authorization: Bearer sk_live_... - Store API keys hashed, never raw
- Dark mode first, minimal aesthetic (Vercel/Polar.sh inspired)
- Near-black backgrounds (#0a0a0a, #111111)
- No emojis in UI or logging
- Professional design with subtle borders, minimal shadows
- 4px/8px spacing system with generous whitespace
When updating database models, provide the SQL for Neon DB alongside Drizzle schema changes.