Skip to content
All work

Ra Invoices

An invoice app built in an afternoon. Now a studio runs its whole billing on it.

Role
macOS Engineer
Platforms
macOS
Year
2025
Invoice editor: hourly or fixed line items, totals computed live

A bandmate of mine runs a recording studio, Studio Ra. I was there for a session and watched him building an invoice by hand in Canva for the client who had just finished recording, nudging text boxes around to bill someone.

I went home and built him an invoicing app that evening: a native macOS app, SwiftUI and SwiftData, with the invoice drawn directly through CoreGraphics rather than exported from a web template, so it stays sharp when printed. It did not stay small. He also runs a music school from the same studio, so I added a second module, Ra School of Music, that tracks monthly fees per student across multiple classes, carries forward unpaid balances, and sends formal WhatsApp payment reminders that escalate into a follow-up automatically if the first one goes unanswered. What started as one invoice is now the app the whole business runs its billing on.

0
cloud dependencies
2 hours
from seeing the problem to a working app
  • Swift 6
  • SwiftUI
  • SwiftData
  • CoreGraphics
  • PDFKit
  • AppKit

How it started.

  1. The friction

    A bandmate of mine runs a recording studio. I was there for a session, and after the client finished recording I watched him put their invoice together by hand in Canva, dragging text boxes into place to bill someone for work he had just done.

  2. What I built

    I went home and built him an invoicing app that evening. Native macOS, SwiftUI and SwiftData, with the invoice drawn directly through CoreGraphics (real text metrics, tables that wrap and spill across pages) rather than exported from a web template that would blur when printed. I sent him the DMG.

  3. What it changed

    He was genuinely happy, because a small part of his week stopped being annoying. He kept using it, and kept asking for more of his billing to live there, which is how it grew into a second module for the music school he runs from the same studio, well past the single evening it started as.

How it was built.

Drawing the PDF rather than rendering HTML to one

Problem
The quick way to make a PDF is to lay it out in HTML and print that to a file. The output pixelates under zoom and prints poorly, which looks amateur on the document a studio uses to ask for money.
Approach
Direct CGContext drawing with real text metrics from CTFont and NSAttributedString bounding rects: computing cell heights, wrapping multi-line descriptions, and spilling tables across pages with repeated headers and no row split across a boundary.
Trade-off
Every layout rule became arithmetic I had to write myself, which is considerably more work than filling in a template. It is also why the invoice looks like it came from a studio rather than from a form.

A fee tracker that remembers what a spreadsheet forgets

Problem
A music school bills monthly, per student, often across several classes at once, and dues do not reset when a payment is late. They carry forward. A spreadsheet tracks none of that structurally; it just has cells someone has to remember to update.
Approach
SwiftData models enrollment, not just payment: a student can hold several class enrollments, each with its own fee, and every month starts unpaid automatically. Waived months, adjusted fees and stopped billing all keep their history rather than overwriting it, so previous dues compute themselves instead of being tracked by hand.
Trade-off
The studio always knows who owes what without reconstructing it from memory. The cost is a materially more complex data model than a single invoice ever needed, justified once the feature was something he'd actually use weekly, not once.