ข้ามไปยังเนื้อหา

Costs Zinc

v1.0

A minimal SaaS cloud cost desk: spend by service, team and account, budgets with alerts, spikes with their cause, savings to act on and a month line that races to today, in cool zinc greys with one amber accent.

$69

ที่อยู่หน้า: /

มีในตัว

สิ่งที่คุณได้รับ
  • สว่างและมืดใช้สีของธีมคุณ
  • เดสก์ท็อป แท็บเล็ต และโทรศัพท์หน้าจอที่สร้างมารองรับ
  • แพ็กเกจ…
  • ขนาดโค้ด…
  • ประหยัดแบตเตอรี่30 fps หยุดพักเมื่อนิ่ง
  • หยุดเมื่อซ่อนอยู่นอกหน้าจอหรืออยู่แท็บอื่น
  • ลดการเคลื่อนไหวสงบสำหรับผู้ที่ตั้งค่าไว้

ตรวจสอบทุกครั้งที่มีการเปลี่ยนแปลง

ตรวจสอบความปลอดภัย 3 ธ.ค.
  • ตรวจสอบไทป์TypeScript แบบ strict
  • Lint และฟอร์แมตESLint · Prettier
  • ทดสอบและบิลด์ภาพหน้าจอโหมดสว่างและมืด
  • ตรวจสอบความปลอดภัยไม่มีคำเตือนระดับสูงหรือวิกฤต
  • อายุแพ็กเกจทุกเวอร์ชันเผยแพร่มาแล้วอย่างน้อย 7 วัน
  • CPU ขณะว่างต่ำกว่าครึ่งคอร์ขณะพัก ≤ 30 fps

โค้ด

costs-zincReact
  • costs-zinc.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.
    • anomalies.tsxAnomalies: spend that broke from its usual day, by state (?status=open), with what each cost so far and its likely cause; acknowledge, resolve or reopen one in place or in its sheet (?a=AN-2048). New spikes slide in as the detector finds them.
    • budgets.tsxBudgets: every team's monthly budget with what it spent, where the forecast lands and when it alerts; edit or remove one (?budget=data), set one for a team without, and the month chart for any team.
    • overview.tsxOverview: the month at a glance (KPI strip), the month chart against the budget, the open spikes, daily spend by service and what everyone did.
    • reports.tsxReports: the month against its forecast and the two before it, what a unit costs (per million requests, customer and engineer), each team's forecast against its budget and every service month over month.
    • savings.tsxSavings: what Northbeam could stop paying for (idle resources, rightsizing, commitments), each sized per month with its team and effort; mark one done (with Undo) and it moves over to the ones saved so far.
    • settings.tsxSettings: the cloud accounts whose bills sync in (pause or resume each one), where alerts go and how touchy spike detection is, how the app looks, and a reset that puts the demo data back.
    • sign-in.tsxThe sign-in page (#/sign-in): the logo and the form on one card, with what Spendline does beside it on wide screens (a small month line racing past its budget and three short points), without the sidebar and top bar.
    • spend.tsxSpend: where the money goes, grouped by service, team or account and filtered by any of them over a month, 30 or 7 days; the totals, daily stacked bars and a breakdown whose rows open a sheet with their cost lines.
    • teams.tsxTeams: who owns the spend (each team's people, share and month to date; edit or delete one, ?team=data), the tag rules that hand each cost line to a team, and the lines no rule matches yet.
  • 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.
    • actions.tsWhat the top bar's main button does on each page that has one: Export CSV (Spend, Reports), Acknowledge all (Anomalies); the others open a form (?budget=new, ?team=new). Also the Spend page's read key, shared with its export.
    • anomaly-row.tsxOne spike as a list row: its state, what happened, where (the resource, service and team), how long and what it cost so far; the row opens its sheet (?a=AN-2048), and the page can add an action at the end.
    • anomaly-sheet.tsxA spike's side sheet (?a=AN-2048): what happened and why, its usual day against the extra, the last 21 days with the spike days marked, where it bills and its tags, and the button that moves it on.
    • appearance.tsxSettings → Appearance: two cards for the page's grid, 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.
    • budget-dialog.tsxThe budget form in a dialog, over any page: a new one (?budget=new) for a team without one, or a team's (?budget=data) to change its amount, alert levels and channel, or remove it.
    • feed.tsxThe activity feed: who did what, newest first, what it was about in mono and how long ago; a row that arrives (a spike found, a teammate's acknowledgement, a sync) slides in at the top.
    • month-panel.tsxThe month chart's panel: which team it shows (?chart=data), the legend, where each month ends and whether it crosses its budget, and the chart whose budget handle saves as you drop it.
    • sidebar.tsxThe sidebar: the workspace, search with the ⌘K shortcut, the pages in two groups with their open 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.
    • spend-sheet.tsxThe Spend page's side sheet (?detail=compute): one group's total, its daily spend and the cost lines behind it with their tags.
    • tag-rules.tsxThe tag rules that give each cost line its team, in order (first match wins): drag a rule by its grip, or focus the grip and use the arrow keys, to move it; add one from a tag and a team (?tag= picks the tag), or remove one.
    • team-dialog.tsxThe team form in a dialog, over any page: a new team (?team=new) or one to edit (?team=data), with its name, owner and headcount; deleting asks first, and its rules go with it.
    • top-bar.tsxThe top bar: the menu button on narrow screens, where you are, the month picker every page reads, the live dot, the theme switch, the page's one main action 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.
        • turn.tsThe turn card style: cards swing in like pages, hinged on their left edge.
      • rowsWhat several sections share.
        • odo.tsxThe odo row motion: each row on screen rises 6px from faint while every number rolls digit by digit to its value.
      • 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: Spendline is solid, so its own two soft lights stay hidden (opacity is --costs-zinc-glass, 0); with followBackground it paints your background behind the panels instead.
    • charts.tsxThe small charts every page shares: a sparkline, stacked daily bars with a tooltip, and a share bar. Colors are the chart series (theme.ts chart-1..5); they follow your Chart Studio.
    • command-palette.tsxThe command palette (⌘K or Ctrl K): type to find a page or an action, then Enter.
    • 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 ("$412,800", "412.800 US$"; "Nov 19", "19 nov."; "3 min ago", "hace 3 min").
    • glyphs.tsxThe small status marks rows lead with: a spike's state (open ring, acknowledged half, resolved check), its severity as three bars, and a saving's kind.
    • icons.tsxThe logo and the line icons, drawn on a 24-unit grid with round ends.
    • kpi-strip.tsxThe KPI strip: four numbers in one bordered box split by hairlines, each with its line under it and a sparkline or a progress bar; a changed number rolls to its new value. Also the page head every page starts with.
    • 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 (bring in billing, an event, reload) is the app's, passed to liveClock.
    • live.tsThe app's one live clock: every 5 seconds a billing sample comes in and every page reloads in place; every 20 the detector or a teammate does something; every minute the sync ages tick. 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.
    • month-chart.tsxThe month chart, Spendline's signature: spend so far this month races up to today, a dashed forecast runs on to the end of next month, and the budget is a step line, one level a month, that glows where the spend crosses it. Drag its handle (or use the arrow keys) to set the budget; the crossing moves as you go.
    • month.tsThe month the top bar's picker shows ("2026-11"): every page reads its numbers for it. This month by default; the picker goes back as far as billing does.
    • motion.tsMotion helpers: the reduced-motion check, live, and run-once-in-view.
    • read.tsOne read of the fake API by its key, through useApi: useRead("anomalies"), useRead<"budgets">(`budgets:${month}`). 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.
    • segmented.tsxA segmented switch made of links (?group=team, ?status=open): the current one sits raised on the track, each can carry a count.
    • 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 spike, a cost group), with its own close button. Escape, a tap outside or the button slides it away; the address keeps what it shows (?a=AN-2048).
    • 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.
    • 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 its billing engine: every line's spend on any day (seeded smooth, weekends a little lower, spikes on top, today only as far as the clock has run), which team a line belongs to by the tag rules, and every change the pages save. Wire your backend's billing export here instead.
    • live.tsThe live demo: billing keeps coming in (a sample of the last minutes on every line) and now and then the detector finds a spike or a teammate acts on one, through the same database the pages read. Wire your backend's billing stream and events here instead.
    • now.tsThe demo's "now": today at 14:20 plus the real time since the app loaded, so today's spend is well under way at any hour; every seeded day is set from it. Wire your backend and use the real time.
    • seed.tsThe pretend company: Northbeam, about 150 engineers on two clouds spending roughly $400k a month. Its teams and budgets, the cost lines that bill every day (each a service in an account, with its tags), the tag rules that give each line a team, the spikes the detector found and the savings it suggests. Swap in your own, or load them from your billing export.
    • views.tsWhat each page reads, worked out from the pretend database: month-to-date and forecast, spend grouped and filtered, budgets with their status, spikes with their impact, savings, teams with their rules, reports and settings. The fake API (data/api.ts) answers with these.
  • 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}).

costs-zinc.tsx

The page: the sections in order.

กำลังโหลด…
เหมาะสำหรับ
Finance and platform teams who watch a large cloud bill, set budgets per team and chase spikes and savings together.
ทำงานอย่างไร
The month line races to today, a dashed forecast runs on and the budget glows where it is crossed; spend ticks up live.
วิธีใช้
Edit words in content.ts and colors in theme.ts, and swap the bodies in data/api.ts for calls to your backend.