Context & Goal: I want to build a standalone macOS desktop application (.app) that acts…
- User
Context & Goal: I want to build a standalone macOS desktop application (.app) that acts as my personal, intelligent Investment Portfolio Ledger and Dashboard. I periodically buy Gold, Stocks, and Mutual Funds (via TEFAS/Fonlab). I want this app to serve as my secure database, cost-averager, and time-based profit analyzer.
I am practicing Vibe Coding: you will act as the master software engineer handling all the architecture, database design, and logic. I will act as the Product Manager guiding the features. Give me production-ready, clean code blocks and tell me exactly where to place them.
📋 PROGRAM LOGIC & CORE FEATURES (WHAT THE APP MUST DO) The application must implement the following business and mathematical logic:
Historical Transaction Ledger (The Input System):
The user must be able to input a new transaction with fields: [Asset Type (Gold/Stock/Fund)], [Asset Code (e.g., MAC, Gold, THYAO)], [Transaction Date], and [Total Cash Invested (TL) OR Quantity Bought].
Historical Price Lookup: If the user inputs a historical date, the app must fetch or allow input of that exact day's closing price to calculate the exact units acquired.
Smart Average Cost Engine (The Math):
The app must maintain a ledger of all historical purchases for the same asset.
It must automatically calculate the Weighted Average Cost (Ortalama Maliyet) every time a new purchase is added.
Formula: Average Cost = Total Cash Spent / Total Quantity Owned.
Live Valuation & Integration:
It must embed my Google Sheets (which uses the "Fonlab" add-on) or use an internal scraper to get today's live price for Gold, Stocks, and Funds.
Live Profit/Loss: Current Value = Total Quantity Owned * Live Price. Net Profit/Loss = Current Value - Total Cash Spent.
Time-Based Profit Analytics (Zamana Göre Kâr):
The app needs to display how the portfolio's value and profits have changed over time (e.g., 1-week, 1-month, 3-month performance tabs or charts).
It must calculate performance based on the specific dates the assets were added to the ledger, showing rolling returns since the inception of the first buy.
UI & macOS Native Presentation:
Package this as a beautiful Electron app with an 1100x700 minimalist frameless window.
Inject CSS to hide all Google Sheets UI clutter (toolbars, sidebars) so that the app displays like a bespoke, premium crypto/stock terminal.
Ensure session persistence so Google logins are remembered locally on macOS.
Your First Response Checklist: Do not give me high-level summaries. Let's start the Vibe Coding session by laying down the codebase:
Step 1: Define the local file directory structure for this Electron portofolio manager.
Step 2: Provide the complete package.json with all build scripts for macOS.
Assistant