Naar de inhoud

Expenses Birch

v1.0

A minimal SaaS expense desk for a consultancy: expenses, claims to approve, project budgets, company cards to match and spend insights, on paper-white with one teal accent.

$69

Pagina-adres: /

Ingebouwd

Wat je krijgt
  • Licht en donkerGebruikt de kleuren van je thema
  • Desktop, tablet en telefoonDe schermen waarvoor het is gebouwd
  • Pakketten…
  • Codegrootte…
  • Zuinig voor de batterij30 fps, rust als er niets beweegt
  • Pauzeert als het verborgen isBuiten beeld of ander tabblad
  • Minder bewegingRustig voor wie erom vraagt

Bij elke wijziging gecheckt

Beveiliging gecheckt op 3 dec
  • TypecheckTypeScript strict
  • Lint en opmaakESLint · Prettier
  • Tests en buildScreenshots in licht en donker
  • BeveiligingsauditGeen hoge of kritieke advisories
  • Leeftijd van pakkettenElke versie al 7+ dagen openbaar
  • CPU in rustOnder een halve core in rust, ≤ 30 fps

Code

expenses-birchReact
  • expenses-birch.tsxThe page: the sections in order.
  • content.tsEvery word and number: brand, nav links, each section's copy and lists.
  • theme.tsThe colors as CSS variables, and the shared class strings.
  • README.mdHow to install it, and where to change the text, colors and form.
  • pagesOne file per page: the sections it shows, in order.
    • approve.tsxTo approve: every submitted claim, oldest first, to open in the side sheet or approve straight from the row; what was decided today sits beside it.
    • budgets.tsxBudgets for the quarter, by project or by department (?tab=dept): the totals, the spend line so far, what is near its limit, and each budget's meter (spent, then what waits for approval). A row opens its form.
    • cards.tsxCompany cards: each card's month against its limit (freeze, unfreeze, remove), then the card payments, new ones arriving live, to match to an expense (?match=TX-5120), and the ones already matched (?tab=matched).
    • claims.tsxEvery claim: status tabs with counts and a search in the address (#/claims?status=approved), a table whose rows open the claim's sheet, and paying every approved claim at once.
    • expenses.tsxMy expenses (or everyone's): status tabs with counts, search, category, budget and flagged filters in the address (#/expenses?status=draft&cat=meals), a table whose rows open the expense's sheet, and the bulk bar for picked drafts.
    • insights.tsxInsights over 3, 6 or 12 months (?range=12): spend by month (the bars morph when the range changes), the policy flag rate, spend by category and the top spenders.
    • overview.tsxThe overview: a greeting with what waits, the KPI strip, the claims to approve, project budgets against their limits, spend by category against last month, and the live feed.
    • settings.tsxSettings in four tabs (?tab=): expense categories, the spending policy, the approvers, and Appearance (theme and language).
    • sign-in.tsxThe sign-in page (#/sign-in): the logo and the form on one card over the backdrop, without the sidebar and top bar.
  • sectionsOne file per page section.
    • account-menu.tsxThe account menu under the avatar in the top bar: who is signed in, Settings and Sign out; the arrow keys move through it, Escape, Tab or a click outside closes it.
    • appearance.tsxSettings → Appearance: the theme (System, Dark or Light), each choice shown as a small preview, and the language (System or one of locales/list.ts).
    • approve-list.tsxThe approval queue: each submitted claim with who sent it, its lines, its policy flags, how long it has waited and its total, plus Approve and Reject. Approving sweeps the row out (parts/decide.ts) and the rows under it glide up.
    • bottom-tabs.tsxThe phone's tab bar: the four pages used most, and More for the rest (the sidebar in a sheet). It sticks to the bottom of the screen under the page.
    • budget-form.tsxA budget's form in a dialog (?budget=new or ?budget=b-hal-112): name, code, type, owner and the quarter's limit; deleting asks once more inside the dialog.
    • bulk-bar.tsxThe bar that rises when drafts are picked: how many, put them in a draft claim or a new one, delete them (Undo in the toast), or clear the pick.
    • claim-sheet.tsxA claim in the side sheet (?claim=CLM-1042): who sent it and its total, its lines with their policy flags, what it does to each budget, its timeline, and the next step for its status (submit, approve or reject, pay).
    • expense-sheet.tsxAn expense in the side sheet (?expense=EX-2041) or a new one (?new=expense, the top bar's New expense): the form while it is a draft, its policy flags with why, its claim and card payment, and its history.
    • feed.tsxThe live feed: who did what, newest first, with the claim or the card payment and its amount; a row that arrives (a card payment, a teammate's claim, your approval) slides in at the top.
    • kpi-strip.tsxThe KPI strip: four numbers in one bordered box, each with its line under it and a sparkline or a progress bar; a changed number rolls to its new value and a sparkline grows a point.
    • match-dialog.tsxMatching a card payment (?match=TX-5120): the payment, the card holder's expenses that look most like it (closest amount and day first), and making an expense from it when none fits.
    • new-claim.tsxA new claim (?new=claim, or New claim… with expenses picked, ?new=claim&pick=EX-2041,EX-2042): a name, the loose drafts to put in it, and whether to submit it at once.
    • reject-dialog.tsxRejecting a claim (?reject=CLM-1042): a reason the owner reads, then the claim goes back to them; Undo in the toast puts it back in the queue.
    • settings-forms.tsxThe settings tabs' bodies: expense categories with their limits (add and edit in a dialog, ?category=new), the spending policy, and who approves claims.
    • sidebar.tsxThe sidebar: the workspace, search with the ⌘K shortcut, the pages in two groups with their counts and a pill that glides to the current one, Settings, and the live strap with its pause.
    • sign-in-form.tsxThe sign-in form: email and password with their errors under them, show or hide the password, keep me signed in, and the demo account to fill in; a wrong pair says so above the fields.
    • top-bar.tsxThe top bar: the menu button on narrow screens, where you are, the live dot, the theme switch, New expense and the account menu. It frosts only once the page scrolls under it.
  • partsWhat several sections share.
    • buildWhat several sections share.
      • cardsWhat several sections share.
        • odometer.tsxThe odometer card style: cards rise while every number rolls digit by digit to its value.
      • rowsWhat several sections share.
        • slide.tsThe slide row motion: each row on screen slides 12px in from the nav side, from faint.
      • core.tsxThe page's build-in: on first load and on every page switch the cards arrive in the app's card style and their contents build: bars grow, lines draw, rings fill, the list rows on screen ripple in in the app's row motion, numbers count. The two picks are wired in ./index.ts.
      • index.tsThe app's two build-in picks, wired here and nowhere else: its card style (cards/) and its row motion (rows/). npm run new-app copies only the two it is given (--cards, --rows).
    • appearance.tsHow the app looks right now: dark or light, Glass or Solid, from Settings → Appearance, the page around it and the Style setting.
    • avatar.tsxA person's initials in a round badge, tinted with the primary.
    • backdrop.tsxThe backdrop behind the app: Birch is Solid, so it stays faded out on the still ground; with followBackground it paints your background instead.
    • bar-chart.tsxA bar chart: bars grow in, and the picked bar (in the primary), its guide line and tooltip glide to the bar you point at or pick with the arrow keys; a new range morphs the bars instead of drawing them again.
    • command-palette.tsxThe command palette (⌘K or Ctrl K): type to find a page or an action, then Enter.
    • decide.tsApproving a claim, the app's signature: the row sweeps out to the end side and fades, the approval saves, and every page reloads in place, so the rows below glide up (parts/flip.ts), the budget meters tween to the new spend and the KPI numbers roll. Undo puts the claim back in the queue.
    • dialog.tsxA centered modal dialog (a form, a confirm): rises in, plays its way out, Escape or a tap outside closes it, and the focus goes back where it was.
    • expense-ui.tsxThe small pieces every page shares: a status glyph and chip (a ring that fills as a claim moves on, like a task tracker), policy flag chips, a category's colour dot, initials, a budget meter whose bars tween to new spend, and which rows just arrived (they slide in).
    • field.tsxA labeled form field (a text input or a select) with its error line under it, tied together for screen readers.
    • flip.tsFLIP for a list that re-sorts or filters: after each change every row that stayed glides from where it was to where it is now. Rows carry data-flip="<id>"; positions are measured inside the list, so a page scroll never reads as a move.
    • format.tsHow numbers and dates are written: by Intl, the current language's way ("1,240", "1.240"; "Nov 19", "19 nov."). Add a helper here when a page needs money, times or a list.
    • icons.tsxThe logo and the line icons, drawn on a 24-unit grid with round ends.
    • language.tsThe app's language: the words every page reads (useWords), how dates and numbers are written (parts/format.ts) and the reading direction. Picked in Settings → Appearance (or System: the page's own language) and kept in this browser; English is built in, any other language loads only when it shows (locales/list.ts).
    • line-chart.tsxA line chart with a soft area under it, in the primary: the line draws itself in, the latest point marked, and new values roll the line to its new shape.
    • live-clock.tsxOne shared clock for everything live: it ticks only while something on screen listens, the tab is visible and live isn't paused, and the bare button that pauses it. What a tick does (move the demo's time, bring in an event, reload) is the app's, passed to liveClock.
    • live.tsThe app's one live clock: every 12 seconds a company card is used (data/live.ts) and every 41 a teammate sends in a claim; each reloads the pages in place, and the waiting ages redraw every 30. It rests while nothing live is on screen, the tab is hidden or live is paused.
    • moments.tsThe animations the sidebar, the sign-in card, menus, dialogs, the phone sheet and toasts play, timed by their moments in theme.ts.
    • motion.tsMotion helpers: the reduced-motion check, live, and run-once-in-view.
    • overlays.tsxEverything that opens over the page from the address: an expense or a claim in the side sheet, a new expense, a new claim, matching a card payment, rejecting a claim and a budget's form. Any page can open one by adding its query (?claim=CLM-1042).
    • read.tsOne read of the fake API by its key, through useApi: useRead("overview"), useRead<"claim">(`claim:${id}`). Each key keeps one load function, so a page that mounts again finds its answer.
    • router.tsThe page switcher: reads the app's page from the address hash (#/settings, #/?status=open).
    • scroll-to-view.tsScrolls an element into view moving only its own scroll container, never the page around it.
    • select-box.tsxA native select dressed to match the app: no browser arrow, a drawn chevron instead.
    • session.tsWhether someone is signed in: a first visit is signed in as the demo account; Sign out holds until the next sign-in, and a sign-in without Keep me signed in lasts only this tab.
    • sheet.tsxThe phone sheet: a modal panel that springs in from the left with the sidebar; Escape, a tap outside or its close button slides it away.
    • side-sheet.tsxThe detail sheet: a modal panel that slides in from the end edge over the page (an expense, a claim), with tabs whose underline glides to the one picked. Escape, a tap outside or its close button slides it away; the address keeps what it shows (?claim=CLM-1042&dtab=timeline).
    • states.tsxThe data states every page shares: a calm skeleton while loading, an error with Try again, and an empty note with a way out.
    • store.tsThe app-wide state several parts share: the theme mode and style (kept in the browser) and the toasts.
    • ticker.tsxA number that counts up while its page builds in, and rolls to its new value whenever it changes.
    • toasts.tsxThe toasts: short notes that confirm what just happened, at the bottom end.
    • use-api.tsLoads data through the fake API with loading, error and retry, remembering each answer so a page you come back to shows at once.
    • use-dialog.tsOpens and closes a native <dialog> as a modal; on close it plays its way out first (data-closing), so dialogs, sheets and the palette never vanish in one frame.
  • dataThe pretend data and the fake API: swap it for your backend.
    • account.tsThe demo account: who is signed in (the account menu shows them) and the email and password the sign-in page takes. Nora runs finance and approves the claims.
    • api.tsThe fake API: every page loads and saves through these functions, so wiring a real backend happens here only.
    • db.tsThe pretend database: the seed and its year of history, the policy checks that flag an expense, and every change a page can make (expenses, claims and their approval, budgets, cards and matching, categories and policy). data/api.ts is the only caller; swap it for your backend.
    • history.tsA year of expenses drawn from the seed (the same every load): about 240 a month, grouped into weekly claims; old claims are paid, the last two weeks wait to be approved or paid, and the company cards carry their transactions, a few of them still to match.
    • live.tsThe live demo: the company cards being used while you watch, and now and then a teammate sending in a claim. Each call is one event through the same database the pages read; wire your card feed and backend events here instead.
    • now.tsThe demo's "now": today at 14:20 plus the real time since the app loaded, so today is busy at any hour; every seeded date is set from it. Wire your backend and use the real time.
    • seed.tsThe pretend consultancy: its people, expense categories with their limits, the quarter's project and department budgets, the company cards, the policy, and the merchants and notes the history is drawn from. FILL your own in from your backend.
    • types.tsThe shapes of the pretend data: people, categories, budgets, expenses, claims, company cards with their transactions, the policy and the activity log.
    • views.tsWhat each page reads, worked out from the database: the overview's numbers and queue, filtered expense and claim lists, a claim with its budget impact, budgets spent against their limits, cards and the transactions to match, insights by month and category, and the settings.
  • localesEvery word the app shows, one JSON file a language; list.ts names them.
    • en.jsonOne language's words, with the keys of en.json.
    • es.jsonOne language's words, with the keys of en.json.
    • list.tsThe languages the app offers, in the picker's order: one JSON file each, en.json the source. To remove one, delete its file and its line; to add one, copy es.json, translate it and add a line. English is built in; the rest load only when picked. TypeScript checks each file has en.json's keys, scripts/check/check-locales.mjs the rest (no extra keys, plural forms, {slots}).

expenses-birch.tsx

The page: the sections in order.

Laden…
Goed voor
Consultancies and small firms whose people file expenses and claims, with one finance approver watching project budgets and cards.
Hoe het werkt
Approve a claim: its row sweeps out, the rows below glide up, budget meters tween and card payments keep arriving to match.
Hoe je het gebruikt
Edit words in content.ts and colors in theme.ts, and swap the bodies in data/api.ts for calls to your backend.