Business
Providers & profit
/_authed/providers) is Vortexa's own infrastructure-cost bookkeeping ledger: it tracks what you pay VPS vendors like Hetzner, Vultr or OVH per node, and rolls that up into month-by-month spend so you can compare it against revenue tracked in Wallet, Invoices and Payments.What it does
This is purely an admin cost-accounting tool, entirely client-side: providers and their pricing plans live in the browser's localStorage, backed by src/lib/infra-providers-store and src/lib/nodes-store. It is not a payment-gateway integration and has no effect on what customers pay — that is Plans (see /docs business pages) — nor does it touch the real backend database.
Data model
| Entity | Fields |
|---|---|
| InfraProvider | id, name, url, logoUrl (auto-resolved from favicon if left blank), notes, plans[], createdAt. |
| InfraPlan | id, name, priceUsd, cycle (monthly | yearly), plus optional spec fields summarized by planSpecSummary (CPU/RAM/disk/bandwidth notes). |
| Node link | A node row (NodeRow from nodes-store) carries providerId / providerPlanId once attached, and billingStartAt marking when cost accrual for that node began. |
Attaching a node to a plan
Cost tracking is opt-in per node: nothing is billed until you explicitly attach a node to one of a provider's pricing plans via the Attach node to plan control (AttachNodePicker). This is the action that starts cost attribution — it stamps billingStartAt on the node.
Detaching a node
Clicking the ✕ on a node chip opens a confirmation with two choices:
- Keep history
- Detaches the node but preserves its past cost data in the totals/chart.
- Detach & clear stats
- Detaches and wipes
billingStartAtso the node contributes nothing to all-time or 12-month totals — even if it is reattached later, history starts fresh.
Editing or deleting a provider
- Edit a provider's name, URL, logo, notes, or its list of plans at any time.
- Deleting a provider is blocked while any node is still attached to one of its plans — detach every node first.
Provider plan prices (priceUsd) are entered and stored in plain USD (not cents, unlike customer-facing money fields elsewhere in the app). There is no PKR or multi-currency support on this page — it is an internal cost ledger, and conversions to other display currencies (e.g. the PKR figures shown in Referrals/Wallet) do not apply here. Cycle (monthly vs yearly) determines how a plan's price is normalized down to a monthly figure for the cost computations below.
Computed figures
| Function | What it reports |
|---|---|
| monthlyCostForNode | Normalized monthly cost of a single attached node (yearly plans divided by 12). |
| currentMonthTotal | Sum of monthlyCostForNode across every attached node — this month's total infrastructure bill. |
| allTimeSpent | Cumulative spend since each node's own billingStartAt, summed across the fleet. |
| historyByMonth(rows, 12) | Rolling 12-month spend series, rendered as a bar chart, for trend-spotting and CSV export. |
Comparing against revenue
This page shows This month, Projected / yr, and All-time spent tiles plus the 12-month chart. It does not compute profit automatically — there is no single "margin" number wired up in this file. To get a true profit view, compare these totals manually against revenue tracked in Wallet (real cash top-ups and plan purchases), Invoices, and Payments (approved order amounts), and against Node analytics → Earnings if you track per-node revenue there.
Client-side only
Provider/plan attachment is the only bridge between the cost ledger and the rest of the panel: once a node carries providerId/providerPlanId, other screens that read the node list (Node management, Infrastructure views) can display which hosting plan a node runs on and its monthly cost inline, letting you eyeball cost-per-node next to that node's live traffic/earnings figures. There is no server-side aggregation — every rollup shown is computed in the browser from the current node list and provider list.
- 1Go to Providers & cost → New provider.
- 2Fill in the provider's name and website URL (a logo is auto-resolved from the site's favicon if you leave it blank), plus any internal notes.
- 3Add one or more pricing plans under the provider, e.g. "CX22 — $5.83/mo" with cycle
monthly. - 4Save the provider, then use the Attach control on a plan card (or from Node management) to link a running node to that plan — this starts cost accrual.
- 5Review This month, Projected / yr, and All-time spent, and the 12-month bar chart, to track infrastructure spend over time.
- 6Use Export CSV periodically to keep an off-panel copy of the 12-month spend history.
localStorage keys (client-only, per-browser):
src/lib/infra-providers-store → providers[] (with nested plans[])
src/lib/nodes-store → node rows' providerId / providerPlanId / billingStartAt