How null-pub/wealth-tracker works
Project Type and Purpose
• This is a front-end, single-page application built with React and TypeScript.
• Its primary purpose is to track wealth and income, project future income and wealth, and allow users to import/export data—all stored locally in the browser’s local storage.
• The README emphasizes that this tool is for entertainment with basic financial projections and local data persistence.
Break Down the File Structure
• Top-level files such as package.json, vite.config.ts, index.html, and tsconfig.* indicate that the project uses modern tooling (Vite) along with JavaScript/TypeScript linting and formatting (ESLint, Prettier).
• The “src” folder is organized into several subdirectories:
– /app: Contains the main application entry point (src/app/index.ts) and configuration components (modals, config entries, scenario explorer, etc.). This represents the core UI and configuration logic.
– /capabilities: Contains modules for different features like net-wealth, projected-income, and projected-wealth. Each capability generally includes its own UI components (like charts, data entry screens, account tabs, etc.) and sometimes hooks.
– /shared: Provides reusable components (e.g., ag-grid components, confirm-dialog, formatters), hooks, models, store implementations (with versioned store models and migrations), utilities, and even a web-worker subfolder for offloading computations.
• The “docs” folder and assets indicate that there is documentation with static assets (likely for demo or usage instructions on GitHub pages).
Main Components & Their Relationships
• User Interface Layer:
– Main entry point: src/main.tsx initializing the React app.
– Application components: Located in src/app (and its config subdirectory) which handle global configuration and system settings.
– Capabilities modules: Divided into net-wealth, projected-income, and projected-wealth. Each module encapsulates feature-specific screens and business logic.
– Shared UI components: Reusable components used across different modules (e.g., ag-grid tables, card components, formatters, dialogs).
• State Management & Data Store:
– The state “store” logic is found in src/shared/store and the associated models in src/shared/models/store – note the versions (version-0 to version-5) with migrations, indicating that data structure evolution is handled.
– Local storage is used as the persistence layer for the application, as noted in the README.
• Utility and Helper Services:
– The shared utilities and web-worker code (src/shared/utility and src/shared/web-worker) are used for offloading intensive calculations (such as scenario processing or merit sequences) from the UI thread.
• External Libraries & Configuration:
– External dependencies (as seen in docs/assets) such as ag-charts, @mui components, date-fns, etc., play a significant role in UI rendering and data visualization.
– Configuration and tooling files (eslint, prettier, vite config) indicate that the project adheres to consistent code style and uses a modern build pipeline.