Public
Remixed
Simple invoice builder — create invoices and add line items
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.

Invoice Builder

A simple invoice builder for creating and managing invoices. Create invoices, add line items, and print or save as PDF.

Features

  • Home screen — List all invoices with quick access to edit or delete
  • Invoice editor — Focus on line items, settings collapse by default
  • Live preview — See your invoice update in real time as you edit
  • Auto-save — Changes automatically save to the database
  • Line items — Add/remove items with description, quantity, and rate
  • Print / PDF — Clean print layout; use browser print dialog to save as PDF
  • Pre-filled defaults — Business and client details rarely change; edit them in settings

How to use

  1. Home screen — Click "+ New Invoice" to create a new invoice or "Edit" to modify an existing one
  2. Add items — Enter description, quantity, and rate for each line item
  3. Adjust settings — Click "⚙ Settings" to change invoice number, date, client, or business details
  4. Print / Save PDF — Click "Print / Save PDF" and use your browser's print dialog

File structure

index.ts                       ← Hono server + API
frontend/
  index.html                   ← HTML shell (Twind + React)
  index.tsx                    ← React entrypoint
  components/
    App.tsx                    ← Root component (navigation & auto-save)
    Home.tsx                   ← Invoice list & create new
    InvoiceForm.tsx            ← Line items editor + settings
    InvoicePreview.tsx         ← Printable invoice preview

Database

Invoices are stored in SQLite at iorek/invoice-builder with the invoices table:

  • id — Unique invoice ID
  • number — Invoice number (e.g., HBFANRDP-0003)
  • date — Issue date
  • dueDate — Due date
  • createdAt — When invoice was created
  • updatedAt — Last update timestamp
  • data — Full invoice JSON (line items, business details, etc.)

Auto-save

The app debounces changes and saves automatically 1 second after you stop typing. Look for the save status indicator in the top bar: "✓ Saved", "Saving...", or "Unsaved changes".