Compare commits
156 Commits
541c443efd
...
main
Author | SHA1 | Date | |
---|---|---|---|
1ca5545db7 | |||
bd914b05dd | |||
fc452ebd4c | |||
201c1ee523 | |||
1c1b842a15 | |||
aba4e4a7f6 | |||
4dcd24f1fd | |||
440b759daa | |||
9a54bdf93f | |||
cabcbbb84a | |||
d815cab9d8 | |||
be6a875999 | |||
31c6c7106f | |||
93c1320651 | |||
b875d65fdc | |||
26a305a96b | |||
fb32bd381c | |||
c45cad8e96 | |||
86ee8c6b32 | |||
f6dd7c3012 | |||
e34fc5dffc | |||
57be648512 | |||
c131fba360 | |||
9803c3f33d | |||
7f7a8d8728 | |||
a2184c0ef2 | |||
198a8c8c45 | |||
d87fba0ca5 | |||
0cbc745798 | |||
e59620f619 | |||
52eaa7bd4f | |||
614d1a83cc | |||
d29d4e54ef | |||
c79f504c24 | |||
aa0c90e70b | |||
b0a1512911 | |||
f34cbabff2 | |||
1b58443e69 | |||
5fdeae83c6 | |||
fb62ae2011 | |||
55c8b7c079 | |||
e39ddfd7a6 | |||
990ef286c8 | |||
dc80ce98e5 | |||
f1b29f7c5f | |||
e4416ba3df | |||
3f0584ab51 | |||
b657c589e0 | |||
c008289e09 | |||
3cee1fff9e | |||
07de9a0062 | |||
00108ab629 | |||
d790a8bb3b | |||
24e6a4ef95 | |||
5ddd9cc58f | |||
adcdce67cb | |||
51c4bd7316 | |||
bff9c98db1 | |||
bedaa2090f | |||
71df024aa9 | |||
228a0bdaaf | |||
a4a3ed403b | |||
863d4f3268 | |||
9719383056 | |||
6c77a71a79 | |||
b54c8e3d2b | |||
1cffa649d6 | |||
7c38ed2a60 | |||
7a69e9ff45 | |||
e71f28d8c2 | |||
d26a3252cc | |||
2a7182625b | |||
d7cbcf3707 | |||
374cb17eeb | |||
d5f8c84f13 | |||
d116e01f8d | |||
a297b8a4aa | |||
acb4e5bc51 | |||
606512fad8 | |||
a5d07b8b3e | |||
0a7a51ef64 | |||
2d5f9b051d | |||
d83ef08f7c | |||
7362a6545b | |||
553f5155c7 | |||
44a98fe001 | |||
0736907b84 | |||
4f4a74dc72 | |||
6387e96bf7 | |||
96f95e7b08 | |||
87ea9e1ecc | |||
51add59741 | |||
29d42c0f22 | |||
e36c062b9c | |||
8273fce712 | |||
820d7f4883 | |||
6d487f8792 | |||
f4ab9d3745 | |||
e1da910a25 | |||
225f9ef1ab | |||
c071b9c052 | |||
11e1e31ac5 | |||
8ac784f49b | |||
0b0e6c1c9a | |||
c3168220fe | |||
229f2d7b56 | |||
a86eddda31 | |||
0a96a94cf3 | |||
0e6086a597 | |||
dafdd0d154 | |||
b9b52377e0 | |||
63fe8e5999 | |||
fc18e414cb | |||
a3eda1f0db | |||
2b2b5784d1 | |||
32ef797bf6 | |||
02761928a5 | |||
763c8b590d | |||
e616e8f261 | |||
a0c5665941 | |||
d24c8b910a | |||
8f7ebf7b5a | |||
7c05542d5e | |||
32a0b7a0ac | |||
c1e57577cd | |||
d2735a7020 | |||
4348e4bdf3 | |||
4026924e06 | |||
bf9098e3e5 | |||
1082dc3b69 | |||
670ed01ede | |||
2bc1d42cf7 | |||
23e03c9a32 | |||
fdd923cfbc | |||
6a6557c3bf | |||
5544c2f69f | |||
24547c3087 | |||
6a6f0ee9a5 | |||
439b7c395c | |||
d761ac0348 | |||
bc08871f86 | |||
a032a132e4 | |||
54ed15ff25 | |||
cdb67cae95 | |||
5888b46b25 | |||
26ceef1740 | |||
857f1a242b | |||
9531fcea99 | |||
2be1a6b947 | |||
dd40e92179 | |||
23c2c0ea21 | |||
3660cc0310 | |||
6018239c43 | |||
97fa489d6c | |||
a1e9b667f3 | |||
ab5eb23238 |
31
.gitea/workflows/check.yml
Normal file
31
.gitea/workflows/check.yml
Normal file
@@ -0,0 +1,31 @@
|
|||||||
|
name: Lint
|
||||||
|
|
||||||
|
on:
|
||||||
|
pull_request:
|
||||||
|
push:
|
||||||
|
branches:
|
||||||
|
- "**" # matches every branch
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
lint_and_typecheck:
|
||||||
|
name: Lint and Typecheck
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
|
||||||
|
steps:
|
||||||
|
- name: Checkout code
|
||||||
|
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4
|
||||||
|
|
||||||
|
- name: Install pnpm
|
||||||
|
uses: pnpm/action-setup@a7487c7e89a18df4991f7f222e4898a00d66ddda # v4
|
||||||
|
|
||||||
|
- name: Setup Node.js
|
||||||
|
uses: actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020 # v4
|
||||||
|
with:
|
||||||
|
node-version: 22
|
||||||
|
cache: "pnpm"
|
||||||
|
|
||||||
|
- name: Install dependencies
|
||||||
|
run: pnpm install
|
||||||
|
|
||||||
|
- name: Run check
|
||||||
|
run: pnpm run check
|
109
README.md
109
README.md
@@ -1,3 +1,108 @@
|
|||||||
# fire
|

|
||||||
|
|
||||||
FIRE calculator
|
# InvestingFIRE 🔥 — The #1 Interactive FIRE Calculator
|
||||||
|
|
||||||
|
**InvestingFIRE** is a responsive web application for calculating your path to Financial Independence and Early Retirement (FIRE). It features a year-by-year projection engine that simulates both accumulation (savings and investment growth) and retirement (withdrawals) phases, allowing users to:
|
||||||
|
|
||||||
|
- Input starting capital, monthly savings, expected annual growth rate, inflation rate, current age, desired retirement age, life expectancy, and desired monthly retirement allowance.
|
||||||
|
- View a dynamic chart displaying projected portfolio balance and monthly allowance over time.
|
||||||
|
- Instantly see their estimated “FIRE number” (required capital at retirement), how long their capital will last, and compare results to the “4% rule.”
|
||||||
|
- Adjust assumptions live, with all calculations and visualizations updating automatically.
|
||||||
|
- Access explanatory content about FIRE methodology, key variables, and additional community resources, all on a single, consolidated page.
|
||||||
|
|
||||||
|
The project’s code is structured using React/Next.js with TypeScript, focusing on user experience, modern UI components, and clarity of financial assumptions.
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
## 🚀 Features at a Glance
|
||||||
|
|
||||||
|
- **⚡️ Real-Time Projections:** Every field updates the chart _as you type_. Experiment with savings, growth rates, inflation, or retirement age and see your future instantly.
|
||||||
|
- **📈 Interactive Chart:** Dual-area plots for portfolio value and future monthly spending, plus reference lines for FIRE milestones and “4% rule” legends.
|
||||||
|
- **🧠 Education Baked In:** Contextual tooltips, deep-dive sections on how FIRE works, FAQs, and must-read resources included.
|
||||||
|
- **🔎 Detailed Methodology:** Not just a 25x rule — runs a full, year-by-year simulation with inflation-adjusted withdrawals and optional 4%-rule overlays.
|
||||||
|
- **👌 Modern UX:** Typing, sliding, or clicking feels _good_. Responsive on all devices.
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
## 🧰 How It Works
|
||||||
|
|
||||||
|
The calculator models your FIRE journey in two phases:
|
||||||
|
|
||||||
|
1. **Accumulation:**
|
||||||
|
- Your starting capital is grown by your expected CAGR (~7% by default).
|
||||||
|
- Monthly savings are added for each year until retirement.
|
||||||
|
- Every variable can be adjusted live (capital, savings, age, growth, inflation, spending, target retirement).
|
||||||
|
|
||||||
|
2. **Retirement:**
|
||||||
|
- Your balance continues to grow by CAGR.
|
||||||
|
- Each year, an inflation-adjusted monthly allowance is withdrawn.
|
||||||
|
- The simulation runs until your selected life expectancy, showing the possibility of portfolio depletion.
|
||||||
|
|
||||||
|
**Key Outputs:**
|
||||||
|
|
||||||
|
- 🔥 “FIRE Number”: Portfolio value at your defined retirement age
|
||||||
|
- 📊 Interactive projection chart: See how your nest egg and withdrawals evolve over time
|
||||||
|
- 4️⃣ “4% Rule” overlays: Compare dynamic results to classic rule-of-thumb
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
## 🌟 Try It For Yourself
|
||||||
|
|
||||||
|
To run locally:
|
||||||
|
|
||||||
|
1. **Clone the repo**
|
||||||
|
```bash
|
||||||
|
git clone https://git.schulze.network/schulze/fire.git
|
||||||
|
cd fire
|
||||||
|
```
|
||||||
|
2. **Install dependencies**
|
||||||
|
```bash
|
||||||
|
pnpm install
|
||||||
|
```
|
||||||
|
3. **Run the app**
|
||||||
|
```bash
|
||||||
|
pnpm run dev
|
||||||
|
```
|
||||||
|
4. Visit [http://localhost:3000](http://localhost:3000) and unleash the fire.
|
||||||
|
|
||||||
|
Deployed version: [https://investingfire.com](https://investingfire.com)
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
## ✏️ Inputs & Variables
|
||||||
|
|
||||||
|
- **Starting Capital** — How much you’ve already invested
|
||||||
|
- **Monthly Savings** — What you’ll add each month
|
||||||
|
- **Current Age & Retirement Age** — Your FI timeline
|
||||||
|
- **Life Expectancy** — How long do you want income to last?
|
||||||
|
- **Expected Growth Rate (CAGR)** — Portfolio annual % return, before inflation
|
||||||
|
- **Inflation Rate** — Cost of living increases
|
||||||
|
- **Desired Monthly Allowance** — Your lifestyle, today’s dollars
|
||||||
|
|
||||||
|
As you adjust these, all projections update instantly _without needing to hit “Calculate.”_
|
||||||
|
|
||||||
|
Try many “what ifs” fast.
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
## 👩💻 Contributing
|
||||||
|
|
||||||
|
Pull requests are welcome! Open issues for bugs, new features, or debate about safe withdrawal rates and tax assumptions.
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
## 📄 License
|
||||||
|
|
||||||
|
[GPL-3.0](./LICENSE)
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
## 🥇 Why Use InvestingFIRE?
|
||||||
|
|
||||||
|
- You want the truth — not just a 4% fantasy.
|
||||||
|
- You want to learn, not just punch in numbers.
|
||||||
|
- You want clarity, speed, and modern UI.
|
||||||
|
- You want to show your friends the best FIRE tool on the web.
|
||||||
|
|
||||||
|
Enjoy the _rocket ride_ to financial independence.
|
||||||
|
**InvestingFIRE — Know your number. Change your future.**
|
||||||
|
7300
package-lock.json
generated
7300
package-lock.json
generated
File diff suppressed because it is too large
Load Diff
45
package.json
45
package.json
@@ -6,14 +6,12 @@
|
|||||||
"scripts": {
|
"scripts": {
|
||||||
"build": "next build",
|
"build": "next build",
|
||||||
"check": "next lint && tsc --noEmit",
|
"check": "next lint && tsc --noEmit",
|
||||||
"dev": "next dev --turbo",
|
"dev": "next dev --turbopack",
|
||||||
"format:check": "prettier --check \"**/*.{ts,tsx,js,jsx,mdx}\" --cache",
|
"format:check": "prettier --check \"**/*.{ts,tsx,js,jsx,mdx}\" --cache",
|
||||||
"format:write": "prettier --write \"**/*.{ts,tsx,js,jsx,mdx}\" --cache",
|
"format:write": "prettier --write \"**/*.{ts,tsx,js,jsx,mdx}\" --cache",
|
||||||
"lint": "next lint",
|
|
||||||
"lint:fix": "next lint --fix",
|
"lint:fix": "next lint --fix",
|
||||||
"preview": "next build && next start",
|
"preview": "next build && next start",
|
||||||
"start": "next start",
|
"start": "next start"
|
||||||
"typecheck": "tsc --noEmit"
|
|
||||||
},
|
},
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@hookform/resolvers": "^5.0.1",
|
"@hookform/resolvers": "^5.0.1",
|
||||||
@@ -22,37 +20,38 @@
|
|||||||
"@radix-ui/react-select": "^2.2.2",
|
"@radix-ui/react-select": "^2.2.2",
|
||||||
"@radix-ui/react-slider": "^1.3.2",
|
"@radix-ui/react-slider": "^1.3.2",
|
||||||
"@radix-ui/react-slot": "^1.2.0",
|
"@radix-ui/react-slot": "^1.2.0",
|
||||||
"@t3-oss/env-nextjs": "^0.12.0",
|
"@t3-oss/env-nextjs": "^0.13.0",
|
||||||
"class-variance-authority": "^0.7.1",
|
"class-variance-authority": "^0.7.1",
|
||||||
"clsx": "^2.1.1",
|
"clsx": "^2.1.1",
|
||||||
"lucide-react": "^0.503.0",
|
"lucide-react": "^0.525.0",
|
||||||
"next": "^15.2.3",
|
"next": "^15.4.1",
|
||||||
"next-plausible": "^3.12.4",
|
"next-plausible": "^3.12.4",
|
||||||
"react": "^19.0.0",
|
"react": "^19.0.0",
|
||||||
"react-dom": "^19.0.0",
|
"react-dom": "^19.0.0",
|
||||||
"react-hook-form": "^7.56.1",
|
"react-hook-form": "^7.56.1",
|
||||||
"recharts": "^2.15.3",
|
"recharts": "^2.15.3",
|
||||||
"tailwind-merge": "^3.2.0",
|
"tailwind-merge": "^3.2.0",
|
||||||
"zod": "^3.24.3"
|
"zod": "^4.0.0"
|
||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"@eslint/eslintrc": "^3.3.1",
|
"@eslint/eslintrc": "3.3.1",
|
||||||
"@tailwindcss/postcss": "^4.0.15",
|
"@tailwindcss/postcss": "4.1.11",
|
||||||
"@types/node": "^20.14.10",
|
"@types/node": "22.16.3",
|
||||||
"@types/react": "^19.0.0",
|
"@types/react": "19.1.8",
|
||||||
"@types/react-dom": "^19.0.0",
|
"@types/react-dom": "19.1.6",
|
||||||
"eslint": "^9.23.0",
|
"eslint": "9.31.0",
|
||||||
"eslint-config-next": "^15.2.3",
|
"eslint-config-next": "15.4.1",
|
||||||
"postcss": "^8.5.3",
|
"eslint-plugin-react-hooks": "5.2.0",
|
||||||
"prettier": "^3.5.3",
|
"postcss": "8.5.6",
|
||||||
"prettier-plugin-tailwindcss": "^0.6.11",
|
"prettier": "3.6.2",
|
||||||
"tailwindcss": "^4.0.15",
|
"prettier-plugin-tailwindcss": "0.6.14",
|
||||||
"tw-animate-css": "^1.2.8",
|
"tailwindcss": "4.1.11",
|
||||||
"typescript": "^5.8.2",
|
"tw-animate-css": "1.3.5",
|
||||||
"typescript-eslint": "^8.27.0"
|
"typescript": "5.8.3",
|
||||||
|
"typescript-eslint": "8.36.0"
|
||||||
},
|
},
|
||||||
"ct3aMetadata": {
|
"ct3aMetadata": {
|
||||||
"initVersion": "7.39.3"
|
"initVersion": "7.39.3"
|
||||||
},
|
},
|
||||||
"packageManager": "npm@11.2.0"
|
"packageManager": "pnpm@10.13.1"
|
||||||
}
|
}
|
||||||
|
5055
pnpm-lock.yaml
generated
Normal file
5055
pnpm-lock.yaml
generated
Normal file
File diff suppressed because it is too large
Load Diff
6
pnpm-workspace.yaml
Normal file
6
pnpm-workspace.yaml
Normal file
@@ -0,0 +1,6 @@
|
|||||||
|
ignoredBuiltDependencies:
|
||||||
|
- unrs-resolver
|
||||||
|
|
||||||
|
onlyBuiltDependencies:
|
||||||
|
- '@tailwindcss/oxide'
|
||||||
|
- sharp
|
1
public/wgu5fuk8d5j5wp3pjtta9vrw8d9by9qk.txt
Normal file
1
public/wgu5fuk8d5j5wp3pjtta9vrw8d9by9qk.txt
Normal file
@@ -0,0 +1 @@
|
|||||||
|
wgu5fuk8d5j5wp3pjtta9vrw8d9by9qk
|
11
renovate.json
Normal file
11
renovate.json
Normal file
@@ -0,0 +1,11 @@
|
|||||||
|
{
|
||||||
|
"extends": ["config:best-practices", ":semanticCommits"],
|
||||||
|
"$schema": "https://docs.renovatebot.com/renovate-schema.json",
|
||||||
|
"packageRules": [
|
||||||
|
{
|
||||||
|
"matchUpdateTypes": ["minor", "patch", "pin", "digest"],
|
||||||
|
"automerge": true,
|
||||||
|
"automergeType": "branch"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
157
src/app/components/BackgroundPattern.tsx
Normal file
157
src/app/components/BackgroundPattern.tsx
Normal file
@@ -0,0 +1,157 @@
|
|||||||
|
"use client";
|
||||||
|
import { useState, useEffect } from "react";
|
||||||
|
import {
|
||||||
|
type LucideIcon,
|
||||||
|
HandCoins,
|
||||||
|
Bitcoin,
|
||||||
|
Coins,
|
||||||
|
DollarSign,
|
||||||
|
Euro,
|
||||||
|
IndianRupee,
|
||||||
|
JapaneseYen,
|
||||||
|
PiggyBank,
|
||||||
|
PoundSterling,
|
||||||
|
Wallet,
|
||||||
|
Banknote,
|
||||||
|
ChartCandlestick,
|
||||||
|
CirclePercent,
|
||||||
|
CreditCard,
|
||||||
|
Gem,
|
||||||
|
Receipt,
|
||||||
|
ShoppingBasket,
|
||||||
|
Rocket,
|
||||||
|
RockingChair,
|
||||||
|
Sparkles,
|
||||||
|
ChartPie,
|
||||||
|
ChartBar,
|
||||||
|
BarChart3,
|
||||||
|
ChartLine,
|
||||||
|
TrendingDown,
|
||||||
|
TrendingUp,
|
||||||
|
Vault,
|
||||||
|
Landmark,
|
||||||
|
Briefcase,
|
||||||
|
Handshake,
|
||||||
|
Shield,
|
||||||
|
Lock,
|
||||||
|
CalendarRange,
|
||||||
|
Hourglass,
|
||||||
|
Sprout,
|
||||||
|
Target,
|
||||||
|
} from "lucide-react";
|
||||||
|
|
||||||
|
export default function MultiIconPattern({ opacity = 0.2, spacing = 160 }) {
|
||||||
|
const [width, setWidth] = useState(0);
|
||||||
|
const [height, setHeight] = useState(0);
|
||||||
|
const [rows, setRows] = useState(0);
|
||||||
|
const [columns, setColumns] = useState(0);
|
||||||
|
|
||||||
|
useEffect(() => {
|
||||||
|
const updateDimensions = () => {
|
||||||
|
if (window.innerWidth > width + spacing * 2) {
|
||||||
|
setWidth(window.innerWidth);
|
||||||
|
}
|
||||||
|
if (window.innerHeight > height + spacing * 2) {
|
||||||
|
setHeight(window.innerHeight);
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
updateDimensions();
|
||||||
|
window.addEventListener("resize", updateDimensions);
|
||||||
|
|
||||||
|
return () => {
|
||||||
|
window.removeEventListener("resize", updateDimensions);
|
||||||
|
};
|
||||||
|
}, [height, width, spacing]);
|
||||||
|
|
||||||
|
useEffect(() => {
|
||||||
|
setColumns(Math.ceil(width / spacing) + 3);
|
||||||
|
}, [width, spacing]);
|
||||||
|
|
||||||
|
useEffect(() => {
|
||||||
|
setRows(Math.ceil(height / spacing) + 3);
|
||||||
|
}, [height, spacing]);
|
||||||
|
|
||||||
|
// Explicitly type the array as LucideIcon[]
|
||||||
|
const iconComponents: LucideIcon[] = [
|
||||||
|
HandCoins,
|
||||||
|
Bitcoin,
|
||||||
|
Coins,
|
||||||
|
DollarSign,
|
||||||
|
Euro,
|
||||||
|
IndianRupee,
|
||||||
|
JapaneseYen,
|
||||||
|
PiggyBank,
|
||||||
|
PoundSterling,
|
||||||
|
Wallet,
|
||||||
|
Banknote,
|
||||||
|
ChartCandlestick,
|
||||||
|
CirclePercent,
|
||||||
|
CreditCard,
|
||||||
|
Gem,
|
||||||
|
Receipt,
|
||||||
|
ShoppingBasket,
|
||||||
|
Rocket,
|
||||||
|
RockingChair,
|
||||||
|
Sparkles,
|
||||||
|
ChartPie,
|
||||||
|
ChartBar,
|
||||||
|
BarChart3,
|
||||||
|
ChartLine,
|
||||||
|
TrendingDown,
|
||||||
|
TrendingUp,
|
||||||
|
Vault,
|
||||||
|
Landmark,
|
||||||
|
Briefcase,
|
||||||
|
Handshake,
|
||||||
|
Shield,
|
||||||
|
Lock,
|
||||||
|
CalendarRange,
|
||||||
|
Hourglass,
|
||||||
|
Sprout,
|
||||||
|
Target,
|
||||||
|
];
|
||||||
|
|
||||||
|
const renderIcons = ({
|
||||||
|
rows,
|
||||||
|
columns,
|
||||||
|
}: {
|
||||||
|
rows: number;
|
||||||
|
columns: number;
|
||||||
|
}) => {
|
||||||
|
const icons = [];
|
||||||
|
for (let y = 0; y < rows; y++) {
|
||||||
|
for (let x = 0; x < columns; x++) {
|
||||||
|
// Pick a random icon component from the array
|
||||||
|
const randomIndex = Math.floor(Math.random() * iconComponents.length);
|
||||||
|
const IconComponent = iconComponents[randomIndex]!;
|
||||||
|
|
||||||
|
// Slightly randomize size and position for more organic feel
|
||||||
|
const size = 28 + Math.floor(Math.random() * 8);
|
||||||
|
const xOffset = Math.floor(Math.random() * (spacing / 1.618));
|
||||||
|
const yOffset = Math.floor(Math.random() * (spacing / 1.618));
|
||||||
|
|
||||||
|
icons.push(
|
||||||
|
<IconComponent
|
||||||
|
key={`icon-${x}-${y}`}
|
||||||
|
size={size}
|
||||||
|
className="text-primary fixed"
|
||||||
|
style={{
|
||||||
|
left: `${x * spacing + xOffset}px`,
|
||||||
|
top: `${y * spacing + yOffset}px`,
|
||||||
|
opacity: opacity,
|
||||||
|
transform: `rotate(${Math.round((Math.random() - 0.5) * 30)}deg)`,
|
||||||
|
}}
|
||||||
|
/>,
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return icons;
|
||||||
|
};
|
||||||
|
|
||||||
|
return (
|
||||||
|
<div className="absolute h-full w-full">
|
||||||
|
{width > 0 && renderIcons({ rows, columns })}
|
||||||
|
</div>
|
||||||
|
);
|
||||||
|
}
|
@@ -73,12 +73,16 @@ interface YearlyData {
|
|||||||
age: number;
|
age: number;
|
||||||
year: number;
|
year: number;
|
||||||
balance: number;
|
balance: number;
|
||||||
|
untouchedBalance: number;
|
||||||
phase: "accumulation" | "retirement";
|
phase: "accumulation" | "retirement";
|
||||||
monthlyAllowance: number;
|
monthlyAllowance: number;
|
||||||
|
untouchedMonthlyAllowance: number;
|
||||||
}
|
}
|
||||||
|
|
||||||
interface CalculationResult {
|
interface CalculationResult {
|
||||||
fireNumber: number | null;
|
fireNumber: number | null;
|
||||||
|
fireNumber4percent: number | null;
|
||||||
|
retirementAge4percent: number | null;
|
||||||
yearlyData: YearlyData[];
|
yearlyData: YearlyData[];
|
||||||
error?: string;
|
error?: string;
|
||||||
}
|
}
|
||||||
@@ -101,8 +105,8 @@ const tooltipRenderer = ({
|
|||||||
return (
|
return (
|
||||||
<div className="bg-background border p-2 shadow-sm">
|
<div className="bg-background border p-2 shadow-sm">
|
||||||
<p className="font-medium">{`Year: ${data.year.toString()} (Age: ${data.age.toString()})`}</p>
|
<p className="font-medium">{`Year: ${data.year.toString()} (Age: ${data.age.toString()})`}</p>
|
||||||
<p className="text-chart-1">{`Balance: ${formatNumber(data.balance)}`}</p>
|
<p className="text-orange-500">{`Balance: ${formatNumber(data.balance)}`}</p>
|
||||||
<p className="text-chart-2">{`Monthly allowance: ${formatNumber(data.monthlyAllowance)}`}</p>
|
<p className="text-red-600">{`Monthly allowance: ${formatNumber(data.monthlyAllowance)}`}</p>
|
||||||
<p>{`Phase: ${data.phase === "accumulation" ? "Accumulation" : "Retirement"}`}</p>
|
<p>{`Phase: ${data.phase === "accumulation" ? "Accumulation" : "Retirement"}`}</p>
|
||||||
</div>
|
</div>
|
||||||
);
|
);
|
||||||
@@ -113,9 +117,10 @@ const tooltipRenderer = ({
|
|||||||
export default function FireCalculatorForm() {
|
export default function FireCalculatorForm() {
|
||||||
const [result, setResult] = useState<CalculationResult | null>(null);
|
const [result, setResult] = useState<CalculationResult | null>(null);
|
||||||
const irlYear = new Date().getFullYear();
|
const irlYear = new Date().getFullYear();
|
||||||
|
const [showing4percent, setShowing4percent] = useState(false);
|
||||||
|
|
||||||
// Initialize form with default values
|
// Initialize form with default values
|
||||||
const form = useForm<FormValues>({
|
const form = useForm<z.input<typeof formSchema>, undefined, FormValues>({
|
||||||
resolver: zodResolver(formSchema),
|
resolver: zodResolver(formSchema),
|
||||||
defaultValues: {
|
defaultValues: {
|
||||||
startingCapital: 50000,
|
startingCapital: 50000,
|
||||||
@@ -123,7 +128,7 @@ export default function FireCalculatorForm() {
|
|||||||
currentAge: 25,
|
currentAge: 25,
|
||||||
cagr: 7,
|
cagr: 7,
|
||||||
desiredMonthlyAllowance: 3000,
|
desiredMonthlyAllowance: 3000,
|
||||||
inflationRate: 2,
|
inflationRate: 2.3,
|
||||||
lifeExpectancy: 84,
|
lifeExpectancy: 84,
|
||||||
retirementAge: 55,
|
retirementAge: 55,
|
||||||
},
|
},
|
||||||
@@ -149,8 +154,10 @@ export default function FireCalculatorForm() {
|
|||||||
age: age,
|
age: age,
|
||||||
year: irlYear,
|
year: irlYear,
|
||||||
balance: startingCapital,
|
balance: startingCapital,
|
||||||
|
untouchedBalance: startingCapital,
|
||||||
phase: "accumulation",
|
phase: "accumulation",
|
||||||
monthlyAllowance: initialMonthlyAllowance,
|
monthlyAllowance: 0,
|
||||||
|
untouchedMonthlyAllowance: initialMonthlyAllowance,
|
||||||
});
|
});
|
||||||
|
|
||||||
// Calculate accumulation phase (before retirement)
|
// Calculate accumulation phase (before retirement)
|
||||||
@@ -175,13 +182,18 @@ export default function FireCalculatorForm() {
|
|||||||
newBalance =
|
newBalance =
|
||||||
previousYearData.balance * annualGrowthRate - inflatedAllowance * 12;
|
previousYearData.balance * annualGrowthRate - inflatedAllowance * 12;
|
||||||
}
|
}
|
||||||
|
const untouchedBalance =
|
||||||
|
previousYearData.untouchedBalance * annualGrowthRate +
|
||||||
|
monthlySavings * 12;
|
||||||
|
const allowance = phase === "retirement" ? inflatedAllowance : 0;
|
||||||
yearlyData.push({
|
yearlyData.push({
|
||||||
age: currentAge,
|
age: currentAge,
|
||||||
year: year,
|
year: year,
|
||||||
balance: newBalance,
|
balance: newBalance,
|
||||||
|
untouchedBalance: untouchedBalance,
|
||||||
phase: phase,
|
phase: phase,
|
||||||
monthlyAllowance: inflatedAllowance,
|
monthlyAllowance: allowance,
|
||||||
|
untouchedMonthlyAllowance: inflatedAllowance,
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -192,9 +204,23 @@ export default function FireCalculatorForm() {
|
|||||||
);
|
);
|
||||||
const retirementData = yearlyData[retirementIndex];
|
const retirementData = yearlyData[retirementIndex];
|
||||||
|
|
||||||
|
const [fireNumber4percent, retirementAge4percent] = (() => {
|
||||||
|
for (const yearData of yearlyData) {
|
||||||
|
if (
|
||||||
|
yearData.untouchedBalance >
|
||||||
|
(yearData.untouchedMonthlyAllowance * 12) / 0.04
|
||||||
|
) {
|
||||||
|
return [yearData.untouchedBalance, yearData.age];
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return [0, 0];
|
||||||
|
})();
|
||||||
|
|
||||||
if (retirementIndex === -1 || !retirementData) {
|
if (retirementIndex === -1 || !retirementData) {
|
||||||
setResult({
|
setResult({
|
||||||
fireNumber: null,
|
fireNumber: null,
|
||||||
|
fireNumber4percent: null,
|
||||||
|
retirementAge4percent: null,
|
||||||
error: "Could not calculate retirement data",
|
error: "Could not calculate retirement data",
|
||||||
yearlyData: yearlyData,
|
yearlyData: yearlyData,
|
||||||
});
|
});
|
||||||
@@ -202,6 +228,8 @@ export default function FireCalculatorForm() {
|
|||||||
// Set the result
|
// Set the result
|
||||||
setResult({
|
setResult({
|
||||||
fireNumber: retirementData.balance,
|
fireNumber: retirementData.balance,
|
||||||
|
fireNumber4percent: fireNumber4percent,
|
||||||
|
retirementAge4percent: retirementAge4percent,
|
||||||
yearlyData: yearlyData,
|
yearlyData: yearlyData,
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
@@ -230,11 +258,18 @@ export default function FireCalculatorForm() {
|
|||||||
<Input
|
<Input
|
||||||
placeholder="e.g., 10000"
|
placeholder="e.g., 10000"
|
||||||
type="number"
|
type="number"
|
||||||
{...field}
|
value={field.value as number | string | undefined}
|
||||||
onChange={(value) => {
|
onChange={(e) => {
|
||||||
field.onChange(value);
|
field.onChange(
|
||||||
|
e.target.value === ""
|
||||||
|
? undefined
|
||||||
|
: Number(e.target.value),
|
||||||
|
);
|
||||||
void form.handleSubmit(onSubmit)();
|
void form.handleSubmit(onSubmit)();
|
||||||
}}
|
}}
|
||||||
|
onBlur={field.onBlur}
|
||||||
|
name={field.name}
|
||||||
|
ref={field.ref}
|
||||||
/>
|
/>
|
||||||
</FormControl>
|
</FormControl>
|
||||||
<FormMessage />
|
<FormMessage />
|
||||||
@@ -251,11 +286,18 @@ export default function FireCalculatorForm() {
|
|||||||
<Input
|
<Input
|
||||||
placeholder="e.g., 500"
|
placeholder="e.g., 500"
|
||||||
type="number"
|
type="number"
|
||||||
{...field}
|
value={field.value as number | string | undefined}
|
||||||
onChange={(value) => {
|
onChange={(e) => {
|
||||||
field.onChange(value);
|
field.onChange(
|
||||||
|
e.target.value === ""
|
||||||
|
? undefined
|
||||||
|
: Number(e.target.value),
|
||||||
|
);
|
||||||
void form.handleSubmit(onSubmit)();
|
void form.handleSubmit(onSubmit)();
|
||||||
}}
|
}}
|
||||||
|
onBlur={field.onBlur}
|
||||||
|
name={field.name}
|
||||||
|
ref={field.ref}
|
||||||
/>
|
/>
|
||||||
</FormControl>
|
</FormControl>
|
||||||
<FormMessage />
|
<FormMessage />
|
||||||
@@ -272,11 +314,18 @@ export default function FireCalculatorForm() {
|
|||||||
<Input
|
<Input
|
||||||
placeholder="e.g., 30"
|
placeholder="e.g., 30"
|
||||||
type="number"
|
type="number"
|
||||||
{...field}
|
value={field.value as number | string | undefined}
|
||||||
onChange={(value) => {
|
onChange={(e) => {
|
||||||
field.onChange(value);
|
field.onChange(
|
||||||
|
e.target.value === ""
|
||||||
|
? undefined
|
||||||
|
: Number(e.target.value),
|
||||||
|
);
|
||||||
void form.handleSubmit(onSubmit)();
|
void form.handleSubmit(onSubmit)();
|
||||||
}}
|
}}
|
||||||
|
onBlur={field.onBlur}
|
||||||
|
name={field.name}
|
||||||
|
ref={field.ref}
|
||||||
/>
|
/>
|
||||||
</FormControl>
|
</FormControl>
|
||||||
<FormMessage />
|
<FormMessage />
|
||||||
@@ -293,11 +342,18 @@ export default function FireCalculatorForm() {
|
|||||||
<Input
|
<Input
|
||||||
placeholder="e.g., 90"
|
placeholder="e.g., 90"
|
||||||
type="number"
|
type="number"
|
||||||
{...field}
|
value={field.value as number | string | undefined}
|
||||||
onChange={(value) => {
|
onChange={(e) => {
|
||||||
field.onChange(value);
|
field.onChange(
|
||||||
|
e.target.value === ""
|
||||||
|
? undefined
|
||||||
|
: Number(e.target.value),
|
||||||
|
);
|
||||||
void form.handleSubmit(onSubmit)();
|
void form.handleSubmit(onSubmit)();
|
||||||
}}
|
}}
|
||||||
|
onBlur={field.onBlur}
|
||||||
|
name={field.name}
|
||||||
|
ref={field.ref}
|
||||||
/>
|
/>
|
||||||
</FormControl>
|
</FormControl>
|
||||||
<FormMessage />
|
<FormMessage />
|
||||||
@@ -315,11 +371,18 @@ export default function FireCalculatorForm() {
|
|||||||
placeholder="e.g., 7"
|
placeholder="e.g., 7"
|
||||||
type="number"
|
type="number"
|
||||||
step="0.1"
|
step="0.1"
|
||||||
{...field}
|
value={field.value as number | string | undefined}
|
||||||
onChange={(value) => {
|
onChange={(e) => {
|
||||||
field.onChange(value);
|
field.onChange(
|
||||||
|
e.target.value === ""
|
||||||
|
? undefined
|
||||||
|
: Number(e.target.value),
|
||||||
|
);
|
||||||
void form.handleSubmit(onSubmit)();
|
void form.handleSubmit(onSubmit)();
|
||||||
}}
|
}}
|
||||||
|
onBlur={field.onBlur}
|
||||||
|
name={field.name}
|
||||||
|
ref={field.ref}
|
||||||
/>
|
/>
|
||||||
</FormControl>
|
</FormControl>
|
||||||
<FormMessage />
|
<FormMessage />
|
||||||
@@ -337,11 +400,18 @@ export default function FireCalculatorForm() {
|
|||||||
placeholder="e.g., 2"
|
placeholder="e.g., 2"
|
||||||
type="number"
|
type="number"
|
||||||
step="0.1"
|
step="0.1"
|
||||||
{...field}
|
value={field.value as number | string | undefined}
|
||||||
onChange={(value) => {
|
onChange={(e) => {
|
||||||
field.onChange(value);
|
field.onChange(
|
||||||
|
e.target.value === ""
|
||||||
|
? undefined
|
||||||
|
: Number(e.target.value),
|
||||||
|
);
|
||||||
void form.handleSubmit(onSubmit)();
|
void form.handleSubmit(onSubmit)();
|
||||||
}}
|
}}
|
||||||
|
onBlur={field.onBlur}
|
||||||
|
name={field.name}
|
||||||
|
ref={field.ref}
|
||||||
/>
|
/>
|
||||||
</FormControl>
|
</FormControl>
|
||||||
<FormMessage />
|
<FormMessage />
|
||||||
@@ -360,11 +430,18 @@ export default function FireCalculatorForm() {
|
|||||||
<Input
|
<Input
|
||||||
placeholder="e.g., 2000"
|
placeholder="e.g., 2000"
|
||||||
type="number"
|
type="number"
|
||||||
{...field}
|
value={field.value as number | string | undefined}
|
||||||
onChange={(value) => {
|
onChange={(e) => {
|
||||||
field.onChange(value);
|
field.onChange(
|
||||||
|
e.target.value === ""
|
||||||
|
? undefined
|
||||||
|
: Number(e.target.value),
|
||||||
|
);
|
||||||
void form.handleSubmit(onSubmit)();
|
void form.handleSubmit(onSubmit)();
|
||||||
}}
|
}}
|
||||||
|
onBlur={field.onBlur}
|
||||||
|
name={field.name}
|
||||||
|
ref={field.ref}
|
||||||
/>
|
/>
|
||||||
</FormControl>
|
</FormControl>
|
||||||
<FormMessage />
|
<FormMessage />
|
||||||
@@ -378,16 +455,18 @@ export default function FireCalculatorForm() {
|
|||||||
name="retirementAge"
|
name="retirementAge"
|
||||||
render={({ field }) => (
|
render={({ field }) => (
|
||||||
<FormItem>
|
<FormItem>
|
||||||
<FormLabel>Retirement Age: {field.value}</FormLabel>
|
<FormLabel>
|
||||||
|
Retirement Age: {field.value as number}
|
||||||
|
</FormLabel>
|
||||||
<FormControl>
|
<FormControl>
|
||||||
<Slider
|
<Slider
|
||||||
name="retirementAge"
|
name="retirementAge"
|
||||||
value={[field.value]}
|
value={[field.value as number]}
|
||||||
min={18}
|
min={25}
|
||||||
max={form.getValues("lifeExpectancy")}
|
max={75}
|
||||||
step={1}
|
step={1}
|
||||||
onValueChange={(value) => {
|
onValueChange={(value: number[]) => {
|
||||||
field.onChange(...value);
|
field.onChange(value[0]);
|
||||||
void form.handleSubmit(onSubmit)();
|
void form.handleSubmit(onSubmit)();
|
||||||
}}
|
}}
|
||||||
className="py-4"
|
className="py-4"
|
||||||
@@ -412,23 +491,14 @@ export default function FireCalculatorForm() {
|
|||||||
Projected balance growth with your selected retirement age
|
Projected balance growth with your selected retirement age
|
||||||
</CardDescription>
|
</CardDescription>
|
||||||
</CardHeader>
|
</CardHeader>
|
||||||
<CardContent>
|
<CardContent className="px-2">
|
||||||
<ChartContainer
|
<ChartContainer
|
||||||
className="aspect-auto h-80 w-full"
|
className="aspect-auto h-80 w-full"
|
||||||
config={{
|
config={{}}
|
||||||
balance: {
|
|
||||||
label: "Balance",
|
|
||||||
color: "var(--chart-1)",
|
|
||||||
},
|
|
||||||
realBalance: {
|
|
||||||
label: "Real Balance",
|
|
||||||
color: "var(--chart-3)",
|
|
||||||
},
|
|
||||||
}}
|
|
||||||
>
|
>
|
||||||
<AreaChart
|
<AreaChart
|
||||||
data={result.yearlyData}
|
data={result.yearlyData}
|
||||||
margin={{ top: 20, right: 30, left: 20, bottom: 20 }}
|
margin={{ top: 10, right: 20, left: 20, bottom: 10 }}
|
||||||
>
|
>
|
||||||
<CartesianGrid strokeDasharray="3 3" />
|
<CartesianGrid strokeDasharray="3 3" />
|
||||||
<XAxis
|
<XAxis
|
||||||
@@ -439,7 +509,10 @@ export default function FireCalculatorForm() {
|
|||||||
offset: -10,
|
offset: -10,
|
||||||
}}
|
}}
|
||||||
/>
|
/>
|
||||||
|
{/* Right Y axis */}
|
||||||
<YAxis
|
<YAxis
|
||||||
|
yAxisId={"right"}
|
||||||
|
orientation="right"
|
||||||
tickFormatter={(value: number) => {
|
tickFormatter={(value: number) => {
|
||||||
if (value >= 1000000) {
|
if (value >= 1000000) {
|
||||||
return `${(value / 1000000).toPrecision(3)}M`;
|
return `${(value / 1000000).toPrecision(3)}M`;
|
||||||
@@ -452,7 +525,24 @@ export default function FireCalculatorForm() {
|
|||||||
}
|
}
|
||||||
return value.toString();
|
return value.toString();
|
||||||
}}
|
}}
|
||||||
width={25}
|
width={30}
|
||||||
|
stroke="var(--color-orange-500)"
|
||||||
|
tick={{}}
|
||||||
|
/>
|
||||||
|
{/* Left Y axis */}
|
||||||
|
<YAxis
|
||||||
|
yAxisId="left"
|
||||||
|
orientation="left"
|
||||||
|
tickFormatter={(value: number) => {
|
||||||
|
if (value >= 1000000) {
|
||||||
|
return `${(value / 1000000).toPrecision(3)}M`;
|
||||||
|
} else if (value >= 1000) {
|
||||||
|
return `${(value / 1000).toPrecision(3)}K`;
|
||||||
|
}
|
||||||
|
return value.toString();
|
||||||
|
}}
|
||||||
|
width={30}
|
||||||
|
stroke="var(--color-red-600)"
|
||||||
/>
|
/>
|
||||||
<ChartTooltip content={tooltipRenderer} />
|
<ChartTooltip content={tooltipRenderer} />
|
||||||
<defs>
|
<defs>
|
||||||
@@ -465,30 +555,12 @@ export default function FireCalculatorForm() {
|
|||||||
>
|
>
|
||||||
<stop
|
<stop
|
||||||
offset="5%"
|
offset="5%"
|
||||||
stopColor="var(--chart-1)"
|
stopColor="var(--color-orange-500)"
|
||||||
stopOpacity={0.8}
|
stopOpacity={0.8}
|
||||||
/>
|
/>
|
||||||
<stop
|
<stop
|
||||||
offset="95%"
|
offset="95%"
|
||||||
stopColor="var(--chart-1)"
|
stopColor="var(--color-orange-500)"
|
||||||
stopOpacity={0.1}
|
|
||||||
/>
|
|
||||||
</linearGradient>
|
|
||||||
<linearGradient
|
|
||||||
id="fillAllowance"
|
|
||||||
x1="0"
|
|
||||||
y1="0"
|
|
||||||
x2="0"
|
|
||||||
y2="1"
|
|
||||||
>
|
|
||||||
<stop
|
|
||||||
offset="5%"
|
|
||||||
stopColor="var(--chart-2)"
|
|
||||||
stopOpacity={0.8}
|
|
||||||
/>
|
|
||||||
<stop
|
|
||||||
offset="95%"
|
|
||||||
stopColor="var(--chart-2)"
|
|
||||||
stopOpacity={0.1}
|
stopOpacity={0.1}
|
||||||
/>
|
/>
|
||||||
</linearGradient>
|
</linearGradient>
|
||||||
@@ -497,50 +569,92 @@ export default function FireCalculatorForm() {
|
|||||||
type="monotone"
|
type="monotone"
|
||||||
dataKey="balance"
|
dataKey="balance"
|
||||||
name="balance"
|
name="balance"
|
||||||
stroke="var(--chart-1)"
|
stroke="var(--color-orange-500)"
|
||||||
fill="url(#fillBalance)"
|
fill="url(#fillBalance)"
|
||||||
fillOpacity={0.4}
|
fillOpacity={0.9}
|
||||||
activeDot={{ r: 6 }}
|
activeDot={{ r: 6 }}
|
||||||
|
yAxisId={"right"}
|
||||||
|
stackId={"a"}
|
||||||
/>
|
/>
|
||||||
<Area
|
<Area
|
||||||
type="monotone"
|
type="step"
|
||||||
dataKey="monthlyAllowance"
|
dataKey="monthlyAllowance"
|
||||||
name="allowance"
|
name="allowance"
|
||||||
stroke="var(--chart-2)"
|
stroke="var(--color-red-600)"
|
||||||
fill="url(#fillAllowance)"
|
fill="none"
|
||||||
fillOpacity={0.4}
|
|
||||||
activeDot={{ r: 6 }}
|
activeDot={{ r: 6 }}
|
||||||
|
yAxisId="left"
|
||||||
/>
|
/>
|
||||||
{result.fireNumber && (
|
{result.fireNumber && (
|
||||||
<ReferenceLine
|
<ReferenceLine
|
||||||
y={result.fireNumber}
|
y={result.fireNumber}
|
||||||
stroke="var(--chart-3)"
|
stroke="var(--primary)"
|
||||||
strokeWidth={1}
|
strokeWidth={2}
|
||||||
strokeDasharray="2 2"
|
strokeDasharray="2 1"
|
||||||
label={{
|
label={{
|
||||||
value: "FIRE Number",
|
value: "FIRE Number",
|
||||||
position: "insideBottomRight",
|
position: "insideBottomRight",
|
||||||
}}
|
}}
|
||||||
|
yAxisId={"right"}
|
||||||
|
/>
|
||||||
|
)}
|
||||||
|
{result.fireNumber4percent && showing4percent && (
|
||||||
|
<ReferenceLine
|
||||||
|
y={result.fireNumber4percent}
|
||||||
|
stroke="var(--secondary)"
|
||||||
|
strokeWidth={1}
|
||||||
|
strokeDasharray="1 1"
|
||||||
|
label={{
|
||||||
|
value: "4%-Rule FIRE Number",
|
||||||
|
position: "insideBottomLeft",
|
||||||
|
}}
|
||||||
|
yAxisId={"right"}
|
||||||
/>
|
/>
|
||||||
)}
|
)}
|
||||||
<ReferenceLine
|
<ReferenceLine
|
||||||
x={
|
x={
|
||||||
irlYear +
|
irlYear +
|
||||||
(form.getValues("retirementAge") -
|
(Number(form.getValues("retirementAge")) -
|
||||||
form.getValues("currentAge"))
|
Number(form.getValues("currentAge")))
|
||||||
}
|
}
|
||||||
stroke="var(--chart-2)"
|
stroke="var(--primary)"
|
||||||
strokeWidth={2}
|
strokeWidth={2}
|
||||||
label={{
|
label={{
|
||||||
value: "Retirement",
|
value: "Retirement",
|
||||||
position: "insideTopRight",
|
position: "insideTopRight",
|
||||||
}}
|
}}
|
||||||
|
yAxisId={"left"}
|
||||||
/>
|
/>
|
||||||
|
{result.retirementAge4percent && showing4percent && (
|
||||||
|
<ReferenceLine
|
||||||
|
x={
|
||||||
|
irlYear +
|
||||||
|
(result.retirementAge4percent -
|
||||||
|
Number(form.getValues("currentAge")))
|
||||||
|
}
|
||||||
|
stroke="var(--secondary)"
|
||||||
|
strokeWidth={1}
|
||||||
|
label={{
|
||||||
|
value: "4%-Rule Retirement",
|
||||||
|
position: "insideBottomLeft",
|
||||||
|
}}
|
||||||
|
yAxisId={"left"}
|
||||||
|
/>
|
||||||
|
)}
|
||||||
</AreaChart>
|
</AreaChart>
|
||||||
</ChartContainer>
|
</ChartContainer>
|
||||||
</CardContent>
|
</CardContent>
|
||||||
</Card>
|
</Card>
|
||||||
)}
|
)}
|
||||||
|
{result && (
|
||||||
|
<Button
|
||||||
|
onClick={() => setShowing4percent(!showing4percent)}
|
||||||
|
variant={showing4percent ? "secondary" : "default"}
|
||||||
|
size={"sm"}
|
||||||
|
>
|
||||||
|
{showing4percent ? "Hide" : "Show"} 4%-Rule
|
||||||
|
</Button>
|
||||||
|
)}
|
||||||
</form>
|
</form>
|
||||||
</Form>
|
</Form>
|
||||||
</CardContent>
|
</CardContent>
|
||||||
@@ -579,11 +693,45 @@ export default function FireCalculatorForm() {
|
|||||||
</CardHeader>
|
</CardHeader>
|
||||||
<CardContent>
|
<CardContent>
|
||||||
<p className="text-3xl font-bold">
|
<p className="text-3xl font-bold">
|
||||||
{form.getValues("lifeExpectancy") -
|
{Number(form.getValues("lifeExpectancy")) -
|
||||||
form.getValues("retirementAge")}
|
Number(form.getValues("retirementAge"))}
|
||||||
</p>
|
</p>
|
||||||
</CardContent>
|
</CardContent>
|
||||||
</Card>
|
</Card>
|
||||||
|
{showing4percent && (
|
||||||
|
<>
|
||||||
|
<Card>
|
||||||
|
<CardHeader>
|
||||||
|
<CardTitle>4%-Rule FIRE Number</CardTitle>
|
||||||
|
<CardDescription className="text-xs">
|
||||||
|
Capital needed for 4% of it to be greater than your
|
||||||
|
yearly allowance
|
||||||
|
</CardDescription>
|
||||||
|
</CardHeader>
|
||||||
|
<CardContent>
|
||||||
|
<p className="text-3xl font-bold">
|
||||||
|
{formatNumber(result.fireNumber4percent)}
|
||||||
|
</p>
|
||||||
|
</CardContent>
|
||||||
|
</Card>
|
||||||
|
|
||||||
|
<Card>
|
||||||
|
<CardHeader>
|
||||||
|
<CardTitle>4%-Rule Retirement Duration</CardTitle>
|
||||||
|
<CardDescription className="text-xs">
|
||||||
|
Years to enjoy your financial independence if you follow
|
||||||
|
the 4% rule
|
||||||
|
</CardDescription>
|
||||||
|
</CardHeader>
|
||||||
|
<CardContent>
|
||||||
|
<p className="text-3xl font-bold">
|
||||||
|
{Number(form.getValues("lifeExpectancy")) -
|
||||||
|
(result.retirementAge4percent ?? 0)}
|
||||||
|
</p>
|
||||||
|
</CardContent>
|
||||||
|
</Card>
|
||||||
|
</>
|
||||||
|
)}
|
||||||
</>
|
</>
|
||||||
)}
|
)}
|
||||||
</div>
|
</div>
|
||||||
|
16
src/app/components/footer.tsx
Normal file
16
src/app/components/footer.tsx
Normal file
@@ -0,0 +1,16 @@
|
|||||||
|
export default function Footer() {
|
||||||
|
return (
|
||||||
|
<footer className="w-full py-8 text-center text-xs">
|
||||||
|
<p className="text-xs">
|
||||||
|
© {new Date().getFullYear()} InvestingFIRE. All rights reserved.{" "}
|
||||||
|
<a
|
||||||
|
href="https://schulze.network"
|
||||||
|
target="_blank"
|
||||||
|
className="text-primary hover:underline"
|
||||||
|
>
|
||||||
|
Hosting by Schulze.network
|
||||||
|
</a>
|
||||||
|
</p>
|
||||||
|
</footer>
|
||||||
|
);
|
||||||
|
}
|
BIN
src/app/favicon.ico
(Stored with Git LFS)
BIN
src/app/favicon.ico
(Stored with Git LFS)
Binary file not shown.
@@ -1,15 +1,17 @@
|
|||||||
import "@/styles/globals.css";
|
import "@/styles/globals.css";
|
||||||
import PlausibleProvider from "next-plausible";
|
import PlausibleProvider from "next-plausible";
|
||||||
import { type Metadata } from "next";
|
import { type Metadata, type Viewport } from "next";
|
||||||
import { Geist } from "next/font/google";
|
import { Geist } from "next/font/google";
|
||||||
import { WebVitals } from "./components/web-vitals";
|
import { WebVitals } from "./components/web-vitals";
|
||||||
|
|
||||||
|
export const viewport: Viewport = {
|
||||||
|
themeColor: [{ color: "oklch(0.97 0.0228 95.96)" }],
|
||||||
|
};
|
||||||
|
|
||||||
export const metadata: Metadata = {
|
export const metadata: Metadata = {
|
||||||
title:
|
title: "InvestingFIRE | Finance and Retirement Calculator",
|
||||||
"InvestingFIRE Calculator | Plan Your Financial Independence & Early Retirement",
|
|
||||||
description:
|
description:
|
||||||
"Achieve Financial Independence, Retire Early (FIRE) with the InvestingFIRE calculator. Get personalized projections and investing advice to plan your journey.",
|
"Achieve Financial Independence & Early Retirement! Plan your FIRE journey with the InvestingFIRE calculator and get personalized projections in buttersmooth graphs.",
|
||||||
icons: [{ rel: "icon", url: "/favicon.ico" }],
|
|
||||||
};
|
};
|
||||||
|
|
||||||
const geist = Geist({
|
const geist = Geist({
|
||||||
@@ -24,17 +26,16 @@ export default function RootLayout({
|
|||||||
<html lang="en" className={geist.variable}>
|
<html lang="en" className={geist.variable}>
|
||||||
<head>
|
<head>
|
||||||
<meta name="apple-mobile-web-app-title" content="FIRE" />
|
<meta name="apple-mobile-web-app-title" content="FIRE" />
|
||||||
</head>
|
|
||||||
<PlausibleProvider
|
<PlausibleProvider
|
||||||
domain="investingfire.com"
|
domain="investingfire.com"
|
||||||
customDomain="https://analytics.schulze.network"
|
customDomain="https://analytics.schulze.network"
|
||||||
selfHosted={true}
|
selfHosted={true}
|
||||||
enabled={true}
|
enabled={true}
|
||||||
trackOutboundLinks={true}
|
trackOutboundLinks={true}
|
||||||
>
|
/>
|
||||||
|
</head>
|
||||||
<WebVitals />
|
<WebVitals />
|
||||||
<body>{children}</body>
|
<body>{children}</body>
|
||||||
</PlausibleProvider>
|
|
||||||
</html>
|
</html>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
397
src/app/page.tsx
397
src/app/page.tsx
@@ -6,13 +6,18 @@ import {
|
|||||||
AccordionItem,
|
AccordionItem,
|
||||||
AccordionTrigger,
|
AccordionTrigger,
|
||||||
} from "@/components/ui/accordion";
|
} from "@/components/ui/accordion";
|
||||||
|
import Footer from "./components/footer";
|
||||||
|
import BackgroundPattern from "./components/BackgroundPattern";
|
||||||
|
|
||||||
export default function HomePage() {
|
export default function HomePage() {
|
||||||
return (
|
return (
|
||||||
<main className="text-primary-foreground to-destructive from-secondary flex min-h-screen flex-col items-center bg-gradient-to-b p-4">
|
<main className="text-primary-foreground to-destructive from-secondary flex min-h-screen flex-col items-center bg-gradient-to-b p-2">
|
||||||
<div className="mx-auto flex flex-col items-center justify-center gap-4 text-center">
|
<BackgroundPattern />
|
||||||
<div className="flex flex-row flex-wrap items-center justify-center gap-4 align-middle">
|
<div className="z-10 mx-auto flex flex-col items-center justify-center gap-4 text-center">
|
||||||
|
<div className="mt-8 flex flex-row flex-wrap items-center justify-center gap-4 align-middle">
|
||||||
<Image
|
<Image
|
||||||
|
priority
|
||||||
|
unoptimized
|
||||||
src="/investingfire_logo_no-bg.svg"
|
src="/investingfire_logo_no-bg.svg"
|
||||||
alt="InvestingFIRE Logo"
|
alt="InvestingFIRE Logo"
|
||||||
width={100}
|
width={100}
|
||||||
@@ -31,29 +36,35 @@ export default function HomePage() {
|
|||||||
</div>
|
</div>
|
||||||
|
|
||||||
{/* Added SEO Content Sections */}
|
{/* Added SEO Content Sections */}
|
||||||
<div className="mx-auto max-w-2xl py-12 text-left">
|
<div className="z-10 mx-auto max-w-2xl py-12 text-left">
|
||||||
<section className="mb-12">
|
<section className="mb-12">
|
||||||
<h2 className="mb-4 text-3xl font-bold">
|
<h2 className="mb-4 text-3xl font-bold">
|
||||||
What is FIRE? Understanding Financial Independence and Early
|
What Is FIRE? Understanding Financial Independence and Early
|
||||||
Retirement
|
Retirement
|
||||||
</h2>
|
</h2>
|
||||||
<p className="mb-4 text-lg leading-relaxed">
|
<p className="mb-4 text-lg leading-relaxed">
|
||||||
FIRE stands for "Financial Independence, Retire Early."
|
FIRE stands for{" "}
|
||||||
It's a movement focused on aggressive saving and strategic
|
<strong>Financial Independence, Retire Early</strong>. It's a
|
||||||
investing to build a substantial portfolio. The goal is for
|
lifestyle movement built around two core ideas:
|
||||||
investment returns to cover living expenses indefinitely, freeing
|
|
||||||
you from traditional employment. Achieving FIRE means gaining the
|
|
||||||
freedom to pursue passions, travel, or simply enjoy life without
|
|
||||||
needing a regular paycheck. Sound investing advice is crucial for
|
|
||||||
building the wealth needed.
|
|
||||||
</p>
|
</p>
|
||||||
|
<ul className="mb-4 ml-6 list-disc space-y-2 text-lg">
|
||||||
|
<li>
|
||||||
|
<strong>Aggressive saving & investing</strong>—often 50%+ of
|
||||||
|
income—so your capital grows rapidly.
|
||||||
|
</li>
|
||||||
|
<li>
|
||||||
|
<strong>Passive-income coverage</strong>—when your investment
|
||||||
|
returns exceed your living expenses, you gain freedom from a
|
||||||
|
traditional 9-5.
|
||||||
|
</li>
|
||||||
|
</ul>
|
||||||
<p className="text-lg leading-relaxed">
|
<p className="text-lg leading-relaxed">
|
||||||
The core principle involves maximizing your savings rate (often
|
By reaching your personal <em>FIRE Number</em>—the nest egg needed
|
||||||
50%+) and investing wisely, typically in low-cost, diversified
|
to cover your inflation-adjusted spending—you unlock the option to
|
||||||
assets like index funds. Your "FIRE number" – the capital
|
step away from a daily paycheck and pursue passion projects, travel,
|
||||||
needed – is often estimated as 25 times your desired annual
|
family, or anything else. This calculator helps you simulate your
|
||||||
spending, derived from the 4% safe withdrawal rate guideline. This
|
journey, estimate how much you need, and visualize both your
|
||||||
FIRE calculator helps you personalize this estimate.
|
accumulation phase and your retirement withdrawals over time.
|
||||||
</p>
|
</p>
|
||||||
</section>
|
</section>
|
||||||
|
|
||||||
@@ -62,51 +73,58 @@ export default function HomePage() {
|
|||||||
How This FIRE Calculator Provides Investing Insights
|
How This FIRE Calculator Provides Investing Insights
|
||||||
</h2>
|
</h2>
|
||||||
<p className="mb-4 text-lg leading-relaxed">
|
<p className="mb-4 text-lg leading-relaxed">
|
||||||
This calculator helps visualize your path to FIRE by projecting
|
Our interactive tool goes beyond a simple “25x annual spending”
|
||||||
investment growth based on your inputs. Understanding these
|
rule. It runs a <strong>year-by-year simulation</strong> of your
|
||||||
projections is a key piece of investing advice for long-term
|
portfolio, combining:
|
||||||
planning. Here's a breakdown of the inputs:
|
|
||||||
</p>
|
</p>
|
||||||
<ul className="mb-4 ml-6 list-disc space-y-2 text-lg">
|
<ul className="mb-4 ml-6 list-disc space-y-2 text-lg">
|
||||||
<li>
|
<li>
|
||||||
<strong>Starting Capital:</strong> The total amount you currently
|
<strong>Starting Capital</strong>—your current invested balance
|
||||||
have invested.
|
|
||||||
</li>
|
</li>
|
||||||
<li>
|
<li>
|
||||||
<strong>Monthly Savings:</strong> The amount you consistently save
|
<strong>Monthly Savings</strong>—ongoing contributions to your
|
||||||
and invest each month.
|
portfolio
|
||||||
</li>
|
</li>
|
||||||
<li>
|
<li>
|
||||||
<strong>Current Age:</strong> Your current age in years.
|
<strong>Expected Annual Growth Rate (CAGR)</strong>—compounding
|
||||||
|
returns before inflation
|
||||||
</li>
|
</li>
|
||||||
<li>
|
<li>
|
||||||
<strong>Expected Annual Growth Rate (%):</strong> The average
|
<strong>Annual Inflation Rate</strong>—to inflate your target
|
||||||
annual return you expect from your investments (after fees, before
|
withdrawal each year
|
||||||
inflation).
|
|
||||||
</li>
|
</li>
|
||||||
<li>
|
<li>
|
||||||
<strong>Desired Monthly Allowance (Today's Value):</strong>{" "}
|
<strong>Desired Monthly Allowance</strong>—today's-value
|
||||||
How much you want to be able to spend each month in retirement, in
|
spending goal
|
||||||
today's money value.
|
|
||||||
</li>
|
</li>
|
||||||
<li>
|
<li>
|
||||||
<strong>Annual Inflation Rate (%):</strong> The expected average
|
<strong>Retirement Age & Life Expectancy</strong>—defines your
|
||||||
rate at which the cost of living will increase.
|
accumulation horizon and payout period
|
||||||
|
</li>
|
||||||
|
</ul>
|
||||||
|
<p className="text-lg leading-relaxed">Key features:</p>
|
||||||
|
<ul className="mb-4 ml-6 list-disc space-y-2 text-lg">
|
||||||
|
<li>
|
||||||
|
<strong>Real-time calculation</strong>—as you tweak any input,
|
||||||
|
your FIRE Number and chart update instantly.
|
||||||
</li>
|
</li>
|
||||||
<li>
|
<li>
|
||||||
<strong>Life Expectancy (Age):</strong> The age until which you
|
<strong>Interactive chart</strong> with area plots for both{" "}
|
||||||
want your funds to last.
|
<em>portfolio balance</em> and{" "}
|
||||||
|
<em>inflation-adjusted allowance</em>, plus reference lines
|
||||||
|
showing your retirement date and required FIRE Number.
|
||||||
|
</li>
|
||||||
|
<li>
|
||||||
|
<strong>Custom simulation</strong>—switches from accumulation
|
||||||
|
(adding savings) to retirement (withdrawing allowance),
|
||||||
|
compounding each year based on your growth rate.
|
||||||
</li>
|
</li>
|
||||||
</ul>
|
</ul>
|
||||||
<p className="text-lg leading-relaxed">
|
<p className="text-lg leading-relaxed">
|
||||||
The calculator simulates your investment growth year by year,
|
With this level of granularity, you can confidently experiment with
|
||||||
incorporating monthly contributions, the power of compound growth (a
|
savings rate, target retirement age, and investment assumptions to
|
||||||
core investing principle), and inflation's impact on your
|
discover how small tweaks speed up or delay your path to financial
|
||||||
target allowance. It estimates the age at which your capital could
|
independence.
|
||||||
sustain your desired, inflation-adjusted monthly spending throughout
|
|
||||||
your expected retirement until your specified life expectancy. It
|
|
||||||
calculates your potential "FIRE Number" and the age you
|
|
||||||
might reach financial independence.
|
|
||||||
</p>
|
</p>
|
||||||
</section>
|
</section>
|
||||||
|
|
||||||
@@ -117,86 +135,106 @@ export default function HomePage() {
|
|||||||
<Accordion type="single" collapsible className="w-full">
|
<Accordion type="single" collapsible className="w-full">
|
||||||
<AccordionItem value="item-1">
|
<AccordionItem value="item-1">
|
||||||
<AccordionTrigger className="text-xl font-semibold">
|
<AccordionTrigger className="text-xl font-semibold">
|
||||||
What is the 4% rule?
|
What methodology does this calculator use?
|
||||||
</AccordionTrigger>
|
</AccordionTrigger>
|
||||||
<AccordionContent className="text-lg leading-relaxed">
|
<AccordionContent className="text-lg leading-relaxed">
|
||||||
The 4% rule is a guideline suggesting that you can safely
|
We run a multi-year projection in two phases:
|
||||||
withdraw 4% of your investment portfolio's value in your
|
<ol className="ml-6 list-decimal space-y-1">
|
||||||
first year of retirement, and then adjust that amount for
|
<li>
|
||||||
inflation each subsequent year, with a high probability of your
|
<strong>Accumulation:</strong> Your balance grows by CAGR
|
||||||
money lasting for at least 30 years. This calculator uses a more
|
and you add monthly savings.
|
||||||
dynamic simulation based on your life expectancy but is related
|
</li>
|
||||||
to this concept.
|
<li>
|
||||||
|
<strong>Retirement:</strong> The balance continues
|
||||||
|
compounding, but you withdraw an inflation-adjusted monthly
|
||||||
|
allowance.
|
||||||
|
</li>
|
||||||
|
</ol>
|
||||||
|
The result: a precise estimate of the capital you'll have
|
||||||
|
at retirement (your “FIRE Number”) and how long it will last
|
||||||
|
until your chosen life expectancy.
|
||||||
</AccordionContent>
|
</AccordionContent>
|
||||||
</AccordionItem>
|
</AccordionItem>
|
||||||
|
|
||||||
<AccordionItem value="item-2">
|
<AccordionItem value="item-2">
|
||||||
<AccordionTrigger className="text-xl font-semibold">
|
<AccordionTrigger className="text-xl font-semibold">
|
||||||
Is the Expected Growth Rate realistic? Finding the right
|
Why isn't this just the 4% rule?
|
||||||
investing advice often starts here.
|
|
||||||
</AccordionTrigger>
|
</AccordionTrigger>
|
||||||
<AccordionContent className="text-lg leading-relaxed">
|
<AccordionContent className="text-lg leading-relaxed">
|
||||||
Historically, diversified stock market investments have returned
|
The 4% rule is a useful starting point (25× annual spending),
|
||||||
around 7-10% annually long-term (before inflation). A rate of 7%
|
but it assumes a fixed withdrawal rate with inflation
|
||||||
(after fees) is common, but remember past performance
|
adjustments and doesn't model ongoing savings or dynamic
|
||||||
doesn't guarantee future results, a fundamental piece of
|
market returns. Our calculator simulates each year's
|
||||||
investing advice. Choose a rate reflecting your risk tolerance
|
growth, contributions, and inflation-indexed withdrawals to give
|
||||||
and investment strategy.
|
you a tailored picture.
|
||||||
</AccordionContent>
|
</AccordionContent>
|
||||||
</AccordionItem>
|
</AccordionItem>
|
||||||
|
|
||||||
<AccordionItem value="item-3">
|
<AccordionItem value="item-3">
|
||||||
<AccordionTrigger className="text-xl font-semibold">
|
<AccordionTrigger className="text-xl font-semibold">
|
||||||
How does inflation impact my FIRE number?
|
How do I choose a realistic growth rate?
|
||||||
</AccordionTrigger>
|
</AccordionTrigger>
|
||||||
<AccordionContent className="text-lg leading-relaxed">
|
<AccordionContent className="text-lg leading-relaxed">
|
||||||
Inflation erodes the purchasing power of money over time. Your
|
Historically, a diversified portfolio of equities and bonds has
|
||||||
desired monthly allowance needs to increase each year just to
|
returned around 7-10% per year before inflation. We recommend
|
||||||
maintain the same standard of living. This calculator accounts
|
starting around 6-8% (net of fees), then running “what-if”
|
||||||
for this by adjusting your target allowance upwards based on the
|
scenarios—5% on the conservative side, 10% on the aggressive
|
||||||
inflation rate you provide, ensuring the calculated FIRE number
|
side—to see how they affect your timeline.
|
||||||
supports your desired lifestyle in future dollars.
|
|
||||||
</AccordionContent>
|
</AccordionContent>
|
||||||
</AccordionItem>
|
</AccordionItem>
|
||||||
|
|
||||||
<AccordionItem value="item-4">
|
<AccordionItem value="item-4">
|
||||||
<AccordionTrigger className="text-xl font-semibold">
|
<AccordionTrigger className="text-xl font-semibold">
|
||||||
Can I really retire early with FIRE?
|
How does inflation factor into my FIRE Number?
|
||||||
</AccordionTrigger>
|
</AccordionTrigger>
|
||||||
<AccordionContent className="text-lg leading-relaxed">
|
<AccordionContent className="text-lg leading-relaxed">
|
||||||
Retiring significantly early is achievable but demands
|
Cost of living rises. To maintain today's lifestyle, your
|
||||||
discipline, a high savings rate, and smart investing. Success
|
monthly allowance must grow each year by your inflation rate.
|
||||||
depends on income, expenses, savings habits, and investment
|
This calculator automatically inflates your desired monthly
|
||||||
returns. Use this FIRE calculator as a planning tool,
|
spending and subtracts it from your portfolio during retirement,
|
||||||
understanding it provides estimates based on your assumptions
|
ensuring your FIRE Number keeps pace with rising expenses.
|
||||||
and chosen investing approach.
|
|
||||||
</AccordionContent>
|
</AccordionContent>
|
||||||
</AccordionItem>
|
</AccordionItem>
|
||||||
|
|
||||||
<AccordionItem value="item-5">
|
<AccordionItem value="item-5">
|
||||||
<AccordionTrigger className="text-xl font-semibold">
|
<AccordionTrigger className="text-xl font-semibold">
|
||||||
What does FIRE stand for?
|
Can I really retire early with FIRE?
|
||||||
</AccordionTrigger>
|
</AccordionTrigger>
|
||||||
<AccordionContent className="text-lg leading-relaxed">
|
<AccordionContent className="text-lg leading-relaxed">
|
||||||
FIRE stands for Financial Independence, Retire Early. It
|
Early retirement is achievable with disciplined saving, smart
|
||||||
represents a lifestyle movement aimed at maximizing your savings
|
investing, and realistic assumptions. This tool helps you set
|
||||||
rate through increased income and/or decreased expenses to
|
targets, visualize outcomes, and adjust inputs—so you can build
|
||||||
achieve financial independence and retire much earlier than
|
confidence in your plan and make informed trade-offs between
|
||||||
traditional retirement age.
|
lifestyle, risk, and timeline.
|
||||||
</AccordionContent>
|
</AccordionContent>
|
||||||
</AccordionItem>
|
</AccordionItem>
|
||||||
|
|
||||||
<AccordionItem value="item-6">
|
<AccordionItem value="item-6">
|
||||||
<AccordionTrigger className="text-xl font-semibold">
|
<AccordionTrigger className="text-xl font-semibold">
|
||||||
How much should I save each month?
|
How should I use this calculator effectively?
|
||||||
</AccordionTrigger>
|
</AccordionTrigger>
|
||||||
<AccordionContent className="text-lg leading-relaxed">
|
<AccordionContent className="text-lg leading-relaxed">
|
||||||
FIRE enthusiasts typically aim to save 50-70% of their income.
|
<ul className="ml-6 list-disc space-y-1">
|
||||||
The more you can save, the faster you'll reach your FIRE
|
<li>
|
||||||
goal. However, the right amount depends on your income,
|
Start with your actual numbers (capital, savings, age).
|
||||||
lifestyle, and target retirement age. Use the calculator to
|
</li>
|
||||||
experiment with different monthly savings amounts to see their
|
<li>
|
||||||
impact on your retirement timeline.
|
Set conservative - mid - aggressive growth rates to bound
|
||||||
|
possibilities.
|
||||||
|
</li>
|
||||||
|
<li>
|
||||||
|
Slide your retirement age to explore “early” vs.
|
||||||
|
“traditional” scenarios.
|
||||||
|
</li>
|
||||||
|
<li>
|
||||||
|
Review the chart—especially the reference lines—to see when
|
||||||
|
you hit FI and how withdrawals impact your balance.
|
||||||
|
</li>
|
||||||
|
<li>
|
||||||
|
Experiment with higher savings rates or lower target
|
||||||
|
spending to accelerate your path.
|
||||||
|
</li>
|
||||||
|
</ul>
|
||||||
</AccordionContent>
|
</AccordionContent>
|
||||||
</AccordionItem>
|
</AccordionItem>
|
||||||
</Accordion>
|
</Accordion>
|
||||||
@@ -208,77 +246,48 @@ export default function HomePage() {
|
|||||||
FIRE Journey & Investing Resources
|
FIRE Journey & Investing Resources
|
||||||
</h2>
|
</h2>
|
||||||
<p className="mb-6 text-lg leading-relaxed">
|
<p className="mb-6 text-lg leading-relaxed">
|
||||||
Ready to dive deeper into FIRE and solidify your investing strategy?
|
Ready to deepen your knowledge and build a bullet-proof plan? Below
|
||||||
Explore these valuable resources for financial independence planning
|
are some of our favorite blogs, books, tools, and communities for
|
||||||
and investing advice:
|
financial independence and smart investing.
|
||||||
</p>
|
</p>
|
||||||
|
|
||||||
<div className="bg-secondary/20 my-8 rounded-md p-4 text-lg">
|
<div className="bg-foreground my-8 rounded-md p-4 text-lg">
|
||||||
<p className="font-semibold">Getting Started with FIRE:</p>
|
<p className="font-semibold">Getting Started with FIRE:</p>
|
||||||
<ol className="ml-6 list-decimal space-y-1">
|
<ol className="ml-6 list-decimal space-y-1">
|
||||||
<li>
|
<li>
|
||||||
Calculate your personal numbers using this FIRE calculator and
|
Run your first projection above to find your target FIRE Number.
|
||||||
other tools.
|
</li>
|
||||||
</li>
|
<li>Identify areas to boost savings or reduce expenses.</li>
|
||||||
<li>
|
<li>
|
||||||
Seek sound investing advice and consider joining communities
|
Study index-fund strategies and low-cost investing advice.
|
||||||
like r/Fire for support.
|
|
||||||
</li>
|
|
||||||
<li>Explore books and podcasts to deepen your understanding</li>
|
|
||||||
</ol>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div className="grid gap-8 md:grid-cols-2">
|
|
||||||
<div>
|
|
||||||
<h3 className="mb-3 text-xl font-semibold">
|
|
||||||
Blogs & Investing Websites
|
|
||||||
</h3>
|
|
||||||
<ul className="ml-6 list-disc space-y-2 text-lg">
|
|
||||||
<li>
|
|
||||||
<a
|
|
||||||
href="https://www.mrmoneymustache.com/2012/01/13/the-shockingly-simple-math-behind-early-retirement/"
|
|
||||||
target="_blank"
|
|
||||||
className="text-primary hover:underline"
|
|
||||||
>
|
|
||||||
Mr. Money Mustache - Simple Math Behind Early Retirement &
|
|
||||||
Investing
|
|
||||||
</a>
|
|
||||||
</li>
|
|
||||||
<li>
|
|
||||||
<a
|
|
||||||
href="https://www.playingwithfire.co/resources"
|
|
||||||
target="_blank"
|
|
||||||
className="text-primary hover:underline"
|
|
||||||
>
|
|
||||||
Playing With FIRE - Comprehensive Resources
|
|
||||||
</a>
|
|
||||||
</li>
|
</li>
|
||||||
<li>
|
<li>
|
||||||
|
Join{" "}
|
||||||
<a
|
<a
|
||||||
href="https://www.reddit.com/r/Fire/"
|
href="https://www.reddit.com/r/Fire/"
|
||||||
target="_blank"
|
target="_blank"
|
||||||
className="text-primary hover:underline"
|
className="text-primary hover:underline"
|
||||||
>
|
>
|
||||||
r/Fire Reddit Community
|
supportive communities like r/Fire
|
||||||
</a>
|
</a>{" "}
|
||||||
|
to learn from real journeys.
|
||||||
</li>
|
</li>
|
||||||
</ul>
|
</ol>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
<div className="grid gap-8 md:grid-cols-2">
|
||||||
<div>
|
<div>
|
||||||
<h3 className="mb-3 text-xl font-semibold">
|
<h3 className="mb-3 text-xl font-semibold">Blogs & Websites</h3>
|
||||||
Books & Investment Learning
|
|
||||||
</h3>
|
|
||||||
<ul className="ml-6 list-disc space-y-2 text-lg">
|
<ul className="ml-6 list-disc space-y-2 text-lg">
|
||||||
<li>
|
<li>
|
||||||
<a
|
<a
|
||||||
href="https://www.amazon.com/Your-Money-Life-Transforming-Relationship/dp/0143115766"
|
href="https://www.mrmoneymustache.com/"
|
||||||
target="_blank"
|
target="_blank"
|
||||||
className="text-primary hover:underline"
|
className="text-primary hover:underline"
|
||||||
>
|
>
|
||||||
Your Money or Your Life - Foundational FIRE & Investing
|
Mr. Money Mustache
|
||||||
Principles
|
</a>{" "}
|
||||||
</a>
|
- Hardcore frugality & early retirement success stories.
|
||||||
</li>
|
</li>
|
||||||
<li>
|
<li>
|
||||||
<a
|
<a
|
||||||
@@ -286,8 +295,45 @@ export default function HomePage() {
|
|||||||
target="_blank"
|
target="_blank"
|
||||||
className="text-primary hover:underline"
|
className="text-primary hover:underline"
|
||||||
>
|
>
|
||||||
Playing With FIRE Documentary
|
Playing With FIRE
|
||||||
</a>
|
</a>{" "}
|
||||||
|
- Community resources & real-life case studies.
|
||||||
|
</li>
|
||||||
|
<li>
|
||||||
|
<a
|
||||||
|
href="https://www.reddit.com/r/Fire/"
|
||||||
|
target="_blank"
|
||||||
|
className="text-primary hover:underline"
|
||||||
|
>
|
||||||
|
r/Fire
|
||||||
|
</a>{" "}
|
||||||
|
- Active forum for questions, tips, and support.
|
||||||
|
</li>
|
||||||
|
</ul>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div>
|
||||||
|
<h3 className="mb-3 text-xl font-semibold">Books & Podcasts</h3>
|
||||||
|
<ul className="ml-6 list-disc space-y-2 text-lg">
|
||||||
|
<li>
|
||||||
|
<a
|
||||||
|
href="https://www.amazon.com/Your-Money-Life-Transforming-Relationship/dp/0143115766"
|
||||||
|
target="_blank"
|
||||||
|
className="text-primary hover:underline"
|
||||||
|
>
|
||||||
|
Your Money or Your Life
|
||||||
|
</a>{" "}
|
||||||
|
- The classic guide to aligning money with values.
|
||||||
|
</li>
|
||||||
|
<li>
|
||||||
|
<a
|
||||||
|
href="https://podcasts.apple.com/us/podcast/biggerpockets-money-podcast/id1330225136"
|
||||||
|
target="_blank"
|
||||||
|
className="text-primary hover:underline"
|
||||||
|
>
|
||||||
|
BiggerPockets Money Podcast
|
||||||
|
</a>{" "}
|
||||||
|
- Interviews on FIRE strategies and wealth building.
|
||||||
</li>
|
</li>
|
||||||
<li>
|
<li>
|
||||||
<a
|
<a
|
||||||
@@ -295,37 +341,39 @@ export default function HomePage() {
|
|||||||
target="_blank"
|
target="_blank"
|
||||||
className="text-primary hover:underline"
|
className="text-primary hover:underline"
|
||||||
>
|
>
|
||||||
BiggerPockets Money Podcast - FIRE Calculators & Investing
|
InvestingFIRE Calculator Demo
|
||||||
Strategies
|
</a>{" "}
|
||||||
</a>
|
- Deep dive on how interactive projections can guide your
|
||||||
|
plan.
|
||||||
</li>
|
</li>
|
||||||
</ul>
|
</ul>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div>
|
<div>
|
||||||
<h3 className="mb-3 text-xl font-semibold">
|
<h3 className="mb-3 text-xl font-semibold">
|
||||||
Additional FIRE & Investing Calculators
|
Additional Calculators & Tools
|
||||||
</h3>
|
</h3>
|
||||||
<ul className="ml-6 list-disc space-y-2 text-lg">
|
<ul className="ml-6 list-disc space-y-2 text-lg">
|
||||||
|
<li>
|
||||||
|
<a
|
||||||
|
href="https://ghostfol.io"
|
||||||
|
target="_blank"
|
||||||
|
className="text-primary hover:underline"
|
||||||
|
>
|
||||||
|
Ghostfolio
|
||||||
|
</a>{" "}
|
||||||
|
- Wealth management application for individuals.
|
||||||
|
</li>
|
||||||
<li>
|
<li>
|
||||||
<a
|
<a
|
||||||
href="https://walletburst.com/tools/coast-fire-calculator/"
|
href="https://walletburst.com/tools/coast-fire-calculator/"
|
||||||
target="_blank"
|
target="_blank"
|
||||||
className="text-primary hover:underline"
|
className="text-primary hover:underline"
|
||||||
>
|
>
|
||||||
Coast FIRE Calculator - For those considering a partial
|
Coast FIRE Calculator
|
||||||
early retirement
|
</a>{" "}
|
||||||
</a>
|
- When you “max out” early contributions but let compounding
|
||||||
</li>
|
do the rest.
|
||||||
<li>
|
|
||||||
<a
|
|
||||||
href="https://www.empower.com/retirement-calculator"
|
|
||||||
target="_blank"
|
|
||||||
className="text-primary hover:underline"
|
|
||||||
>
|
|
||||||
Empower Retirement Planner - Free portfolio analysis and net
|
|
||||||
worth tracking
|
|
||||||
</a>
|
|
||||||
</li>
|
</li>
|
||||||
<li>
|
<li>
|
||||||
<a
|
<a
|
||||||
@@ -333,43 +381,16 @@ export default function HomePage() {
|
|||||||
target="_blank"
|
target="_blank"
|
||||||
className="text-primary hover:underline"
|
className="text-primary hover:underline"
|
||||||
>
|
>
|
||||||
CAGR Compound Interest Calculator - Understand Investment
|
Compound Interest Calculator
|
||||||
Growth
|
</a>{" "}
|
||||||
</a>
|
- Explore the power of growth rates in isolation.
|
||||||
</li>
|
|
||||||
</ul>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div>
|
|
||||||
<h3 className="mb-3 text-xl font-semibold">
|
|
||||||
Recent Investing & FIRE Articles
|
|
||||||
</h3>
|
|
||||||
<ul className="ml-6 list-disc space-y-2 text-lg">
|
|
||||||
<li>
|
|
||||||
<a
|
|
||||||
href="https://www.businessinsider.com/retiring-tech-early-coast-fire-make-me-millionaire-2025-4"
|
|
||||||
target="_blank"
|
|
||||||
className="text-primary hover:underline"
|
|
||||||
>
|
|
||||||
Coast FIRE: Retiring in your 30s while becoming a
|
|
||||||
millionaire by 60
|
|
||||||
</a>
|
|
||||||
</li>
|
|
||||||
<li>
|
|
||||||
<a
|
|
||||||
href="https://www.businessinsider.com/financial-independence-retire-early-saving-loneliness-retreat-bali-making-friends-2025-2"
|
|
||||||
target="_blank"
|
|
||||||
className="text-primary hover:underline"
|
|
||||||
>
|
|
||||||
The Social Side of FIRE: Finding Community in Financial
|
|
||||||
Independence
|
|
||||||
</a>
|
|
||||||
</li>
|
</li>
|
||||||
</ul>
|
</ul>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</section>
|
</section>
|
||||||
</div>
|
</div>
|
||||||
|
<Footer />
|
||||||
</main>
|
</main>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
11
src/app/robots.ts
Normal file
11
src/app/robots.ts
Normal file
@@ -0,0 +1,11 @@
|
|||||||
|
import type { MetadataRoute } from "next";
|
||||||
|
|
||||||
|
export default function robots(): MetadataRoute.Robots {
|
||||||
|
return {
|
||||||
|
rules: {
|
||||||
|
userAgent: "*",
|
||||||
|
allow: "/",
|
||||||
|
},
|
||||||
|
sitemap: "https://investingfire.com/sitemap.xml",
|
||||||
|
};
|
||||||
|
}
|
13
src/app/sitemap.ts
Normal file
13
src/app/sitemap.ts
Normal file
@@ -0,0 +1,13 @@
|
|||||||
|
import { BASE_URL } from "@/lib/constants";
|
||||||
|
import { type MetadataRoute } from "next";
|
||||||
|
|
||||||
|
export default function sitemap(): MetadataRoute.Sitemap {
|
||||||
|
return [
|
||||||
|
{
|
||||||
|
url: BASE_URL,
|
||||||
|
lastModified: new Date(),
|
||||||
|
changeFrequency: "yearly",
|
||||||
|
priority: 1,
|
||||||
|
},
|
||||||
|
];
|
||||||
|
}
|
1
src/lib/constants.ts
Normal file
1
src/lib/constants.ts
Normal file
@@ -0,0 +1 @@
|
|||||||
|
export const BASE_URL = "https://investingfire.com/";
|
Reference in New Issue
Block a user