Skip to content

renderorange/beep-analytics

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

13 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

beep-analytics

A lightweight, self-hosted web analytics tracker designed for simplicity and privacy.

Features

  • Simple Tracking: Lightweight JavaScript tracker that captures page views
  • Privacy-Focused: No cookies, no personal data collection
  • Self-Hosted: Complete control over your data
  • CLI Management: Command-line interface for site and token management
  • REST API: Full API for programmatic access
  • GeoIP Support: Optional geographic location tracking
  • IP Filtering: Ability to ignore specific IP addresses
  • Token Authentication: Secure API access with bearer tokens

Quick Start

# Build
go build -o beep-analytics ./cmd/beep-analytics

# Start server
./beep-analytics serve --port 8080 --db beep-analytics.db

# Generate API token
./beep-analytics generate-token

# Register a site
./beep-analytics add-site example.com

Add the tracking script to your website:

<script src="https://your-tracker-server/track.js" async></script>

Documentation

Architecture

The system consists of:

  1. Tracking Server: HTTP server that receives pageview data
  2. SQLite Database: Stores sites, pageviews, tokens, and ignored IPs
  3. JavaScript Tracker: Client-side script that sends pageview data
  4. CLI Tool: Command-line interface for management tasks

Testing

Run all unit tests:

go test ./...

Run a specific package's tests:

go test ./internal/db -v

Run the integration test (starts a real server):

go test -tags=integration -v ./tests/

Run everything (fmt, vet, unit + integration):

make check

See the Makefile for all available targets (make, make build, make test, make test-integration, etc.).

Copyright and License

beep-analytics is Copyright (c) 2026 Blaine Motsinger under the MIT license.

About

lightweight, self-hosted web analytics

Topics

Resources

License

Stars

Watchers

Forks

Contributors

Languages