A lightweight web analytics solution with three main components: a tracking script, collection backend, and analytics dashboard.
├── frame/ # Frontend dashboard (Next.js)
├── ink/ # Tracking script (JavaScript)
├── paper/ # Collection backend (Go)
└── studio/ # Dashboard backend (Go)
You can view the system design here.
- Next.js web application that visualizes analytics data
- Features:
- Site management dashboard
- Simple analytics data visualization with charts and metrics
- Checkout the github repository here
- Lightweight JavaScript snippet that website owners add to their sites
- Collects basic analytics data:
- Page views
- User agent info
- Referrer data
- Makes HTTP requests to Paper backend to store events
- Checkout the github repository here
- Configuration via
window.clutterConfig
:
window.clutterConfig = {
siteId: "your-site-id"
}
- Go service that accepts analytics events from Ink
- Features:
- CORS support for cross-origin requests
- Request validation
- ClickHouse database for event storage
- API Endpoints:
POST /api/event
- Records analytics events
- Checkout the github repository here
- Go service that powers the Frame frontend
- Features:
- User authentication with JWT
- Site management (CRUD operations)
- Analytics data access from ClickHouse
- Key APIs:
/auth
- User registration/login/sites
- Site management/sites/{id}/analytics
- Analytics data retrieval
- Checkout the github repository here
- PostgreSQL - User and site data (Studio)
- ClickHouse - Analytics events data (Paper)
- Redis - Stores data that needs to be quickly communicated between Studio and Paper.
Requirements:
- Go 1.24+
- Node.js
- PostgreSQL
- ClickHouse
- Redis
Environment variables:
# Studio
DATABASE_URL=postgres://user:pass@localhost:5432/db
CLICKHOUSE_URL=clickhouse://default:@localhost:9000/clutter
PORT=8081
JWT_SECRET=secret
# Paper
DATABASE_URL=clickhouse://default:@localhost:9000/clutter
REDIS_URL=redis://user:pass@localhost:6379
POSTGRES_URL=postgres://user:pass@localhost:5432/db
PORT=8080
This is a basic analytics implementation with core features like:
- Site tracking via JavaScript snippet
- Event collection API
- User authentication
- Site management
- Basic analytics viewing
This project is still under progress.