Assets and Logo Management
Relevant source files
The following files were used as context for generating this wiki page:
Assets and Logo Management is a core system within the personal finance application designed to track and visualize a user's total net worth across various categories, including liquid cash, investments, properties, and vehicles. This module integrates financial account tracking with physical asset management and utilizes external APIs to enrich the user experience with automated merchant and institution branding.
The system handles the CRUD operations for diversified assets while providing an aggregated overview through the dashboard. It leverages a specialized logo management service that fetches, caches, and serves institution icons from the Logo.dev API, ensuring a professional and recognizable interface for transaction and account tracking.
Sources: frontend/lib/actions/dashboard.ts:600-610, frontend/lib/actions/logos.ts:10-20, frontend/app/(dashboard)/assets/asset-management.tsx:100-110
Asset Architecture and Categorization
The application classifies assets into six distinct categories to facilitate structured financial reporting. These categories encompass both traditional financial accounts and physical holdings.
Asset Categories
| Category | Key | Color | Included Items |
|---|---|---|---|
| Cash | cash | #3B82F6 | Checking, Savings, and Petty Cash |
| Investment | investment | #10B981 | Brokerage accounts and portfolios |
| Crypto | crypto | #F59E0B | Cryptocurrency wallets and exchanges |
| Property | property | #8B5CF6 | Real estate and land |
| Vehicle | vehicle | #EC4899 | Cars, motorcycles, and other transport |
| Other | other | #6B7280 | Credit cards (if debt) and miscellaneous items |
Sources: frontend/lib/actions/dashboard.ts:581-605
Data Aggregation Logic
The system calculates the total asset value by aggregating data from three primary tables: accounts, properties, and vehicles. The getAssetsOverview function processes these records, converting values into the user's functional currency (defaulting to EUR) and calculating the relative weight (percentage) of each asset within its category and across the total portfolio.
Logo Management System
The Logo Management system provides automated branding for financial institutions and merchants. It operates as a caching proxy between the frontend and the Logo.dev API to optimize performance and minimize API consumption.
Logo Retrieval Flow
When an asset or transaction requires a logo, the system checks the local companyLogos table. If the logo is missing or marked as not_found for more than 30 days, the server initiates a background fetch from the external API.
Key Functions
deriveDomainFromName(name): Sanitizes strings by removing corporate suffixes like "Inc", "Ltd", or "GmbH" to produce a clean domain for API lookups.searchLogo(query): The primary public action that coordinates the cache-lookup and API-fetch lifecycle.shouldRecheckNotFound(logo): Implements a 30-day "cooldown" for domains that previously failed to return a logo, preventing redundant API calls.
Sources: frontend/lib/actions/logos.ts:40-70, frontend/lib/actions/logos.ts:125-135
Asset Management Operations
The user interface provides a centralized management console for manually adding, editing, and deleting assets.
Account and Asset Schema
The management interface handles different data structures depending on the asset type:
- Accounts: Tracks
accountType,institution,currency, andfunctionalBalance. - Properties: Tracks
propertyType,address, andcurrentValue. - Vehicles: Tracks
make,model,year, andcurrentValue.
Sources: frontend/app/(dashboard)/assets/asset-management.tsx:120-150
Technical Implementation of CRUD
The AssetManagement component utilizes several specialized server actions to perform operations while maintaining UI consistency through router.refresh().
| Operation | Action Called | Purpose |
|---|---|---|
| Update Account | updateAccount | Modifies name, type, and associated logo ID. |
| Balance Adjustment | UpdateBalanceDialog | Creates balance history entries to update net worth. |
| Recalculate | recalculateAccountTimeseries | Recomputes daily balances based on transaction history. |
| Delete | deleteAccount/deleteProperty | Soft-deletes or removes the asset from the user's view. |
Sources: frontend/app/(dashboard)/assets/asset-management.tsx:180-220, frontend/lib/actions/dashboard.ts:100-115
Visualization and Reporting
The system visualizes asset distribution through the AssetsOverviewCard, which combines several UI components:
- Stacked Bar: A visual representation of net worth distribution across the six categories.
- Assets Table: A hierarchical list that allows users to drill down from categories (e.g., "Cash") to individual accounts (e.g., "Checking - Chase").
- Weight Bar: Small inline visualizers showing the relative weight of an account within its specific category.
Sources: frontend/components/assets/assets-overview-card.tsx:20-35, frontend/components/assets/assets-table.tsx:40-60
Conclusion
Assets and Logo Management ensures a comprehensive view of a user's financial standing by merging bank-integrated data with manual physical asset tracking. By utilizing automated logo enrichment and a structured categorization engine, the system provides both high-level net worth analytics and granular control over individual holdings.
Sources: frontend/lib/actions/dashboard.ts:750-760, frontend/app/(dashboard)/assets/asset-management.tsx:500-510 assistant