Technical Architecture
SafeWithdrawls is designed to be fast, private, and transparent. This page explains the key technical decisions behind the platform.
Everything Runs in Your Browser
SafeWithdrawls is currently a client-side application. When you open the Scenario Builder, all calculations happen directly in your browser — nothing is sent to a server.
This means:
- Your financial data stays on your device. The core comparison tool does not collect, store, or transmit your portfolio size, expenses, or any other inputs.
- Results appear instantly. There is no network round-trip for calculations. Change an input and the projections update in real time.
- It works offline once the page has loaded. No internet connection is needed for calculations.
As the platform grows, future premium features may introduce accounts and server-side capabilities — including AI-powered tools to help you explore strategies. All features, free and premium, will remain educational in nature.
The Technology Stack
SafeWithdrawls is built with modern web technologies:
| Component | Technology | Why |
|---|---|---|
| UI Framework | React 18 + TypeScript | Type-safe components with strong ecosystem |
| Build Tool | Vite | Fast development builds and optimized production bundles |
| Styling | Tailwind CSS + shadcn/ui | Consistent design system with accessible components |
| Charts | Recharts | Responsive SVG charts for portfolio trajectories |
| Learn Site | Docusaurus | Purpose-built documentation framework |
| Hosting | Vercel | Global CDN with automatic deployments |
How Calculations Work
The calculation engine processes your scenario in a pipeline:
1. Input Collection → Your financial details (portfolio, expenses, age, allocation)
2. Return Generation → Annual stock and bond returns are generated using one of three modes:
- Bootstrap sampling — randomly drawn from 96 years of real US market data (1928–2024)
- Historical replay — actual return sequences starting from a specific year
- Crisis presets — stress-test scenarios starting from 1929, 1972, 2000, 2008, or 2020
3. Method Calculation → Each selected withdrawal strategy runs its own calculator against the same return sequence, producing year-by-year projections
4. Scoring → Portfolio Health and Need Coverage scores are computed for each method
5. Display → Charts, tables, and scores appear in the results panel
Every method processes the same returns and starts from the same portfolio, making comparisons genuinely apples-to-apples.
23 Independent Calculators
Each withdrawal strategy has its own dedicated calculator module. These calculators are:
- Independently tested — each has a comprehensive test suite verifying outputs against known examples
- Formula-documented — every method page in the Learn section shows the exact math
- Research-referenced — formulas are drawn from published academic papers and practitioner guides
The calculators do not share state or influence each other. When you compare the 4% Rule against Guyton-Klinger, each runs its own logic completely independently.
Data Sources
SafeWithdrawls uses historical US financial data:
- Stock returns: S&P 500 annual returns, 1928–2024
- Bond returns: 10-year US Treasury annual returns, 1928–2024
- Inflation: Consumer Price Index (CPI) annual changes, 1928–2024
This 96-year dataset includes every major market event in modern history: the Great Depression, World War II, stagflation, the dot-com bust, the 2008 financial crisis, and the COVID-19 crash.
Open and Auditable
The calculation engine is designed for transparency:
- Expand any year in the projection table to see the exact calculation details
- Every input is visible — return sequences, inflation, and method parameters are shown alongside results
- No "proprietary models" — every formula comes from published research with citations
Open the Scenario Builder and see the calculation engine in action with your own numbers.