Public
Remixed
Track expenses with categories, summary stats, and filtering
Val Town is a collaborative website to build and scale JavaScript apps.
Deploy APIs, crons, & store data – all from the browser, and deployed in milliseconds.

πŸ’° Expense Tracker

A full-stack expense tracker built with React + Hono + SQLite on Val Town.

Features

  • Add expenses β€” amount, description, category, and date
  • Summary cards β€” total spending, this month's total, transaction count
  • Category breakdown β€” visual bars showing spending by category
  • Filter by category β€” clickable chips to filter the expense list
  • Delete expenses β€” remove entries with one click
  • Persistent storage β€” all data saved in val-scoped SQLite

Live URL

Click the val's HTTP endpoint URL to open the app in your browser.

Architecture

Rendering mermaid diagram...

File structure

index.ts                        ← Hono backend (serves frontend + API routes)
frontend/
  index.html                    ← HTML shell (loads Twind + React)
  index.tsx                     ← React entrypoint
  favicon.svg                   ← App icon
  components/
    App.tsx                     ← Root layout, data fetching, state
    SummaryCards.tsx            ← Total / this month / transaction count
    ExpenseForm.tsx             ← Add new expense form
    ExpenseList.tsx             ← Expense list with category filter + delete
    CategoryBreakdown.tsx       ← Spending by category with progress bars

API

MethodRouteDescription
GET/api/expensesList all expenses
POST/api/expensesCreate a new expense
DELETE/api/expenses/:idDelete an expense
GET/api/statsSummary stats + category totals