# JARVIS Finance System

MVP implementation for a local-first finance ledger and dashboard.

## Safety rules

This repository contains only:

- code
- documentation
- synthetic fixtures
- example configuration

It must never contain real financial data, SQLite databases, raw bank/broker/crypto exports, generated reports, API keys, OAuth files, or secrets.

Productive runtime data defaults to `~/jarvis_runtime/finance-system/`, outside this Git repository.

## Vue Dashboard v1 – local runtime

The Vue dashboard is a user-facing dashboard for local FastAPI/runtime data. It may automatically call the local FastAPI backend on page load, but it must not call external providers from the frontend or during normal render.

Streamlit remains the Admin/Operations/Fallback UI. Vue remains the User Dashboard.

### Backend manuell starten

```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 starten

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

### Dashboard automatisch starten

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

Optional vorhandene, durch das Script gestartete Prozesse beenden und neu starten:

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

Das Script prüft:

- Runtime venv vorhanden
- `frontend/node_modules` vorhanden; sonst Hinweis auf `npm install`
- Ports `8000` und `5173` frei
- PID-Dateien und Logs unter `~/jarvis_runtime/finance-system/logs/`

### Dashboard stoppen

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

PID-Dateien:

- `~/jarvis_runtime/finance-system/logs/finance_backend.pid`
- `~/jarvis_runtime/finance-system/logs/finance_frontend.pid`

Logs:

- `~/jarvis_runtime/finance-system/logs/finance_backend.log`
- `~/jarvis_runtime/finance-system/logs/finance_frontend.log`

### Browser URLs

- Vue Dashboard: `http://localhost:5173`
- FastAPI Health: `http://localhost:8000/api/health`

### Runtime-data UX contract

- Vue auto-loads only local FastAPI/runtime data.
- External provider calls are backend/CLI/scheduler responsibilities, never frontend render behavior.
- API base URL defaults to `http://127.0.0.1:8000` and can be overridden with `VITE_API_BASE_URL`; never place secrets in `VITE_*` variables.
- Frontend cache is session-only and refreshed via the visible `Aktualisieren` buttons.
- Keine Secrets oder API-Keys in Startbefehle, Frontend-Env oder Logs schreiben.

### Reference patterns used, without code or asset copying

- ezBookkeeping inspired the compact self-hosted finance-app structure: clear objects, dashboard cards, allocation charts, filters/tables, multi-currency readiness, and desktop/mobile/PWA thinking.
- Financial Freedom inspired privacy-first/self-hosted framing, net-worth perspective, and later budget/cashflow/goal-planning direction. Because it is GPL-3.0 and on hold/refactor, it is inspiration only, not a codebase.
