Expenses and spend
The spend preset installs expense reports with receipts and spend policies, approvals, the approved total and reimbursement on the ledger, and receipt files for AI extraction.
The spend preset is for an app in the style of Ramp or Expensify. A member
files an expense report with its receipts, the category's spend policy checks
it on submit, an approver decides it, and the reimbursement is paid through
the ledger.
Config
import { defineConfig } from "better-supabase/config";
export default defineConfig({ preset: "spend" });npx better-supabase init --preset spend starts a new project from it, and
npx better-supabase apply --preset spend adds it to one you have
(CLI).
Blocks
The preset is saas plus these blocks, and
whatever they require:
| Block | Role in the app |
|---|---|
| expenses | Reports, lines, categories, spend policies and reimbursements |
| approvals | The approval each submitted report waits on |
| attachments | Receipt images and PDFs on each line |
| ai-files | Receipt files handed to a model to read the amount and date |
The expenses block posts on the ledger, which the preset installs as one of its requirements.
How the blocks connect
submit checks each line against its category's spend policy, then the
report waits on its approval. When the approval is final, each category's
total posts on its expense account against the member's payable account, and
reimburse settles the payable account from expense cash. Each posting has
a key per report, so it can't post twice, and what the organization owes a
member is a ledger balance (expenses).
With ReUI
- Data Grid for reports, with Filters on status, category and amount.
- A file upload with a preview of the receipt next to the line form.
- Badge variants for the report status (submitted, approved, reimbursed).
Last updated on
Legal practice
The legal preset installs clients and matters, time billed from a rate card into invoices, a trust ledger, documents with versions and signatures.
Contracts
The contracts preset installs a contract lifecycle with renewals and obligations, counterparties as parties, signatures on a frozen version and renewal reminders.