# FinanceManager Vue Tailnet + TrueWealth source handling

## Trigger

Use this note when exposing the FinanceManager dashboard over Tailnet, continuing Phase 8 / Portfolio Advisor work, or mapping TrueWealth holdings/source documents.

## Durable lessons

1. **Do not expose the legacy Streamlit UI as the user-facing FinanceManager dashboard.**
   - The modern dashboard is the Vue/PrimeVue frontend under `FinanceManager/frontend`.
   - The legacy Streamlit app under `src/jarvis_finance/dashboard/main.py` can look like an old product state and should not be used for Sir's normal preview.

2. **Correct Tailnet shape for Vue previews:**
   - Start the Finance FastAPI on an internal/local port, e.g. `127.0.0.1:<api_port>` with `JARVIS_FINANCE_RUNTIME_DIR=/home/agent/jarvis_runtime/finance-system`.
   - Start the Vue frontend with Vite bound to `0.0.0.0:<frontend_port>`.
   - Configure Vite to proxy `/api` to the local Finance API; browser-side calls should use same-origin `/api/...`, not hard-coded `127.0.0.1`, otherwise Tailnet clients see the backend as offline.
   - Verify from the Tailnet URL: page loads, `/api/health` returns the Finance API health, the Vue shell shows backend/runtime DB available, and browser console has no JS errors.

3. **Avoid port confusion with other dashboards.**
   - `5173` / `8000` may already belong to another app such as FamilyDashboard.
   - Discover listeners before starting FinanceManager. Prefer a clean pair such as Vue `5175` + Finance API `8010` if defaults are occupied.

4. **Existing data is canonical unless proven duplicate.**
   - Sir may already have partial TrueWealth ETFs, PostFinance stocks, cash/accounts, and budget data in the SQLite runtime DB.
   - TrueWealth import work must reconcile against existing instruments/accounts first and must not blindly insert duplicates.

5. **Drive source for TrueWealth portfolio composition.**
   - Besides `Finanzen/04 TrueWealth`, inspect `Finanzen/01 Aktueller Stand Portfolios`.
   - Important source file: `260514_Portfolio True Wealth.docx`.
   - Also related: `260514_Portfolio Postfinance.docx`, `260514_übersicht alle Anlagen.xlsx`, coin XLSX files, and AKB CSV.
   - Do not commit raw finance source files or exact private values into Git/chat; map into reviewed local model data.

## Minimal verification pattern

- `curl http://<tailnet-ip>:<vue-port>/api/health` should return `app: jarvis-finance-api`.
- Browser snapshot should show `JARVIS Finance`, `PrimeVue Aura Light`, budget navigation, and `FastAPI verbunden: ja` / `Runtime-DB verfügbar: ja`.
- Do not report a Streamlit URL as the FinanceManager dashboard URL unless explicitly requested for legacy debugging.
