Invoices Slate
v1.0A minimal SaaS invoicing app for a small studio: invoices with line items and tax, clients, part payments, recurring schedules and reports, in cool slate greys with one cobalt accent.
صفحے کا پتہ: /
پہلے سے شامل
آپ کو کیا ملتا ہے- لائٹ اور ڈارکآپ کی تھیم کے رنگ استعمال کرتا ہے
- ڈیسک ٹاپ، ٹیبلٹ، اور فونوہ اسکرینز جن کے لیے یہ بنایا گیا
- پیکجز…
- کوڈ کا سائز…
- بیٹری پر ہلکا30 fps، ساکن ہو تو رک جاتا ہے
- چھپنے پر رک جاتا ہےاسکرین سے باہر یا دوسرا ٹیب
- کم حرکتجو لوگ کہیں ان کے لیے پرسکون
ہر تبدیلی پر جانچ
سکیورٹی جانچ 3 دسمبر- ٹائپ چیکTypeScript strict
- لنٹ اور فارمیٹESLint · Prettier
- ٹیسٹ اور بلڈلائٹ اور ڈارک اسکرین شاٹس
- سکیورٹی آڈٹکوئی ہائی یا کریٹیکل ایڈوائزری نہیں
- پیکج کی عمرہر ورژن 7+ دن سے عوامی
- فارغ CPUآرام میں آدھے کور سے کم، ≤ 30 fps
کوڈ
invoices-slateReact
- invoices-slate.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.
- clients.tsxClients: every client the studio bills, the ones owing most first — open invoices, what is outstanding (late in red), paid in the last 12 months, how fast they pay and their terms. A row opens the client in the side sheet; New client is in the top bar.
- invoice.tsxOne invoice (#/invoice/i-2410, or #/invoice/new): the document — the studio, the client, the dates, the lines, a discount and a note — and beside it the summary whose totals roll as lines change, with Send, Record payment, Duplicate and Delete. Send lands the Sent stamp; a client's payment lands Paid.
- invoices.tsxInvoices: every invoice, newest first, in status tabs with their counts, searched by number or client and filtered by client — all kept in the address (?tab=overdue&q=north&c=c-04).
- overdue.tsxOverdue: what is late, by how long (four aging buckets in one strip), every late invoice with days late, when it was last chased and Remind, and beside it the reminder log and the studio's reminder schedule.
- overview.tsxThe overview: a greeting with the day's money, the KPI strip, revenue by month, the invoices most overdue, the live feed and the drafts ready to send (Send lands a stamp on the row).
- payments.tsxPayments: money in this month against last month by the same day, every payment newest first (a deposit marked Part), and beside it how the money came and the invoices only partly paid. Record payment is in the top bar.
- recurring.tsxRecurring: the retainers that bill themselves — client, what, how often, the next run, the amount and whether it sends itself — with Run now (makes this run's invoice), Pause or Resume and Edit; beside it the runs due in the next 30 days. New schedule is in the top bar.
- reports.tsxReports: Revenue (12 months collected against invoiced, the collection rate, month by month), Aging (what each client owes by how late) and Top clients (who paid most in 12 months). Each tab exports its table as CSV.
- settings.tsxSettings, in tabs kept in the address (?tab=taxes): Business, Tax rates, Numbering, Reminders 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).
- 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 invoices are picked: how many, send the drafts among them, mark them paid, delete them (Undo in the toast), or clear the pick.
- client-sheet.tsxA client in the side sheet (?client=c-04): who they are, what they owe and how fast they pay, then tabs for their invoices, their payments and their details (?ctab=). And the client form (?edit=new or ?edit=c-04): name, contact, email, city, payment terms and a note, with its own errors.
- invoice-table.tsxThe invoice list: a checkbox, number, client, dates, status, amount and one word action per row (Send a draft, Record a payment, Remind a late one). Picking rows raises the bulk bar; a row just sent wears the stamp a moment and a row a client just paid flashes. On a phone each row goes to two lines.
- kpi-strip.tsxThe KPI strip: four numbers in one bordered box, each with its line under it and a smooth sparkline; a changed number rolls to its new value and the sparkline grows a point.
- line-items.tsxAn invoice's lines: what was done, how many, at what rate, which tax, and the line's amount. In a draft every line can be typed into, dragged by its grip into a new order, or removed, and Add line puts a new one under the rest; once sent the lines only read. On a phone a line goes to two rows.
- live-feed.tsxThe live feed: what just happened to the studio's invoices, newest first, on two lines — who did what (a client paid, opened; a teammate sent, reminded), then the invoice number and amount muted under it. A row that arrives slides in at the top.
- overdue-rows.tsxA late invoice as one row: its status, number and client, how many days late and when it was last chased, what is still owed, and Remind. On a phone it goes to two lines. The overview's list and the Overdue page share it.
- payment-dialog.tsxRecord a payment (?pay=new, or ?pay=i-2410 for that invoice): which invoice, how much (the balance to start; less leaves the rest open), the day, how it came and a note, with its own errors.
- schedule-dialog.tsxA recurring schedule's form (?schedule=new or ?schedule=s-3): the client, what the invoice says, its amount and tax, how often, the next run and whether it sends itself, with its own errors; an existing one can be deleted here.
- settings-forms.tsxThe studio's settings, one panel per tab: Business (name, email, address, default terms), Tax rates (add, edit, delete, the default), Numbering (prefix, digits, next number, with a live preview) and Reminders (the days after due a reminder goes out). Each saves on its own button, with its own errors.
- sidebar.tsxThe sidebar: the studio, search with the ⌘K shortcut, the pages in two groups with their counts (Overdue in red) 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, the page's one main action (New invoice; Record payment on Payments, New client on Clients, New schedule on Recurring; none in the editor, where Send is) and the account menu. It frosts only once the page scrolls under it.
- totals-panel.tsxThe editor's summary beside the document: subtotal, discount, each tax, the total and what is left to pay, every number rolling to its new value as lines change; under it the invoice's actions and its Activity and Payments.
- partsWhat several sections share.
- buildWhat several sections share.
- cardsWhat several sections share.
- unfold.tsThe unfold card style: cards unfold downward from their top edge, their contents fading in.
- rowsWhat several sections share.
- center.tsThe center row motion: the middle row on screen rises first, then the ripple spreads up and down.
- 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: Slate 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, an action, an invoice by number or client, or a client, then Enter.
- csv.tsExport CSV: turns rows into a CSV file and hands it to the browser to save.
- 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.
- drag-lines.tsDrag an invoice's lines into a new order by their grip: mouse and pen at once, touch after a short press (a swipe still scrolls), the lifted copy kept under the grab point, the other lines sliding aside (FLIP), the page scrolling near its edges, Escape to cancel, and a keyboard path on the grip (Space lifts, arrows move, Space drops).
- 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, and a row that just arrived fades up. Rows carry data-flip="<id>"; positions are measured inside the list (offsetTop), so a page scroll never reads as a move, and measured again when the list resizes.
- format.tsHow numbers and dates are written: by Intl, the current language's way ("$1,240.50", "1.240,50 US$"; "Nov 19", "19 nov").
- 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.
- live.tsThe app's one live clock: every 6 seconds a client pays, opens an invoice or a teammate sends one (data/live.ts) and every page reloads in place; every 30 the "minutes ago" times redraw. 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: a client in the side sheet (?client=c-04), the client form (?edit=new), Record payment (?pay=new or ?pay=i-2410) and the schedule form (?schedule=new). Any page can open one by adding its query.
- read.tsOne read of the fake API by its key, through useApi: useRead("overview"), useRead<"invoice">(`invoice:${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 (#/invoices?status=overdue, #/invoice/i-2410).
- 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 client), 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 (?client=c-04&ctab=payments).
- 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.
- status.tsxAn invoice's status, never by colour alone: a glyph (a dashed ring for a draft, a half ring for sent, a ring with a bar for overdue, a filled check for paid) with its word beside it; the stamp an invoice wears once sent or paid; and which rows just arrived.
- 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.
- api.tsThe fake API: every page loads and saves through these functions, so wiring a real backend happens here only.
- db.tsThe pretend database and every change to it: invoices and their lines, sending, payments, reminders, clients, schedules, tax rates and settings. Pages never call these directly; data/api.ts does, like a backend would.
- live.tsThe live demo: clients paying and opening invoices while you watch, and a teammate sending new ones, through the same database the pages read. Wire your payment provider's webhooks here instead.
- now.tsThe demo's "now": today at 11: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-clients.tsThe pretend studio: its four people, its thirty clients, its tax rates and settings, and the kinds of work it bills (each client buys one kind most). Replace with your own data or wire your backend in data/api.ts.
- seed-invoices.tsA year of the studio's billing, made the same way on every load: about fifty invoices a month across the thirty clients, most paid a few days either side of their due date, a handful late, this week's still out, and a few drafts waiting to go. Recurring retainers bill on their day each month. Every date follows the demo's "now" (data/now.ts).
- types.tsThe shapes the pages read and save: clients, invoices with their lines, payments, recurring schedules, tax rates, the studio's settings and what happened (the live feed). Money is in dollars with cents.
- views.tsWhat each page reads, worked out from the pretend database: an invoice's status and money, the overview's numbers, lists, aging, clients, payments, schedules and reports. A backend would answer these as its API's responses.
- 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}).
invoices-slate.tsx
The page: the sections in order.
لوڈ ہو رہا ہے…
- کس کے لیے بہتر
- Freelancers and small studios who bill clients every month and want a calm, fast way to send invoices and chase payments.
- یہ کیسے کام کرتا ہے
- Change a line and the totals roll to the new sum; Send lands a stamp, and payments arrive live, flipping rows to Paid.
- استعمال کا طریقہ
- Edit words in content.ts and colors in theme.ts, and swap the bodies in data/api.ts for calls to your backend.