How poltavtcev-dev/biofocus-platform works
BioFocus is a local-first personal self-tracking platform: it collects context and wearable observations, accepts and persists data locally, derives metrics and insights, and presents results in desktop and companion apps. The graph preserves those distinct product stages and major documented analysis/reporting branches. Dashed links with null evidence mark likely runtime connections whose wiring was not visible in the supplied excerpts; sampled-source edges are cited where their references or calls are shown.
Main entry points: App.tsx Desktop shell · routes.rs LAN ingest API · src/engine.rs Feature computation · src/engine.rs Insight and recommendation rules
Components 18
Data collection
- macOS collectors
crates/macos-collector/src - Health companion
apps/companion/ios - Companion sync client
apps/companion/ios/IngestClient.swift
Ingestion and storage
- Observation contracts
crates/bio-spec/src/observation.rs - LAN ingest API
crates/ingest/src/routes.rs - Normalize and dedupe
crates/pipeline/src/normalize.rs - Observation storage
crates/storage/src/observation_repo.rs
Analysis
- Feature computation
crates/feature-engine/src/engine.rs - Metric catalog
crates/feature-engine/src/catalog - Insight and recommendation rules
crates/knowledge-engine/src/engine.rs - Product rules
crates/knowledge-engine/src/rules/mod.rs - Report generation
crates/report-engine/src/builder.rs - LLM report support
crates/report-engine/src/llm.rs
User applications
- Desktop shell
apps/desktop/src/App.tsx - Analysis dashboard
apps/desktop/src/Dashboard.tsx - Life event interface
apps/desktop/src/LifeEventsBlock.tsx - Desktop Rust host
apps/desktop/src-tauri/src
Other components
- Self-tracking user
Connections 20
- Self-tracking user → macOS collectors: enables collection
- Self-tracking user → Health companion: syncs health data
- macOS collectors → Observation contracts: produces observations
- Health companion → Companion sync client: queues sync
- Companion sync client → LAN ingest API: posts observations
- LAN ingest API → Normalize and dedupe: accepts observations
- Normalize and dedupe → Observation storage: persists observations
- Observation storage → Feature computation: supplies observations
- Feature computation → Metric catalog: runs nodes
crates/feature-engine/src/engine.rs - Feature computation → Insight and recommendation rules: provides features
- Insight and recommendation rules → Product rules: evaluates rules
crates/knowledge-engine/src/engine.rs - Insight and recommendation rules → Report generation: provides insights
- Report generation → LLM report support: supports generation
crates/report-engine/src/llm.rs - Desktop shell → Analysis dashboard: renders dashboard
apps/desktop/src/App.tsx - Desktop shell → Life event interface: renders events
apps/desktop/src/App.tsx - Desktop shell → Desktop Rust host: uses commands
- Analysis dashboard → Life event interface: shows event data
apps/desktop/src/Dashboard.tsx - Self-tracking user → Desktop shell: views results
- Observation contracts → LAN ingest API: defines payloads
- LAN ingest API → Observation contracts: validates data