3de6b05357
Nuevo flujo: por defecto conecta a sqlite_api en localhost:8484. Si la API no responde, cae a SQLite directo. Flag --api para URL custom. Launcher PowerShell actualizado con --api. app.md refleja la nueva arquitectura dual HTTP/SQLite y dir_path del proyecto. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
88 lines
2.8 KiB
Markdown
88 lines
2.8 KiB
Markdown
---
|
|
name: registry_dashboard
|
|
lang: cpp
|
|
domain: tui
|
|
description: "Dashboard ImGui para visualizar el estado del fn_registry. Consume datos via sqlite_api HTTP (fallback a SQLite directo). KPIs, charts, tablas, desglose por lenguaje/dominio/pureza."
|
|
tags: [dashboard, imgui, visualization, registry, http]
|
|
uses_functions:
|
|
- kpi_card_cpp_viz
|
|
- bar_chart_cpp_viz
|
|
- pie_chart_cpp_viz
|
|
- table_view_cpp_viz
|
|
- sparkline_cpp_viz
|
|
- dashboard_panel_cpp_core
|
|
- dashboard_grid_cpp_core
|
|
- fps_overlay_cpp_core
|
|
- fullscreen_window_cpp_core
|
|
uses_types: []
|
|
framework: "imgui"
|
|
entry_point: "main.cpp"
|
|
dir_path: "projects/fn_monitoring/apps/registry_dashboard"
|
|
repo_url: "https://gitea-dgg044oo04woo4ggcsws4gk0.organic-machine.com/dataforge/registry_dashboard"
|
|
---
|
|
|
|
## Arquitectura
|
|
|
|
Dashboard C++ con dos modos de acceso a datos:
|
|
|
|
1. **HTTP API** (primario): Conecta a `sqlite_api` via HTTP para obtener datos de registry.db. No requiere acceso al filesystem.
|
|
2. **SQLite directo** (fallback): Lee registry.db directamente si la API no esta disponible.
|
|
|
|
**Data layers:**
|
|
- `data_http.cpp`: Carga datos via HTTP POST a sqlite_api (cpp-httplib + nlohmann/json)
|
|
- `data.cpp`: Carga directa desde SQLite C API
|
|
|
|
**Views** (`views.cpp`): Compone funciones del registry C++ para renderizar:
|
|
- 8 KPI cards: functions, types, apps, analysis, unit tests, proposals, tested%, pure%
|
|
- Bar charts: funciones por lenguaje, por dominio
|
|
- Pie charts: pureza (pure/impure), kind (function/pipeline/component)
|
|
- Tablas: ultimas 20 funciones, apps, analysis, tipos
|
|
|
|
## Build
|
|
|
|
```bash
|
|
# Linux
|
|
cd cpp && cmake -B build/linux -S . && cmake --build build/linux --target registry_dashboard -j$(nproc)
|
|
|
|
# Windows (cross-compile)
|
|
cd cpp && cmake -B build/windows -S . -DCMAKE_TOOLCHAIN_FILE=toolchains/mingw-w64.cmake && cmake --build build/windows --target registry_dashboard -j$(nproc)
|
|
```
|
|
|
|
## Ejecucion
|
|
|
|
```bash
|
|
# Via API (default, intenta conectar a localhost:8484)
|
|
./registry_dashboard
|
|
|
|
# API explicita
|
|
./registry_dashboard --api http://192.168.1.10:8484
|
|
|
|
# Con SQLite fallback
|
|
./registry_dashboard --api http://127.0.0.1:8484 /path/to/registry.db
|
|
|
|
# Solo SQLite (sin API)
|
|
./registry_dashboard /path/to/registry.db
|
|
|
|
# Windows (PowerShell)
|
|
.\registry_dashboard.ps1
|
|
```
|
|
|
|
## Dependencias vendored
|
|
|
|
| Libreria | Version | Archivo |
|
|
|----------|---------|---------|
|
|
| cpp-httplib | v0.18.3 | vendor/httplib.h |
|
|
| nlohmann/json | v3.11.3 | vendor/nlohmann/json.hpp |
|
|
|
|
## Roadmap
|
|
|
|
- [ ] Filtros interactivos por lenguaje/dominio en sidebar
|
|
- [ ] Busqueda FTS5 integrada via API
|
|
- [ ] Detalles de funcion al hacer click en tabla
|
|
|
|
## Notas
|
|
|
|
- Por defecto intenta conectar a sqlite_api en `http://127.0.0.1:8484`. Si falla, usa SQLite directo.
|
|
- SQLite compilado estaticamente en Windows via amalgamation vendoreada. En Linux usa libsqlite3 del sistema.
|
|
- cpp-httplib usa sockets nativos (no OpenSSL) — solo HTTP, no HTTPS.
|