Billing Clove
v1.0A minimal SaaS billing console for 2,400 subscribers: plans, invoices, refunds, dunning retries, coupons and MRR reports, in stone greys with one emerald accent.
Adresse de la page : /
Intégré
Ce que vous obtenez- Clair et sombreUtilise les couleurs de votre thème
- Ordinateur, tablette et téléphoneLes écrans pour lesquels il est conçu
- Paquets…
- Taille du code…
- Économe en batterie30 i/s, au repos quand rien ne bouge
- Pause quand masquéHors écran ou autre onglet
- Mouvement réduitCalme pour ceux qui le demandent
Vérifié à chaque modification
Sécurité vérifiée le 3 déc.- Vérification des typesTypeScript strict
- Lint et formatESLint · Prettier
- Tests et buildCaptures claires et sombres
- Audit de sécuritéAucune vulnérabilité élevée ou critique
- Ancienneté des paquetsChaque version publique depuis 7 jours ou plus
- CPU au reposMoins d’un demi-cœur au repos, ≤ 30 i/s
Code
billing-cloveReact
- billing-clove.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.
- coupons.tsxCoupons: every code with its discount, how long it lasts, how often it was used against its cap, who has it now, what it costs a month and when it ends, with Edit and Delete. New coupon opens the form.
- dunning.tsxDunning: the failed payments waiting on a retry, in three columns by how many tries they have had, each with Retry now and Email; what came back this month; and the retry schedule they follow.
- invoices.tsxInvoices: what came in over 30 days, what is still owed and refunded, then every bill newest first, filtered by status and searched by number or company. A row opens the invoice's sheet; Export saves the page shown as CSV.
- overview.tsxThe overview: the four numbers, the MRR waterfall for the picked range beside the live feed, then the plan mix, the newest subscribers and the retry queue.
- plans.tsxPlans: the four plans side by side with their prices, what they include, who is on them and their share of MRR, each with Edit and Archive; then the add-ons. New plan and New add-on open their forms.
- reports.tsxReports: twelve months of MRR movement (new and expansion above the line, contraction and churn below), ARPU and churn rate, then the month-by-month table with Export CSV.
- settings.tsxSettings: billing (invoices, retries and emails), the team, and appearance (theme and language), one tab each by ?tab=.
- 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.
- subscribers.tsxSubscribers: every company that pays or tries, filtered by status and plan, searched by name, sorted by newest, MRR or next bill. Rows open the subscriber's sheet; ticking them brings up the bulk bar. A re-sort glides the rows to their new places.
- 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).
- 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.
- bulk-bar.tsxThe bar that rises when subscribers are picked: how many, move them to a plan, cancel them (after a confirm), export them, or clear the pick.
- cancel-dialog.tsxThe confirm before a subscription is canceled: what it takes off MRR, Keep or Cancel.
- coupon-form.tsxThe coupon form (?coupon=new or ?coupon=c_welcome): the code, a percent or a fixed amount off, how many months it applies, when it expires and how many times it can be used. Errors show under their fields.
- invoice-sheet.tsxOne invoice in the side sheet (?invoice=INV-24410): who it bills, its lines and total, its payment state, and Resend, Refund, Mark paid or Retry now.
- kpi-strip.tsxThe overview's four numbers: MRR, net new MRR, churn and past due, each against the range before it with a small line of its last months (past due: its last eight days).
- mrr-waterfall.tsxThe overview's signature: MRR at the range's start, what new subscribers, upgrades, downgrades and cancellations added or took away, and where it landed. On a page load the bars land one after another and the total rolls to its value; a new range glides every bar to its new place.
- overview-panels.tsxThe overview's lower row: the plan mix by MRR, the newest subscribers and the payments waiting on a retry.
- payments-feed.tsxThe live feed: payments and plan changes as they happen, newest on top. A payment lands with a soft wash and its check draws; a failed one flashes and leans toward the Dunning link. Every row opens its subscriber.
- plan-forms.tsxThe plan form (?plan=new or ?plan=team) and the add-on form (?addon=new or ?addon=storage): names, prices per seat or per month, and a plan's features one per line. A price change moves the MRR of everyone on it.
- refund-dialog.tsxRefund an invoice: all of it or part, an amount no more than what is left, and a reason; the error shows under the field.
- settings-billing.tsxBilling settings: the company on invoices, the invoice number prefix, payment terms and tax, the retry schedule for failed payments and which emails go out. Errors show under their fields; Save keeps them.
- settings-team.tsxThe team: who can see billing and what they may do (owner, admin, finance, viewer). Invite adds a member, the role menu changes theirs, Remove takes them off; the owner stays.
- 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. The Dunning count bumps when a payment fails.
- 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.
- subscriber-form.tsxNew subscriber (?new=sub) and Edit (?edit=sub_1042): company, contact, plan, seats, billing cycle, add-ons, a coupon and, for a new one, a 14-day trial. The price it comes to updates as you pick; errors show under their fields.
- subscriber-sheet.tsxOne subscriber in the side sheet (?sub=sub_1042): who they are, what they pay and when, their invoices and their history, with Edit, Convert trial, Cancel or Reactivate, and Delete.
- top-bar.tsxThe top bar: the menu button on tablets, where you are, the date range on the overview, the live dot, New subscriber, the theme switch and the account menu. It frosts only once the page scrolls under it, with no strip behind it before.
- 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.
- mask.tsThe mask row motion: each part of a row on screen (its children) slides up from behind its own mask.
- 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 Glass style's backdrop: what shows through the see-through panels, faded out in Solid; with followBackground it paints your background instead.
- charts.tsxThe report charts: monthly MRR movement as bars above and below zero, a line that draws itself, and plain monthly columns. Past months are muted and the current one is in the accent; every value is also printed or labelled for screen readers.
- command-palette.tsxThe command palette (⌘K or Ctrl K): type to find a page, an action or a subscriber by name, then Enter.
- csv.tsExport CSV: turns rows into a CSV file and hands it to the browser to save.
- data.tsThe pages' loads, one typed hook per answer (data/api.ts names them by key), and the app's one live clock: every 7 seconds something happens in billing (data/live.ts) and every page on screen reloads in place. It rests while nothing live is on screen, the tab is hidden or the app is scrolled away.
- 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.
- 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, money and dates are written: by Intl, the current language's way ("$1,240", "1.240 US$"; "Nov 19", "19 nov."). Add a helper here when a page needs another kind.
- 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).
- 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.
- 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 any page from the address: a subscriber or invoice in a side sheet, and the subscriber, plan, add-on and coupon forms.
- 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 (a subscriber, an invoice), 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 (?sub=sub_1042&tab=invoices).
- 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.
- ui.tsxThe small pieces every page shares: a page's head, the status badges (each with its own glyph and word, never colour alone), the filter tabs, the pager, a change with its arrow and a sparkline.
- 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.
- api.tsThe fake API: every page loads and saves through these functions, so wiring a real backend happens here only.
- db.tsThe pretend database every API call reads and changes: the seeded business (data/seed.ts) plus every save. Each change that moves revenue records a move, so MRR, the waterfall and the reports always agree. Swap it for your backend.
- live.tsThe live demo: the billing system working while you watch. Each call is one thing that happens (a card charged, a payment that fails and goes to dunning, a trial that starts paying, a team adding seats, a retry that goes through) through the same database the pages read. Wire your payment provider's webhooks here instead.
- now.tsThe demo's "now": today at 10:40 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 business: Quayside's 4 plans, add-ons and coupons, about 2,400 subscribers built from a fixed recipe (signups that grow month by month, a steady trickle of churn, upgrades and downgrades), their last weeks of invoices and the revenue moves behind every MRR number. Every date is set from the demo's "now" (data/now.ts).
- types.tsThe shapes the fake API answers with: plans and add-ons, subscribers, invoices, coupons, the revenue events behind every MRR number, the activity feed, the dunning schedule and the workspace settings.
- views.tsWhat the pages show, worked out from the database: MRR now and over time, the waterfall for a range, the KPI strip, the subscriber, invoice, dunning and coupon lists, and the monthly reports. Pure reads; data/db.ts does the saving.
- 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}).
billing-clove.tsx
The page: the sections in order.
Chargement…
- Idéal pour
- SaaS teams who run subscriptions and want one calm place for plans, invoices, failed payments, coupons and MRR reports.
- Fonctionnement
- The MRR waterfall builds bar by bar as the total rolls up; payments land live and a failed one slides into the dunning count.
- Utilisation
- Edit words in content.ts and colors in theme.ts, and swap the bodies in data/api.ts for calls to your backend.