Quick Start
This page covers the fastest real setup for this repository.
Want to evaluate Trackion before running infra? Start with SaaS Guide first.
Prerequisites
- Go 1.26+
- PostgreSQL 15+
- Node.js 20+
- Docker + Docker Compose (optional but recommended)
Option A: Local Development (Go + Web)
1. Start PostgreSQL
bash
docker compose up -d db2. Create .env in repo root
bash
cat > .env <<'EOF'
TRACKION_MODE=selfhost
PORT=8000
DATABASE_URL=postgres://trackion:trackion@localhost:5432/trackion?sslmode=disable
TRACKION_ADMIN_TOKEN=dev-admin-token
AUTH_SECRET=dev-auth-secret
BASE_URL=http://localhost:8000
FRONTEND_URL=http://localhost:5173
CORS_ORIGINS=*
EOF3. Run backend
bash
go run ./cmd4. Run web app
bash
cd web
pnpm install
pnpm devOpen:
- Web: http://localhost:5173
- API health: http://localhost:8000/health
Login in the web app with:
- Server URL: http://localhost:8000
- Admin token: the value of TRACKION_ADMIN_TOKEN
Option B: Docker Self-Host Stack
- Copy the env template:
bash
cp .env.selfhost.example .env.selfhost- Set secure values in .env.selfhost:
- TRACKION_ADMIN_TOKEN
- AUTH_SECRET
- POSTGRES_PASSWORD
Ensure server service is enabled in docker-compose.yml.
Start stack:
bash
docker compose up -d --buildAdd Tracker Script
Use your project API key from the dashboard:
html
<script
src="http://localhost:8000/t.js"
data-api-key="your-project-api-key"
></script>Send a Test Event
bash
curl -X POST http://localhost:8000/events/collect \
-H "Content-Type: application/json" \
-H "X-Project-Key: your-project-api-key" \
-d '{
"event": "quick_start_test",
"session_Id": "session-1",
"page": {
"path": "/quick-start",
"title": "Quick Start"
},
"properties": {"source": "docs"}
}'Then open the dashboard to confirm the event appears.