A miniature self-hosted analytics platform. Capture events from your app, view dashboards, and roll out features with percentage-based feature flags. [Just for learning purposes, not production-ready.]
- Event ingestion via API key —
POST /api/capture/ - Dashboard: total events, unique users, events per day
- Redis caching and rate limiting on the capture endpoint
- Background tasks with Celery and Celery Beat
- Activity log on project changes via Django signals
- PostgreSQL for relational data, ClickHouse for event storage
- Redpanda (Kafka-compatible) as the message broker between capture and ClickHouse
- JWT authentication — signup, login, token refresh
- Organization membership with three roles: Member, Admin, Owner
- Feature flags with hash-based percentage rollout —
GET /api/decide/ - React frontend — projects, dashboard, API key management, feature flags
| Layer | Technology |
|---|---|
| Web framework | Django 6 + Django REST Framework |
| Database | PostgreSQL 16 |
| Cache + task broker | Redis 7 |
| Message broker | Redpanda v26.1.12 (Kafka-compatible) |
| Analytics store | ClickHouse 26.6 |
| Background tasks | Celery + Celery Beat |
| Auth | djangorestframework-simplejwt |
| Frontend | React + Vite + TypeScript + Tailwind CSS |
Prerequisites: Docker, Python 3.12, Node.js / Bun
1. Start infrastructure
docker compose up -d2. Backend
python -m venv .venv
source .venv/bin/activate
pip install -r requirements.txt
cp .env.example .env
python manage.py migrate
python manage.py setup_clickhouse
python manage.py createsuperuser
python manage.py runserver3. Celery (optional)
celery -A config worker -l info
celery -A config beat -l info4. Frontend
cd frontend
bun install
bun run devFrontend at http://localhost:5173. Backend at http://localhost:8000.
unset PYTHONPATH
source .venv/bin/activate
python -m pytesttinyhog/
config/ settings, urls, celery
accounts/ User, Organization, OrganizationMembership
projects/ Project, ActivityLog, signals
events/ capture endpoint, Redpanda producer, ClickHouse queries
flags/ FeatureFlag model, /api/decide/ endpoint
frontend/ React + Vite app
docker-compose.yaml