A personal Strava analytics app that tracks additional statistics.
- Sync activities from Strava
- Detect stops during rides/runs
- Identify stops near traffic lights using OpenStreetMap data
- View activity details with route visualization
- Download activity data as JSON for testing
- Native iOS prototype with backend-owned Strava sign-in
- Go 1.22+
- Strava API credentials (create an app)
-
Clone the repository:
git clone https://github.com/ptmt/weirdstats.git cd weirdstats -
Create a
.envfile from the example and fill in your Strava credentials:cp .env.example .env
-
Run the app:
go run ./cmd/weirdstats
For OAuth flows behind Strava callbacks, set BASE_URL to the public URL that reaches your server. BASE_URL=weirdstats.com is accepted and normalized to https://weirdstats.com. The iOS prototype under ios/README.md uses the mobile endpoints exposed by the backend.
docker build -t weirdstats .docker run -p 8080:8080 \
-v weirdstats-data:/data \
-e STRAVA_CLIENT_ID=your_client_id \
-e STRAVA_CLIENT_SECRET=your_client_secret \
weirdstatsOr with an env file:
docker run -p 8080:8080 \
-v weirdstats-data:/data \
--env-file .env \
weirdstatsservices:
weirdstats:
build: .
ports:
- "8080:8080"
volumes:
- weirdstats-data:/data
env_file:
- .env
volumes:
weirdstats-data:See .env.example for all available configuration options.
Mobile/iOS-related variables:
BASE_URL: used to derive/connect/strava/callback,/connect/strava/mobile/callback, and/webhookMOBILE_APP_REDIRECT_URL: optional native-app callback likeweirdstats://auth/strava
GitHub Actions workflows are included:
- Test (
test.yml): Runs on every push and PR tomain - Docker (
docker.yml): Builds and publishes to GitHub Container Registry on push tomainor version tags
docker pull ghcr.io/yourusername/weirdstats:maingo test ./...go test -race -coverprofile=coverage.out ./...
go tool cover -html=coverage.outInstall and run Air for automatic reloading during development:
go install github.com/air-verse/air@latest
airIf air is not in your PATH, you can run it directly:
go run github.com/air-verse/air@latestOr use the full path:
$(go env GOPATH)/bin/aircurl http://localhost:8080/healthz- Without Strava credentials, the server still runs but activity fetching will fail when the worker processes items.
- Use a SQLite viewer or
sqlite3to inspectweirdstats.dbif needed. - The server runs a background worker loop to process the queue (see
SPEC.mdfor workflow). - Webhook verification uses GET
/webhook?hub.challenge=...&hub.verify_token=.... - POST
/webhookchecksX-Strava-SignaturewhenSTRAVA_WEBHOOK_SECRETis set.
MIT