Physics settings in UI, recipe modal cleanup, weight parseFloat fixes
Settings:
- Aero drag (CdA), air density, pedal efficiency now in GPS config
- Human-readable names: "Аэросопротивление", "Плотность воздуха", "КПД педалирования"
- Saved to localStorage, used in computeStats
Bug fixes:
- Recipe detail: overlay.remove without popHandler cleanup → now uses history.back()
- weightKg parseFloat in startRecording and importGPX (string "88" bug)
- profile.weight_kg stored as number not string
- getDailyActivityTotals: separate params for UNION ALL subqueries
Docs:
- PROJECT_MAP.md — full project structure, DB schema, screens, formulas
- README.md — overview, build instructions, data sources
2026-05-26 02:14:43 +03:00
# BalDav
Персональный трекер здоровья и физической активности.
## Возможности
2026-06-07 01:41:33 +03:00
- **Дневник питания** — 13480 продуктов из магазинов (Магнит, 5ка , KDV) + база ИОН с микронутриентами. Рецепты с учётом термообработки (потери витаминов при варке/жарке). Единицы измерения (штуки, ложки, стаканы). Ввод количества формулами (4*30, 300+50).
2026-06-26 16:47:52 +03:00
- **GPS трекинг** — запись маршрутов на велосипеде/пешком в фоне. Оффлайн карты (Leaflet + IndexedDB кэш). Импорт GPX/FTB (FitoTrack). Экспорт GPX. Фильтр altitude outlier'ов и GPS-залипаний. Вращение карты по компасу (leaflet-rotate). Ландшафтный режим (CSS rotation + панель справа). Dead reckoning при потере GPS (гироскоп + акселерометр). Placeholder до GPS (пиксельарт). Карта проезженных дорог (дедупликация 2м, вело/пешие). Импорт тайлов по регионам (SQLite, роутер LAN).
2026-06-07 01:41:33 +03:00
- **BLE пульсометр** — подключение к FitPro браслетам и стандартным HR датчикам (0x180D). ЧСС, SpO2, давление в реальном времени при записи трека.
- **Расчёт ккал** — физическая модель для велосипеда (мощность из gradient + Crr + CdA). MET-таблица для ходьбы/б е г а . Профили велосипедов. BMR по Mifflin-St Jeor с коэффициентом активности.
- **Нутриенты** — 37 микронутриентов (витамины, минералы, жирные кислоты, женьшень, ресвератрол, CoQ10). Нормы РСП/АУП (РФ/Е С /США). Фармакокинетика — запасы в организме по полураспаду.
- **Трекинг жидкости** — water_pct в продуктах, прогресс-б а р , настраиваемая норма.
- **Графики** — скорость, высота, ЧСС тренировки с зумом и pan. Тренд веса. Донат макронутриентов. Баланс ккал (приход/расход).
2026-06-18 22:55:32 +03:00
- **OTA обновления** — проверка BUILD_NUMBER на роутере (LAN) или VPS, скачивание через браузер.
- **Ручные маршруты** — рисование трека на карте тапами, elevation из прошлых треков или open-meteo API.
- **Экспорт/импорт** — свои продукты, рецепты и добавки одним файлом (JSON).
Physics settings in UI, recipe modal cleanup, weight parseFloat fixes
Settings:
- Aero drag (CdA), air density, pedal efficiency now in GPS config
- Human-readable names: "Аэросопротивление", "Плотность воздуха", "КПД педалирования"
- Saved to localStorage, used in computeStats
Bug fixes:
- Recipe detail: overlay.remove without popHandler cleanup → now uses history.back()
- weightKg parseFloat in startRecording and importGPX (string "88" bug)
- profile.weight_kg stored as number not string
- getDailyActivityTotals: separate params for UNION ALL subqueries
Docs:
- PROJECT_MAP.md — full project structure, DB schema, screens, formulas
- README.md — overview, build instructions, data sources
2026-05-26 02:14:43 +03:00
- **В е с , сон, добавки** — логирование с историей.
## Стек
- **Frontend**: чистый JavaScript, HTML, CSS. Без React/Vue/bundler.
2026-06-07 01:41:33 +03:00
- **Backend**: Rust (Tauri 2) — SQLite, IPC, seed import, BLE (btleplug на десктопе).
- **Android**: Kotlin — foreground GPS service, BLE HR service, WakeLock, SAF.
2026-06-25 21:02:37 +03:00
- **Библиотеки**: Leaflet 1.9.4 (карты), leaflet-rotate (компас), Chart.js (графики), Hammer.js (жесты), JSZip.
Physics settings in UI, recipe modal cleanup, weight parseFloat fixes
Settings:
- Aero drag (CdA), air density, pedal efficiency now in GPS config
- Human-readable names: "Аэросопротивление", "Плотность воздуха", "КПД педалирования"
- Saved to localStorage, used in computeStats
Bug fixes:
- Recipe detail: overlay.remove without popHandler cleanup → now uses history.back()
- weightKg parseFloat in startRecording and importGPX (string "88" bug)
- profile.weight_kg stored as number not string
- getDailyActivityTotals: separate params for UNION ALL subqueries
Docs:
- PROJECT_MAP.md — full project structure, DB schema, screens, formulas
- README.md — overview, build instructions, data sources
2026-05-26 02:14:43 +03:00
## Сборка
```bash
# Зависимости: Rust, Node.js, Android SDK + NDK
2026-06-07 01:41:33 +03:00
./build.sh -d android # debug APK
./build.sh android # release APK
./build.sh -i android -d # debug + установка на устройство
./build.sh -u android # release + upload на VPS (OTA)
./build.sh -d -i -u android # debug + install + upload
Physics settings in UI, recipe modal cleanup, weight parseFloat fixes
Settings:
- Aero drag (CdA), air density, pedal efficiency now in GPS config
- Human-readable names: "Аэросопротивление", "Плотность воздуха", "КПД педалирования"
- Saved to localStorage, used in computeStats
Bug fixes:
- Recipe detail: overlay.remove without popHandler cleanup → now uses history.back()
- weightKg parseFloat in startRecording and importGPX (string "88" bug)
- profile.weight_kg stored as number not string
- getDailyActivityTotals: separate params for UNION ALL subqueries
Docs:
- PROJECT_MAP.md — full project structure, DB schema, screens, formulas
- README.md — overview, build instructions, data sources
2026-05-26 02:14:43 +03:00
```
## Структура
Подробно: [PROJECT_MAP.md ](PROJECT_MAP.md )
```
frontend/
2026-06-25 21:02:37 +03:00
js/main.js — UI, навигация, модалки, компас, ландшафт (~5500 строк)
js/db.js — БД, миграции, CRUD (~1500)
js/gps.js — GPS, физика ккал, BLE HR polling (~1200)
2026-06-07 01:41:33 +03:00
js/bmr.js — BMR формула, РСП, полураспад нутриентов
2026-06-25 21:02:37 +03:00
js/sync.js — синхронизация между устройствами (LAN)
2026-06-07 01:41:33 +03:00
js/tilecache.js — оффлайн тайлы (IndexedDB)
2026-06-25 21:02:37 +03:00
css/styles.css — стили, тёмная тема, ландшафтный режим
img/gps-placeholder.png — пиксельарт заглушка до GPS
Physics settings in UI, recipe modal cleanup, weight parseFloat fixes
Settings:
- Aero drag (CdA), air density, pedal efficiency now in GPS config
- Human-readable names: "Аэросопротивление", "Плотность воздуха", "КПД педалирования"
- Saved to localStorage, used in computeStats
Bug fixes:
- Recipe detail: overlay.remove without popHandler cleanup → now uses history.back()
- weightKg parseFloat in startRecording and importGPX (string "88" bug)
- profile.weight_kg stored as number not string
- getDailyActivityTotals: separate params for UNION ALL subqueries
Docs:
- PROJECT_MAP.md — full project structure, DB schema, screens, formulas
- README.md — overview, build instructions, data sources
2026-05-26 02:14:43 +03:00
data/products_seed.db — 13480 продуктов
src-tauri/
2026-06-07 01:41:33 +03:00
src/lib.rs — Rust бэкенд, seed import
src/ble.rs — BLE HR (btleplug десктоп, file IPC Android)
gen/android/ — Kotlin: MainActivity, GpsRecorderService, BleHrService
Physics settings in UI, recipe modal cleanup, weight parseFloat fixes
Settings:
- Aero drag (CdA), air density, pedal efficiency now in GPS config
- Human-readable names: "Аэросопротивление", "Плотность воздуха", "КПД педалирования"
- Saved to localStorage, used in computeStats
Bug fixes:
- Recipe detail: overlay.remove without popHandler cleanup → now uses history.back()
- weightKg parseFloat in startRecording and importGPX (string "88" bug)
- profile.weight_kg stored as number not string
- getDailyActivityTotals: separate params for UNION ALL subqueries
Docs:
- PROJECT_MAP.md — full project structure, DB schema, screens, formulas
- README.md — overview, build instructions, data sources
2026-05-26 02:14:43 +03:00
tools/
2026-06-07 01:41:33 +03:00
5ka_scraper.user.js — Tampermonkey скрейпер 5ка
magnit_scraper.user.js — Tampermonkey скрейпер Магнит
ion_scraper.user.js — Tampermonkey скрейпер ИОН
smart/
protocol.js — FitPro BLE протокол (reverse-engineered)
hr-reader.js — Node.js прототип чтения ЧСС
Physics settings in UI, recipe modal cleanup, weight parseFloat fixes
Settings:
- Aero drag (CdA), air density, pedal efficiency now in GPS config
- Human-readable names: "Аэросопротивление", "Плотность воздуха", "КПД педалирования"
- Saved to localStorage, used in computeStats
Bug fixes:
- Recipe detail: overlay.remove without popHandler cleanup → now uses history.back()
- weightKg parseFloat in startRecording and importGPX (string "88" bug)
- profile.weight_kg stored as number not string
- getDailyActivityTotals: separate params for UNION ALL subqueries
Docs:
- PROJECT_MAP.md — full project structure, DB schema, screens, formulas
- README.md — overview, build instructions, data sources
2026-05-26 02:14:43 +03:00
```
## Данные продуктов
| Источник | Продуктов | Витамины/минералы |
|----------|-----------|-------------------|
| Магнит (SSR парсинг) | 8627 | нет |
| 5ка (API скрейпер) | 3103 | нет |
| ИОН (web.ion.ru) | 1078 | да |
| KDV (SSR парсинг) | 672 | нет |
| Обогащено из ИОН | 1398 | да (nutrients_guessed) |