Business & shops

Build an invoice app for freelancers (native iPhone)

A native iPhone build brief for freelancers: save clients, log hours or items, and turn them into a clean numbered PDF invoice you can send from the share sheet.

Apirex TeamUpdated AndroidiOS
On this page
  1. Screens
  2. Data model
  3. Native features
  4. Android notes (Kotlin and Jetpack Compose)
  5. iPhone notes (Swift and SwiftUI)
  6. Copy-paste prompt
  7. Acceptance test
  8. Frequently asked questions
5screens
4data tables
171word prompt
2platforms: Android, iOS

The first freelance gig is exciting until the client asks, 'Can you send an invoice?' and the only option is a messy spreadsheet. This brief builds a pocket invoice maker for designers, editors and tutors: add a client once, log hours or items, tap Create and get a tidy numbered PDF to send from the share sheet. The best fit is native iPhone, where SwiftData, UIGraphicsPDFRenderer and ShareLink cover the whole job offline; building it needs a Mac with Xcode. The Android version uses Room, PdfDocument and the share sheet, and it comes together just as well. The first proof: one client, three line items and a correct total in a PDF that opens in Mail.

Screens

  • Invoices: A list of drafts, sent and paid invoices with totals and due dates.
  • New invoice: Pick a client, add hourly or fixed line items, set tax and a due date.
  • Preview: The exact PDF layout before sending, with your name, logo and payment details.
  • Clients: Saved names, email addresses, billing addresses and default rates.
  • Business profile: Your details, currency, invoice number prefix and payment instructions.

Data model

Invoice records kept on the device
TableKey fieldsPurpose
clientsid (uuid), name (text), email (text), address (text), default_rate (numeric)People and companies you bill, with the rate you usually charge them.
invoicesid (uuid), client_id (uuid), number (text unique), issued_on (date), due_on (date), status (text), currency (text)The invoice header, with a number that is never reused.
line_itemsid (uuid), invoice_id (uuid), description (text), quantity (numeric), unit_price (numeric), tax_rate (numeric)Hours or fixed items, calculated into the subtotal, tax and total.
business_profileid (int), display_name (text), logo_uri (text), payment_details (text), number_prefix (text), next_number (int)Who the invoice is from and how the next number is formed.

Everything fits on the phone, which matters for freelancers who do not want client details in yet another cloud service. Store money as decimal values, never floating point, and round only at the line and total level the owner agrees on. Assign the invoice number at the moment the invoice is first sent, not when a draft is created, so abandoned drafts do not leave gaps. If backup or a second device becomes important, connect your own Supabase with row-level security per freelancer, and say in the app when data starts to sync.

Native features

The value here is a professional document with zero setup. The PDF renderer draws the layout at exact page size, the share sheet hands the file to Mail, WhatsApp or Files, and a status flag tracks what has been paid. Tax rules differ by country and by registration, so the app should let the freelancer enter their own tax label and rate rather than claiming any invoice is compliant by default.

FeatureAndroid (Kotlin)iPhone (SwiftUI)Notes
Making the PDFandroid.graphics.pdf.PdfDocument with a Canvas layoutUIGraphicsPDFRenderer drawing text and a tableDraw from the saved data each time so the PDF always matches the numbers.
SendingACTION_SEND with a FileProvider URIShareLink or UIActivityViewControllerAttach the PDF and prefill the subject with the invoice number.
Your logoPhoto picker into app storagePhotosPicker into the app containerScale the logo for the header; keep the original for later edits.
Due remindersWorkManager one-off reminder on the due dateLocal notification on the due dateRemind the freelancer, not the client; nothing is emailed automatically.

Android notes (Kotlin and Jetpack Compose)

On Android, keep invoice maths in a pure Kotlin function with unit tests, using BigDecimal throughout, and let Compose screens only display the result. Room relations can load an invoice with its line items and client in one query for the preview.

  • Lay out the PDF on an A4 or Letter PdfDocument page: header with logo, from and to blocks, a line-item table that continues onto a second page when long, then subtotal, tax and total aligned right.
  • Write the file to cacheDir, share it through a FileProvider with read permission, and keep a copy in app storage so a sent invoice can be reopened exactly as it was.
  • On a real phone, create an invoice with 25 line items to force a second page, share it to a mail app and check the totals line up and nothing is cut off at the page edge.

iPhone notes (Swift and SwiftUI)

On iPhone, SwiftData models for clients, invoices and line items keep everything offline, and Decimal keeps money precise. A Form with sections makes the New invoice screen feel native without custom controls.

  • Render pages with UIGraphicsPDFRenderer at the chosen paper size, measuring each line-item row's height with NSAttributedString boundingRect so long descriptions wrap instead of overlapping the next row.
  • Use ShareLink with the generated file URL and a subject that includes the invoice number; mark the invoice as sent only after the share completes.
  • Test on a physical iPhone in a non-English region format, checking that the currency symbol, decimal separator and dates follow the freelancer's settings.

Copy-paste prompt

Build this yourself 169 words · Android
I just started freelancing as a designer and I hate making invoices in spreadsheets. Build me an invoice app for Android that works offline. Screens: Invoices, New invoice, Preview, Clients and Business profile. I save clients with their email and usual rate, then make an invoice by picking a client and adding hourly or fixed line items, a tax label and rate I type myself, and a due date. Show subtotal, tax and total with exact decimal maths. Preview the real PDF with my name, logo and payment details, then create it with the native PDF renderer and open the share sheet so I can send it by mail or WhatsApp. Number invoices automatically with my prefix and never reuse a number. Let me mark invoices as sent or paid and remind me on the due date. Keep everything on my phone: no account, no ads. Handle long item lists that need a second page. Acceptance: three items give the right total and the PDF opens correctly in Mail.

Opens Apirex with this prompt in the box. Pick the Android · Kotlin tab before you send.

Acceptance test

  1. Fill in the Business profile with a logo and the prefix DS-, then add a client with a default hourly rate.
  2. Create an invoice with two hourly items and one fixed item, a tax rate of 18 per cent and a due date; check the totals by hand.
  3. Preview and share the PDF to Mail; confirm the number reads DS-0001 and the attached file matches the preview.
  4. Start a second invoice, abandon it as a draft, then send a third; confirm the sent invoice is DS-0002 with no gap.
  5. Mark the first invoice paid, close the app, reopen it and confirm the status, the PDF and the totals are unchanged.

Check the awkward cases on purpose: a zero-rate item, a quantity of 0.5 hours, a very long client address and a currency with no decimal places. The PDF should handle each cleanly, and a reopened old invoice must keep the business details it was sent with, even after the profile changes.

Frequently asked questions

Will the invoices be tax compliant?

The app adds whatever tax label and rate you enter, and the layout includes the usual fields. Invoice rules depend on your country and registration, so check the required details with an accountant before relying on it.

Can it email the client automatically?

Not in this brief. It opens the share sheet with the PDF attached, and you choose how to send it. Automatic emailing would need your own backend and a mail service.

Why is iPhone listed as the best fit?

Many freelancers in design and media use iPhones, and SwiftData plus the PDF renderer make an offline invoice maker straightforward. Building the iPhone version needs a Mac with Xcode; the Android route works the same way.

Build this blueprint

The blueprint prompt, ready for your platform. Edit anything before you send it.

AndroidKotlin · Jetpack ComposeReal source on your computer

Opens Apirex with this prompt. Pick the Android · Kotlin tab before you send. The Free plan includes 5 Rex Credits a day.