# FinanceManager Inventory

**Stand:** 2026-06-13 17:01 CEST  
**Quelle:** lokale Code-Arbeitskopie `/home/agent/.hermes/repos/FinanceManager` und Code-/Doku-Dateien, ohne produktive Runtime-Daten zu öffnen.  
**Remote:** `Gamexgit/FinanceManager`, privat, Branch `main`. Lokale Arbeitskopie war beim Inventar `main...origin/main [voraus 3]`.

## Datenschutz- und Sicherheitsstatus

FinanceManager dokumentiert selbst:

- Repository enthält nur Code, Dokumentation, synthetische Fixtures und Beispielkonfiguration.
- Keine echten Finanzdaten, SQLite-Datenbanken, Bank-/Broker-/Crypto-Exporte, Reports, API Keys, OAuth-Dateien oder Secrets in Git.
- Produktive Runtime liegt außerhalb des Repositories unter `~/jarvis_runtime/finance-system/`.

**Bewertung:** Grün für Code-Inventar, Rot für direkte Runtime-Datenintegration.

## Tech Stack

### Backend

- Python Package: `jarvis-finance`
- Python: `>=3.11`
- API optional dependencies: `fastapi`, `uvicorn`, `yfinance`
- Reports optional dependency: `jinja2`
- Tests: `pytest`
- Lint: `ruff`
- Backend app: `src/jarvis_finance/api/main.py`
- FastAPI title: `JARVIS Finance API`
- API version: `0.1.0`

### Frontend

- Vue 3
- Vite
- TypeScript
- PrimeVue
- Pinia
- Vue Router
- Chart.js
- lightweight-charts
- Vitest/jsdom tests

Frontend package: `frontend/package.json`

## Startbefehle

### Backend manuell

```bash
cd /home/agent/.hermes/repos/FinanceManager
source ~/jarvis_runtime/finance-system/venv/bin/activate
PYTHONPATH=src uvicorn jarvis_finance.api.main:app --host 127.0.0.1 --port 8000
```

### Frontend manuell

```bash
cd /home/agent/.hermes/repos/FinanceManager/frontend
npm run dev -- --host 0.0.0.0 --port 5173
```

### Dashboard automatisch

```bash
cd /home/agent/.hermes/repos/FinanceManager
./scripts/start_vue_dashboard.sh
```

Optional:

```bash
./scripts/start_vue_dashboard.sh --kill-existing
```

### Dashboard stoppen

```bash
cd /home/agent/.hermes/repos/FinanceManager
./scripts/stop_vue_dashboard.sh
```

## Ports und URLs

| Zweck | Port | Host/URL | Bewertung |
|---|---:|---|---|
| FastAPI Backend | 8000 | `http://127.0.0.1:8000` oder `0.0.0.0:8000` im Startscript | Grün für sanitized read-only Status |
| Vue Frontend | 5173 | `http://127.0.0.1:5173`, Tailscale Host/IP möglich | Grün als Legacy Link |
| Streamlit Admin/Fallback | 8503 laut CORS erlaubt | genaue Startquelle nicht final inventarisiert | Gelb, Admin UI nicht als MVP-Integration |

CORS erlaubt u.a.:

- `http://localhost:5173`
- `http://127.0.0.1:5173`
- `http://100.85.29.67:5173`
- `http://agent.tailbd371b.ts.net:5173`
- `http://localhost:8503`
- `http://127.0.0.1:8503`

## Produktive Runtime-Pfade

- Runtime Base: `~/jarvis_runtime/finance-system/`
- DB default: abgeleitet aus Runtime, typischerweise `~/jarvis_runtime/finance-system/data/finance.sqlite3`
- Logs: `~/jarvis_runtime/finance-system/logs/`
- Backend PID: `~/jarvis_runtime/finance-system/logs/finance_backend.pid`
- Frontend PID: `~/jarvis_runtime/finance-system/logs/finance_frontend.pid`
- Backend Log: `~/jarvis_runtime/finance-system/logs/finance_backend.log`
- Frontend Log: `~/jarvis_runtime/finance-system/logs/finance_frontend.log`

**No-Go:** Diese Runtime-Pfade nicht in Git kopieren, nicht im Jarvis Dashboard direkt browsen, keine produktive SQLite öffnen/kopieren.

## Vorhandene Dashboards

### Vue User Dashboard

- Pfad: `frontend/`
- Start: `npm run dev -- --host 0.0.0.0 --port 5173`
- Zweck: User-facing Dashboard für lokale FastAPI-/Runtime-Daten.
- Externe Provider Calls sollen nicht aus dem Frontend und nicht während normalem Render passieren.

**Integration:** Grün als Legacy-Link, Gelb für native Datenübernahme über Adapter.

### Streamlit Admin/Operations/Fallback

- Laut README bleibt Streamlit Admin/Operations/Fallback UI.
- Nicht als primäre Jarvis-Integration vorgesehen.

**Integration:** Gelb/Rot. Nur als separater Admin-Link, nicht auf JARVIS Startseite.

## Vorhandene APIs

FastAPI inkludiert Router unter Prefix `/api`:

- `health`
- `overview`
- `crypto`
- `equity`
- `cash`
- `reports`
- `positions`
- `budget`
- `system`
- `market`

### Besonders relevante Read-only API-Endpunkte

#### Runtime / Health / Provider Status — sofort relevant

| Endpoint | Methode | Beschreibung | Ampel | Begründung |
|---|---|---|---|---|
| `/api/health` | GET | API-Liveness: Status, App, API-Version, Mode | Grün | Keine Finanzdaten; direkt als ModuleStatus nutzbar |
| `/api/runtime/status` | GET | DB verfügbar, DB-Pfad, Währung, Runtime außerhalb Repo, write_mode | Gelb | Enthält lokalen DB-Pfad; für globales Dashboard Pfad nur redacted/boolean anzeigen |
| `/api/provider/status` | GET | Sanitized Provider Labels für CoinGecko/OpenFIGI, aktuell Placeholder | Grün | Explizit ohne Secret-Werte; gut für Provider-Karte |
| `/api/system/status` | GET | Backend/Frontend Ports, Runtime DB available, last_restart | Gelb | Runtime-/Log-Referenzen redacted; keine Restart-Action im MVP |

#### Command Center / Overview

| Endpoint | Methode | Beschreibung | Ampel | Begründung |
|---|---|---|---|---|
| `/api/overview/finance-command-center` | GET | Monats-/Import-/Budget-/Portfolio-Kompaktstatus, Todos | Gelb | Nützlich, aber enthält Geldbeträge und potenziell sensitive Labels; nur Adapter mit Redaction/Count-Auswahl |
| `/api/overview` | GET | PortfolioSummary | Gelb/Rot für Startseite | Enthält Vermögens-/Portfolio-Werte; nur in geschützter Finance-Detailansicht oder redacted |

#### Budget Read-only Kandidaten

| Endpoint | Methode | Ampel | Begründung |
|---|---|---|---|
| `/api/budget/import-status-audit` | GET | Grün/Gelb | Amount-free Import-/Review-/Quality-Counts; sehr guter read-only Kandidat, aber Labels sanitizen |
| `/api/budget/review-backlog` | GET | Gelb | Review-Backlog kann Merchants/Quellen enthalten; nur Counts global |
| `/api/budget/monthly-import/dashboard` | GET | Gelb | Gut für Importstatus, aber Dateinamen/Quellen sanitizen |
| `/api/budget/monthly-import/history` | GET | Gelb | History kann Dateinamen enthalten; nur letzte Importzeit/Status/Counts |
| `/api/budget/dashboard/cockpit` | GET | Gelb | Potenziell breit; nur Adapter-Auszug |
| `/api/budget/overview` | GET | Gelb | Möglicherweise Beträge; nicht global roh anzeigen |
| `/api/budget/status/categories` | GET | Gelb/Rot | Kategorie-/Budgetdetails; nicht auf globaler Startseite |
| `/api/budget/recurring` | GET | Gelb/Rot | Fixkosten/Abos sensitiv; nur Counts/Warnings |

#### Cash / Portfolio / Market Read-only Kandidaten

| Endpoint | Methode | Ampel | Begründung |
|---|---|---|---|
| `/api/cash/summary` | GET | Gelb/Rot | Konten/Beträge; nur Finance-Detail mit Schutz, nicht global |
| `/api/crypto/positions` | GET | Gelb/Rot | Positionen/Beträge; nicht global roh |
| `/api/equity/positions` | GET | Gelb/Rot | Positionen/Beträge; nicht global roh |
| `/api/market/status` | GET | Grün/Gelb | Provider-/Market-Status geeignet, falls ohne Beträge/Secrets |
| `/api/equity/{instrument_id}/quote` | GET | Gelb | Marktdaten öffentlich, aber Instrument-ID kann Portfolio ableiten |

#### Reports

| Endpoint | Methode | Ampel | Begründung |
|---|---|---|---|
| `/api/reports` | GET | Gelb | Report-Metadaten gut, aber keine Report-Dateien oder Pfade roh |
| `/api/reports/files/{report_path:path}` | GET | Rot für Global Dashboard | Direkter Dateiabruf; Risiko für sensitive Reports/Pfade |

### POST-/Mutation-Endpunkte

FinanceManager besitzt viele Preview-/Confirm-Endpunkte, z.B. für Positions, Budget, Accounts, Tags, Transfers, Reports, System Restart.

**MVP-Bewertung:** Rot/deaktiviert.  
**Begründung:** Auch wenn Preview/Confirm vorhanden ist, gelten im JARVIS Gesamtdashboard neue Gateway-Regeln. Erst nach eigenem Contract, Gateway-Audit und expliziter Freigabe integrieren.

Besonders kritisch:

- `/api/system/restart-*` — Systemänderungen.
- `/api/market/*/update-*` — Provider Calls / Datenaktualisierung.
- `/api/reports/generate`, `/api/reports/monthly` — schreibt Reports.
- Alle `*/confirm`, `*/archive`, `*/delete`, `*/apply`, `*/merge`.

## Sensitive Datenbereiche

### Nicht öffnen/kopieren/committen

- `~/jarvis_runtime/finance-system/data/*.sqlite*`
- Runtime Logs mit potenziellen Details
- Bank-/Broker-/Crypto-Exports
- Importdateien CSV/XLS/XLSX
- Generated Reports
- Provider Credentials, OAuth, API Keys
- `config` mit echten Pfaden/Secrets, falls nicht Beispiel
- Frontend `.env*` mit `VITE_*`, falls Werte sensitive Hosts/Tokens enthalten

### Sanitizing erforderlich

- DB-Pfade aus `/api/runtime/status`
- Report-Pfade aus `/api/reports`
- Dateinamen aus Import-History
- Merchant-/Account-/Category-Labels
- Geldbeträge und Portfolio-Werte
- last_restart Worker Logs/Pfade

## Backup-/Restore-Mechanismen

### Vorhanden / dokumentiert

- Runtime außerhalb Repo als Sicherheitsprinzip.
- Reports werden in Runtime Reports Directory erzeugt, nicht im Repo.
- `Makefile` enthält `git-safety`:

```bash
python -m jarvis_finance.cli.main git-safety-scan .
```

- Startscript schreibt Logs/PIDs extern unter Runtime.
- ADR-0002 dokumentiert Runtime außerhalb Repo.

### Noch offen

- Vollständiges produktives Backup-/Restore-Runbook wurde in dieser Inventarphase nicht abschließend gefunden.
- Für JARVIS Integration zunächst nur Status erfassen, nicht Backup auslösen.

## Geeignete Integrationspunkte

### Grün — sofort read-only integrierbar

1. `/api/health`
   - Modul-Liveness.
   - Keine Finanzdaten.

2. `/api/provider/status`
   - Sanitized Provider Status Placeholder.
   - Gut für Provider-KPI: `Provider: unknown/configured/error`.

3. `/api/budget/import-status-audit`
   - Amount-free Counts.
   - Ideal für Attention Item: offene Review-Kandidaten / Importqualität.
   - Adapter sollte nur Counts übernehmen.

4. Legacy Link zum Vue Dashboard
   - Keine Datenübernahme, nur Navigation.

### Gelb — nur mit Sanitizing/Adapter

1. `/api/runtime/status`
   - Nur `db_available`, `runtime_outside_repo`, `write_mode`, `base_currency` anzeigen.
   - `db_path` redacted.

2. `/api/system/status`
   - Nur service up/down + Ports.
   - `last_restart` gekürzt/redacted.
   - Keine Restart Buttons im MVP.

3. `/api/overview/finance-command-center`
   - Maximal: open_review_candidates, missing_prices_fx, critical_alerts, data_quality.status, import source status.
   - Keine Beträge auf globaler Startseite.

4. `/api/reports`
   - Nur Anzahl/letzter Report/Typ.
   - Keine Datei-Downloads global.

### Rot — nicht ins Gesamtdashboard MVP

- Alle Confirm-/Delete-/Archive-/Apply-/Restart-Endpunkte.
- Direkter Report-Dateiabruf.
- Portfolio-/Cash-/Crypto-/Equity-Positionslisten auf globaler Startseite.
- Budget-Detailtabellen mit Merchants/Beträgen.
- Importdateien, Exporte, SQLite Runtime DB.

## Vorschlag für JARVIS Finance Module Card

Maximal 3 KPIs:

1. **API:** online/offline aus `/api/health`.
2. **Reviews:** Anzahl offener Review-Kandidaten aus sanitized Import Audit oder Command Center.
3. **Provider:** Provider-Status aggregiert aus `/api/provider/status`.

Attention Items, maximal global 5:

- Finance review backlog > 0.
- Runtime DB unavailable.
- Provider status error/rate_limited.
- Missing import source in current month.

## Priorität für technische Umsetzung

1. Finance health/status adapter: `/api/health` + sanitized `/api/runtime/status`.
2. Finance provider adapter: `/api/provider/status`.
3. Finance import audit adapter: `/api/budget/import-status-audit`, nur Counts.
4. Finance command-center adapter: nur erlaubte Counts, keine Beträge.
5. Finance detail view später, geschützt und mit redacted defaults.
