Skip to main content

Documentation Index

Fetch the complete documentation index at: https://mintlify.com/apursley2012/airgead-investment-calculator/llms.txt

Use this file to discover all available pages before exploring further.

Airgead stores all application state in the current browser’s localStorage. There is no backend, database, or network request involved in reading or writing data — everything lives on the user’s own machine, scoped to the domain the site is served from. Closing and reopening the browser, or refreshing the page, leaves data intact. However, data is not shared across browsers, devices, or private-browsing sessions.

localStorage Keys

The application uses three keys, each owned by a distinct part of the codebase:
KeyPurposeWritten byRead by
airgead_current_calcMost recent calculation inputs, yearly results, and an ISO timestampCalculator page (on “View Details” submit)Results page on load
airgead_saved_plansJSON array of all saved plan objectsResults page (Save Plan button)Saved Plans page on load
airgead_userEmail entered in the mock sign-in demoLogin pageNot used for real auth

The airgead_current_calc Structure

When the user submits the calculator form, saveCurrentCalculation(inputs, results) serialises the following object and stores it under airgead_current_calc:
{
  "inputs": {
    "startingBalance": "5000",
    "monthlyDeposit": "250",
    "annualRate": "5",
    "years": "20"
  },
  "results": [
    { "year": 0, "withDeposits": 5000, "withoutDeposits": 5000, "totalDeposits": 5000, "interestEarned": 0 },
    { "year": 1, "withDeposits": 8374, "withoutDeposits": 5255, "totalDeposits": 8000, "interestEarned": 374 }
  ],
  "updatedAt": "2026-07-01T12:00:00.000Z"
}
inputs stores the raw form field strings exactly as entered. results is the full array of year-by-year rows produced by calculateCompoundInterest(). updatedAt is the ISO 8601 timestamp captured at the moment of writing. The results array is truncated above for readability — a 20-year projection would contain 21 rows (year 0 through year 20).

A Saved Plan Object

When the user clicks Save Plan on the Results page, a new entry is appended to the airgead_saved_plans array. Each plan object has the following shape:
{
  "id": "1751374800000",
  "date": "2026-07-01T12:00:00.000Z",
  "name": "Plan: $250/mo for 20 years",
  "data": { "..." : "..." }
}
id is the numeric timestamp (Date.now().toString()) captured at save time, which serves as a unique identifier. date is the same moment expressed as an ISO string. name is auto-generated from the monthly deposit and duration inputs. data contains the full airgead_current_calc object — inputs, results, and the original updatedAt — embedded directly inside the plan.

Data Lifecycle

Because localStorage is a persistent browser store, data written by Airgead behaves as follows:
  • Survives page refreshes — data persists across full reloads of the same tab
  • Survives browser restarts — unlike sessionStorage, localStorage is not cleared when the browser closes
  • Cleared with site data — if the user clears cookies and site data for the domain (via browser settings), all three keys are deleted
  • Not synchronised — data does not travel between different browsers, devices, or user accounts; each browser instance maintains its own independent store
  • Not encrypted — values are stored as plain JSON strings; no sensitive financial information should be treated as private in this context
The airgead_user key is written by the login page purely for demonstration purposes. It stores the email address that was entered in the sign-in form — nothing more. The value is never verified against a user database, never used to gate access to any page, and never transmitted over a network. It is not a substitute for real authentication.

CSV Export

CSV export does not interact with localStorage at all. When the user clicks Export CSV on the Results page, downloadCsv() in js/lib/calculator.js converts the results array into a comma-separated string, wraps it in a Blob with MIME type text/csv, and passes that blob to URL.createObjectURL() to generate an in-memory object URL. A temporary <a> element is programmatically clicked to trigger the browser’s file download dialogue, and the object URL is immediately revoked afterwards. The file is created and delivered entirely in memory — no data is written to disk by the application, and no localStorage key is touched during the export.

Build docs developers (and LLMs) love