improve configs, update docs

This commit is contained in:
Davide Scaini
2026-03-30 13:30:43 +02:00
parent a65923c3e0
commit d806072546
14 changed files with 799 additions and 109 deletions
+41 -17
View File
@@ -12,20 +12,21 @@ BincioActivity is a self-hosted, federated activity stats platform. You point it
## How it works
```
GPX / FIT / TCX files
bincio extract ← Python CLI. Reads files, writes plain JSON.
~/bincio_data/ ← BAS data store. Human-readable JSON + GeoJSON.
edits/*.md ← Optional sidecar edits (titles, descriptions, photos).
bincio render ← Merges sidecars → _merged/. Runs Astro build.
site/dist/ ← Drop anywhere. Open index.html. Done.
GPX / FIT / TCX files Strava API
bincio extract bincio import strava ← Pull from Strava, or upload via browser ↑
└────────────┬───────────┘
~/bincio_data/ ← BAS data store. Plain JSON + GeoJSON.
edits/*.md ← Optional sidecar edits (titles, descriptions, photos).
bincio render ← Merges sidecars → _merged/. Runs Astro build.
site/dist/ ← Drop anywhere. Open index.html. Done.
```
Everything in `~/bincio_data/` is plain text you can read, edit, back up, or publish to a CDN. The site build is fully reproducible from those files.
@@ -43,10 +44,16 @@ uv sync # installs the bincio package + all dependencies
# 2. Configure
cp extract_config.example.yaml extract_config.yaml
$EDITOR extract_config.yaml # set input dirs, output dir, your name
# extract_config.yaml is gitignored — safe to add credentials here
# 3. Extract activities → BAS JSON
# 3a. Extract from local files
uv run bincio extract
# 3b. Or import from Strava
uv sync --extra strava
# Add credentials to extract_config.yaml under import.strava, then:
bincio import strava # opens browser on first run
# 4. Build the site (requires Node >= 20)
cd site && npm install && cd ..
cp site/.env.example site/.env # configure BINCIO_DATA_DIR
@@ -59,10 +66,11 @@ For live development with hot reload:
uv run bincio render --serve # merges edits, links data, starts astro dev
# → http://localhost:4321
# Optional: enable the activity edit UI
# Optional: enable the activity edit UI + file upload
uv sync --extra edit # install FastAPI + uvicorn (one-time)
uv run bincio edit # starts edit server on http://localhost:4041
# Set PUBLIC_EDIT_URL=http://localhost:4041 in site/.env
# → Edit button and ↑ Upload button appear in the site nav
```
---
@@ -112,6 +120,9 @@ uv sync # install / update dependencies
### `extract_config.yaml`
This is the single configuration file for the Python side of BincioActivity.
It is **gitignored** — safe to store credentials here. Copy from `extract_config.example.yaml`.
```yaml
owner:
handle: yourname
@@ -134,6 +145,13 @@ track:
incremental: true # skip files whose hash hasn't changed
# Strava API credentials — from strava.com/settings/api
# Authorization Callback Domain must be set to: localhost
import:
strava:
client_id: 12345
client_secret: your_client_secret_here
# Optional: athlete profile for zone overlays on HR/power charts
athlete:
max_hr: 182
@@ -211,6 +229,8 @@ At build time the renderer fetches their public data and renders it under `/frie
| Layer | Technology |
|---|---|
| Extract | Python 3.12, click, fitdecode, gpxpy, lxml |
| Strava import | requests (optional extra: `uv sync --extra strava`) |
| Edit server | FastAPI + uvicorn (optional extra: `uv sync --extra edit`) |
| Site framework | Astro 4 (static output) |
| UI components | Svelte 5 |
| Styling | Tailwind CSS v3 |
@@ -235,12 +255,16 @@ bincio/ Python package
dedup.py hash-based + near-duplicate detection
strava_csv.py Strava activities.csv reader
writer.py BAS JSON + GeoJSON writer
config.py extract_config.yaml loader (includes import.strava)
import_/
strava.py Strava OAuth2 + streams → BAS JSON
cli.py `bincio import strava` entry point
render/
cli.py `bincio render` — merge + astro build/serve
merge.py sidecar edit overlay (produces _merged/)
edit/
cli.py `bincio edit` — local edit server
server.py FastAPI write API for the edit drawer
server.py FastAPI write API (activity edits, image + file upload)
schema/
bas-v1.schema.json JSON Schema for BAS format
SCHEMA.md Human-readable BAS specification