A simple yet powerful Expense Tracker built with SvelteKit and TypeScript. It allows users to record, filter, and analyze their spending — all stored locally in the browser using localStorage.
Add a new expense by entering the amount, category, and a short description.
When you click Add Expense, the app creates a new expense object with:
iddatecategoryamountExpenses are stored in localStorage, so your data remains even after refreshing the page.
Computed values (like totals) are handled reactively using Svelte’s $: syntax — they automatically update whenever the data changes.
| File | Purpose |
|---|---|
src/lib/types.ts |
Defines the Expense interface and available categories. |
src/routes/+page.svelte |
The main component for adding, viewing, and deleting expenses. |
src/app.css |
Global styles (Tailwind CSS included). |
Make sure you have Node.js (v18+) installed.
# 1. Clone the repository
git clone https://github.com/yourusername/expense-tracker-svelte.git
cd expense-tracker-svelte
# 2. Install dependencies
npm install
# 3. Run the development server
npm run dev
The app will be live at http://localhost:5173 (or as shown in your terminal).
Angela Kinoro Built using SvelteKit.