Open source personal finance application
docs: update branch references after convex→main rename
Ilya Komichev4f4e4b38ca50
diff --git a/docs/content/en/2.development/03.migration.md b/docs/content/en/2.development/03.migration.mdindex 42b9cfe1..9590d431 100644--- a/docs/content/en/2.development/03.migration.md+++ b/docs/content/en/2.development/03.migration.md@@ -10,6 +10,8 @@ seo:Finapp v6 used Firebase Realtime Database. Finapp v7 uses [Convex](https://convex.dev). This guide describes how to migrate existing user data.+The legacy v6 source code lives on the [`firebase`](https://github.com/ilkome/finapp/tree/firebase) branch.+## OverviewThe migration script reads a Firebase JSON export, transforms the data to match the Convex schema, and imports it via internal mutations.diff --git a/docs/content/en/3.reference/07.convex-migration.md b/docs/content/en/3.reference/07.convex-migration.mdindex 3034a88a..195edb3a 100644--- a/docs/content/en/3.reference/07.convex-migration.md+++ b/docs/content/en/3.reference/07.convex-migration.md@@ -8,11 +8,11 @@ seo:description: Side-by-side comparison of Finapp v6 (Firebase) and v7 (Convex) - backend, performance, security, tests, and architecture.----Side-by-side comparison of what the app looks like on `main` (v6, Firebase) vs `convex` (v7, Convex).+Side-by-side comparison of what the app looks like on the [`firebase`](https://github.com/ilkome/finapp/tree/firebase) branch (v6, Firebase) vs `main` (v7, Convex).## Backend-| | main (Firebase) | convex |+| | firebase (Firebase) | main (Convex) ||---|---|---|| **Database** | Firebase Realtime Database | Convex (backend-as-code) || **Auth** | Firebase Auth via `nuxt-vuefire` | Better Auth + `@convex-dev/better-auth` |@@ -35,7 +35,7 @@ Side-by-side comparison of what the app looks like on `main` (v6, Firebase) vs `## Store Pattern-| | main | convex |+| | firebase | main ||---|---|---|| **Data source** | Firebase listener → `setTrns()` | Convex query → `mergeOfflineOps()` → `set()` || **Persist** | `deepUnref()` + immediate `localforage.setItem()` | Debounced 300ms `localforage.setItem()` (no deep clone) |@@ -50,8 +50,8 @@ The `vue-deepunref` dependency is removed. Store data uses `shallowRef`, so deep### Algorithm improvements-| What | main | convex | Impact |-|------|------|--------|--------|+| What | firebase | main | Impact |+|------|----------|------|--------|| **Wallet totals** | `getWalletTotal(id)` called per wallet in `reduce` — each call filters all trns: O(W×N) | `getWalletsTotals()` single pass, distributes amounts via `Map`: O(N), then O(1) lookup per wallet | 5 wallets × 10K trns: ~50K → ~10K ops || **Interval bucketing** | Inline in `Item.vue`: `intervalsInRange.reduce()` filtering all trns per interval: O(N×I) | Extracted to `bucketTrnsByIntervals()`: single pass + binary search: O(N log I) | Year/365 days/5K trns: 1.8M → ~43K comparisons || **Transaction filtering** | 6 sequential `.filter()` chained via `reduce` + `walletsIds.some(w => includes(w))` O(W²) + always sorts O(N log N) | Single `.filter()` with early returns + `Set.has()` O(1) + sorting optional | 5 intermediate arrays + O(W²) → single pass + O(1); sort O(N log N) skipped when not needed |@@ -84,8 +84,8 @@ The `vue-deepunref` dependency is removed. Store data uses `shallowRef`, so deep### Bundle and rendering-| What | main | convex |-|------|------|--------|+| What | firebase | main |+|------|----------|------|| **ECharts** | 9 components in main bundle (incl. PieChart, DataZoom, MarkPoint) | 7 components in lazy-loaded async chunk (unused removed) || **Theme plugin** | 81 lines with SSR inline scripts and regex replacements | 32 lines, SPA-only `appConfig` updates from localStorage || **Persist** | `deepUnref()` on every `localforage.setItem()` — full recursive clone | Direct write, debounced 300ms, no cloning |@@ -97,8 +97,8 @@ The `vue-deepunref` dependency is removed. Store data uses `shallowRef`, so deep## Security-| What | main | convex |-|------|------|--------|+| What | firebase | main |+|------|----------|------|| **Calculator parser** | `new Function(expression)` — code injection risk, requires `unsafe-eval` CSP | Recursive descent parser — only `+`,`-`,`*`,`/` on numeric literals || **Input validation** | Firebase rules (client can't verify) | Convex validators: string limits, numeric ranges, field checks || **Auth tokens** | Firebase-managed | Encrypted at rest (`encryptOAuthTokens: true`) |@@ -109,7 +109,7 @@ The `vue-deepunref` dependency is removed. Store data uses `shallowRef`, so deep## Auth-| | main | convex |+| | firebase | main ||---|---|---|| **Provider** | Firebase Auth | Better Auth || **Plugin** | `nuxt-vuefire` (auto-handles auth) | `plugins/convex.ts` — manual lifecycle |@@ -122,7 +122,7 @@ The `vue-deepunref` dependency is removed. Store data uses `shallowRef`, so deep## Offline Queue-| | main | convex |+| | firebase | main ||---|---|---|| **Structure** | Ad-hoc helpers in `trns/helpers.ts` | Dedicated `components/offline/` directory || **Files** | Scattered localStorage keys | `helpers.ts`, `replay.ts`, `replayHelpers.ts`, `storageKeys.ts`, `types.ts` |@@ -135,7 +135,7 @@ The `vue-deepunref` dependency is removed. Store data uses `shallowRef`, so deep## PWA-| | main | convex |+| | firebase | main ||---|---|---|| **Strategy** | `injectManifest` (custom service worker via `SW` env var) | `generateSW` (auto-generated by Workbox) || **Service worker** | Hand-written `sw.ts` | None — Workbox generates it |@@ -144,7 +144,7 @@ The `vue-deepunref` dependency is removed. Store data uses `shallowRef`, so deep## TypeScript-| | main | convex |+| | firebase | main ||---|---|---|| **Strict mode** | Enabled, but unresolved errors | Zero TypeScript errors || **Type casts** | `as any` used across codebase | Zero `as any` — replaced with type guards, `@vue-ignore`, narrow casts |@@ -162,7 +162,7 @@ The `vue-deepunref` dependency is removed. Store data uses `shallowRef`, so deep## Tests-| | main | convex |+| | firebase | main ||---|---|---|| **Config** | No vitest config | 3 vitest projects: `unit` (node), `store` (happy-dom), `convex` (edge-runtime) || **Backend tests** | None | Full CRUD integration tests (wallets, categories, trns, sync hash) |@@ -216,8 +216,8 @@ Business logic moved from Vue components into testable pure functions:### Semantic renaming-| main | convex |-|------|--------|+| firebase | main |+|----------|------|| `getTrnsIds` | `filterTrnsIds` || `getCategoriesWithData` | `computeCategoriesWithData` || `getTotalOfTrnsIds` | `computeTotalForTrnsIds` |@@ -241,7 +241,7 @@ Business logic moved from Vue components into testable pure functions:### Data model-| | main | convex |+| | firebase | main ||---|---|---|| **Category children** | Denormalized `childIds` array | Computed dynamically from `parentId` || **Transfer detection** | `transferCategoriesIds` (computed from category data) | `TrnType.Transfer` enum value |@@ -265,7 +265,7 @@ Business logic moved from Vue components into testable pure functions:## i18n-| | main | convex |+| | firebase | main ||---|---|---|| **Error messages** | Generic or none | Per-entity error keys (`categories.errors.*`, `wallets.errors.*`, `trns.errors.*`) || **Form labels** | Verbose (`Category name`, `Category color`) | Concise (`Name`, `Color`, `Icon`) |@@ -275,7 +275,7 @@ Business logic moved from Vue components into testable pure functions:## Code Quality-### Removed from main+### Removed from firebase- `vue-deepunref` dependency- Old page-specific wallet composablesdiff --git a/docs/content/en/4.premium/01.overview.md b/docs/content/en/4.premium/01.overview.mdindex 740f6cf6..b620e86b 100644--- a/docs/content/en/4.premium/01.overview.md+++ b/docs/content/en/4.premium/01.overview.md@@ -17,11 +17,11 @@ Finapp Premium is an extension of the base app using **Nuxt Layers**. It lives i## How It Works-Premium is a [Nuxt Layer](https://nuxt.com/docs/getting-started/layers) that sits on top of the base app. It adds new components and pages without duplicating shared code. The base app is included as a Git submodule pointing to the `convex` branch.+Premium is a [Nuxt Layer](https://nuxt.com/docs/getting-started/layers) that sits on top of the base app. It adds new components and pages without duplicating shared code. The base app is included as a Git submodule pointing to the `main` branch.```finapp-premium/-├── base/ # Git submodule → ilkome/finapp (convex branch)+├── base/ # Git submodule → ilkome/finapp (main branch)├── app/ # Premium-only components and pages└── nuxt.config.ts # Extends base layer via FINAPP_BASE_PATH```