All checks were successful
Deploy / build-deploy (push) Successful in 5m35s
331 lines
25 KiB
C++
331 lines
25 KiB
C++
/*
|
||
catcrafts.net
|
||
Copyright (C) 2026 Catcrafts
|
||
|
||
The source code of this website is made available for viewing purposes only.
|
||
No permission is granted to copy, modify, distribute, or create derivative works.
|
||
*/
|
||
|
||
// The site's authored content, as code.
|
||
//
|
||
// This replaced content/{products,projects,legal,demos}.json and their
|
||
// runtime loaders. The reasoning: this codebase's whole style is making
|
||
// invalid states fail at COMPILE time (SafeHtml, integer money), while the
|
||
// JSON loaders did the opposite — a typo'd field silently dropped a variant,
|
||
// and one stray trailing comma once blanked every legal page at runtime while
|
||
// the server kept answering 200. Content edits go through git push and a full
|
||
// CI build regardless (there is no content-only deploy), so the "edit without
|
||
// a toolchain" argument bought nothing here. Now a broken product is a
|
||
// compile error, the wasm bundle ships four fewer files, and the duplicated
|
||
// keep-in-step loaders in main.cpp and the server module are gone.
|
||
//
|
||
// posts.json and rates.json remain data on purpose: shell pipelines write
|
||
// them at build time (fediverse fetch, ECB rates), and shell writes JSON,
|
||
// not C++.
|
||
//
|
||
// PRICING RULE (the owner's): retail = supplier price + markup, exactly, and
|
||
// the markup is what Catcrafts walks away with AFTER shipping and VAT — €50
|
||
// net. The stated leak used to be the payment provider's transaction fee;
|
||
// since both rails became self-hosted (2026-08-20) the leaks are a bank
|
||
// transfer's zero and, on the crypto rail, gas plus whatever an exchange takes
|
||
// at cash-out. Supplier prices are what the retailer currently charges (incl
|
||
// VAT); change one number when the supplier moves and the margin stays put.
|
||
|
||
export module Catcrafts.Shared:Content;
|
||
import std;
|
||
import :Model;
|
||
import :Money;
|
||
|
||
namespace Catcrafts::Content {
|
||
|
||
// The flat markup on every priced variant — "whatever it costs me + 50",
|
||
// where the €50 is what Catcrafts KEEPS. No priced product is listed today;
|
||
// the rule and its proof stay here for the next one. Retail is VAT-inclusive,
|
||
// so a markup added to it is taxed with the rest of the price: a flat +5000
|
||
// would net only €41.32 once the VAT on it is remitted. Grossed up once here
|
||
// (€60.50 on the sticker), the walk-away margin is exactly €50 per unit — on
|
||
// EU sales and on exports alike, since the export price is the net of the
|
||
// same retail.
|
||
inline constexpr std::int64_t kMarkupNetMinor = 5000;
|
||
inline constexpr std::int64_t kMarkupMinor = Money::GrossFromNet(kMarkupNetMinor);
|
||
// Exactness is not luck: NetFromGross strips a gross amount additively only
|
||
// when markup × 10000 divides evenly by the VAT denominator, and 6050 does
|
||
// (6050 × 10000 = 12100 × 5000). That makes NetFromGross(supplier + markup)
|
||
// equal NetFromGross(supplier) + 5000 for EVERY supplier price — no variant
|
||
// can round the margin away.
|
||
static_assert(kMarkupMinor * 10000 % (10000 + Money::kVatRateBp) == 0,
|
||
"gross markup must net back exactly for every supplier price");
|
||
static_assert(kMarkupMinor * 10000 / (10000 + Money::kVatRateBp) == kMarkupNetMinor,
|
||
"the exact net of the markup must be the €50 the rule promises");
|
||
|
||
// The catalogue. Goods come and go: the two handsets that opened this list
|
||
// were withdrawn on 2026-09-05, and nothing here, in the renderers or on the
|
||
// legal pages may assume what kind of thing is sold next. The one standing
|
||
// entry is the donation item.
|
||
//
|
||
// Adding a priced product is one Product below: slug, name, brand, variants
|
||
// (each with its VAT-inclusive price, supplier + kMarkupMinor), a boxed
|
||
// shipping weight in grams, a photo under images/ (and in project.cpp's
|
||
// cfg.files), a spec sheet and a warranty text. The shop grid, the product
|
||
// page, the checkout, the sitemap and the JSON-LD all read this vector and
|
||
// nothing else; the E2E suites find the first non-donation entry and skip
|
||
// their goods checks while there is none.
|
||
export const std::vector<Product>& Products() {
|
||
static const std::vector<Product> products = [] {
|
||
// The donation item. The buyer names the amount (Form::ValidateDonation
|
||
// bounds it); nothing ships and no VAT is charged, because a gift with
|
||
// nothing supplied in return is not a taxable supply — which is also
|
||
// why a donation never gets an invoice.
|
||
//
|
||
// The order of this vector is the order of the shop grid. Priced goods
|
||
// go BEFORE this entry: the donation is the odd one out, not what the
|
||
// shop is about, and stays last.
|
||
Product d;
|
||
d.slug = "donation";
|
||
d.name = "Donation";
|
||
d.tagline = "Fund the open-source work directly";
|
||
d.status = "available";
|
||
d.donation = true;
|
||
d.summary = "Thank you very much for considering to donate! Your donation contributes to the maintenance of the open-source software Catcrafts publishes and to research and development for new devices.";
|
||
return std::vector<Product>{ std::move(d) };
|
||
}();
|
||
return products;
|
||
}
|
||
|
||
export const std::vector<Project>& Projects() {
|
||
static const std::vector<Project> projects = {
|
||
{
|
||
"imsd",
|
||
"IMS/VoLTE for the Qualcomm modem in the Fairphone (Gen. 6): calls on a mainline-Linux phone.",
|
||
"https://forgejo.catcrafts.net/Catcrafts/imsd",
|
||
"C++",
|
||
true,
|
||
},
|
||
{
|
||
"Crafter.Graphics",
|
||
"A C++ rendering engine: Vulkan with hardware ray tracing natively, WebGPU in the browser.",
|
||
"https://forgejo.catcrafts.net/Catcrafts/Crafter.Graphics",
|
||
"C++",
|
||
true,
|
||
},
|
||
{
|
||
"Crafter.Build",
|
||
"A build system with no DSL: the build description is a C++ file, compiled and run.",
|
||
"https://forgejo.catcrafts.net/Catcrafts/Crafter.Build",
|
||
"C++",
|
||
true,
|
||
},
|
||
{
|
||
"Crafter.Network",
|
||
"A QUIC and HTTP/3 stack; the same client code runs natively and in the browser.",
|
||
"https://forgejo.catcrafts.net/Catcrafts/Crafter.Network",
|
||
"C++",
|
||
false,
|
||
},
|
||
{
|
||
"catcrafts.net",
|
||
"This website, C++ compiled to WebAssembly, server-rendered from the same renderers.",
|
||
"https://forgejo.catcrafts.net/Catcrafts/catcrafts.net",
|
||
"C++",
|
||
false,
|
||
},
|
||
{
|
||
"Crafter.Asset",
|
||
"Texture and mesh pipeline to GPU-friendly formats, decoded on the GPU where possible.",
|
||
"https://forgejo.catcrafts.net/Catcrafts/Crafter.Asset",
|
||
"C++",
|
||
false,
|
||
},
|
||
};
|
||
return projects;
|
||
}
|
||
|
||
export const std::vector<Demo>& Demos() {
|
||
static const std::vector<Demo> demos = {
|
||
{
|
||
.slug = "raytracer",
|
||
.name = "Real-time ray tracer",
|
||
.blurb = "Hardware-accelerated ray tracing through WebGPU, driven by the same C++ WebAssembly module that renders this page. Four coloured lights, one shadow ray each, Reinhard tonemapping.",
|
||
.tech = "WebGPU compute + WGSL",
|
||
.needs = "WebGPU: Chrome 121+, Firefox 141+, Safari 26+",
|
||
.mountId = "webgpu-demo",
|
||
.aspect = "16 / 9",
|
||
.needsWasm = true,
|
||
},
|
||
};
|
||
return demos;
|
||
}
|
||
|
||
// The about page: the deliberate weld between the person and the company.
|
||
// Search and AI answer engines had already connected Jorijn to catcrafts.net
|
||
// through the kernel patch trail, but with nothing first-party to quote they
|
||
// guessed — one AI overview attributed the domain to a different developer
|
||
// entirely, several redirected visitors to the Minecraft server on the
|
||
// singular domain. This page is the authoritative answer to "who is behind
|
||
// Catcrafts", for people and for machines. Same headed-sections shape as the
|
||
// legal pages, so it reuses their renderer's markup and CSS.
|
||
export const LegalPage& AboutPage() {
|
||
static const LegalPage page{
|
||
.slug = "about",
|
||
.title = "About",
|
||
.updated = "2026-09-05",
|
||
.lede = "Catcrafts is a one-person company. This page is about the person, the mission, and the name.",
|
||
.sections = {
|
||
{ "Who",
|
||
{
|
||
"Catcrafts is the registered one-person company (KVK 78437059) of Jorijn van der Graaf, a Dutch software engineer better known in the Linux mobile world as TheMightyCat.",
|
||
} },
|
||
{ "The mission",
|
||
{
|
||
"Accessible open-source software and hardware, for the benefit of everyone. Software you can read, hardware you can repair, and phones that answer to their owner rather than to an advertising department. A real alternative to big tech: not a manifesto about one, but things you can download, flash and buy today.",
|
||
"Everything Catcrafts makes is published as open source. The shop is how the development gets funded: every purchase and every donation there pays for the work.",
|
||
} },
|
||
{ "The work",
|
||
{
|
||
"imsd is the IMS/VoLTE implementation that makes phone calls work on mainline-Linux phones, written from scratch and tested on a live Dutch network. It is the reason a Fairphone (Gen. 6) running postmarketOS can ring. Jorijn works on mainline Linux support for the Fairphone (Gen. 6) and upstreams it into the kernel: sensor bindings, Qualcomm audio, the unglamorous patches that make a phone a phone.",
|
||
"The Crafter suite is the other half: a C++ build system with no DSL, a graphics engine that ray-traces natively on Vulkan and in the browser through WebGPU, a QUIC and HTTP/3 networking stack, and more. This website is built with all of it. The same C++ renders each page on the server and again in your browser as WebAssembly.",
|
||
"And of course all the upstreaming work that comes along: Catcrafts will upstream everything it makes whenever possible.",
|
||
} },
|
||
{ "The name",
|
||
{
|
||
"Catcrafts is not the Minecraft server. That is catcraft.net, singular, an unrelated community that happens to share almost the same name. This site is about open-source software and hardware for Linux phones, and has no cross-play, no ranks and no diamonds. The cat in the logo speaks shell, not creeper.",
|
||
} },
|
||
},
|
||
};
|
||
return page;
|
||
}
|
||
|
||
// The open-financials page's authored prose. The numbers themselves come from
|
||
// the order ledger and the bank-aggregates state file at render time; what is
|
||
// compiled in is the promise around them — what the page shows, what it never
|
||
// will, and how to read it. Kept in the LegalPage shape so it reuses that
|
||
// renderer's section markup and CSS, exactly as the about page does.
|
||
export const LegalPage& FinancialsPage() {
|
||
static const LegalPage page{
|
||
.slug = "financials",
|
||
.title = "Financials",
|
||
.updated = "2026-08-17",
|
||
.lede = "Catcrafts believes in openness, that's why its financials are open as well. As a supporter you deserve to know where your money is going.",
|
||
.sections = {
|
||
{ "How this page works",
|
||
{
|
||
"Sales, and donations made through the shop, come straight from the shop's order ledger and update the moment they are paid. Donations to the bank account and expenses are aggregated from the business bank account by category, brought up to date by hand, and carry the date that last happened.",
|
||
"Everything is a running total in euros on a cash basis: money counts when it moves, not when an invoice says it should. Amounts include VAT where VAT was charged.",
|
||
} },
|
||
{ "What is never published",
|
||
{
|
||
"No individual transactions, no timestamps, no counterparties, no account balances, and nothing about who paid or was paid. Totals only. One consequence is accepted openly: the totals update live, so someone watching the page closely could infer that a sale or a donation happened. That is as far as it goes.",
|
||
} },
|
||
},
|
||
};
|
||
return page;
|
||
}
|
||
|
||
export const std::vector<LegalPage>& LegalPages() {
|
||
static const std::vector<LegalPage> pages = {
|
||
{
|
||
.slug = "privacy",
|
||
.title = "Privacy",
|
||
.updated = "2026-09-05",
|
||
.lede = "What this site collects, why, and how to get rid of it. Written to describe what the code actually does. If you find a discrepancy, the code is the bug and a report is very welcome.",
|
||
.sections = {
|
||
{ "Who is responsible",
|
||
{
|
||
"Catcrafts, Netherlands. Contact details are on the imprint page. Catcrafts is the controller for everything described here; no other party is involved.",
|
||
} },
|
||
{ "Orders",
|
||
{
|
||
"Placing an order stores what fulfilling it requires: your email address, the recipient name and shipping address, the country, and the order itself (product, amounts, timestamps, payment reference and status). Nothing else is asked for and nothing else is kept. The legal basis is the contract: this data is what shipping you an order and issuing an invoice consist of.",
|
||
"Neither payment method involves a payment processor, so there is no third party that Catcrafts hands your data to in order to get paid. Bank payment is an ordinary transfer from your bank to the account named on the order page: your own bank and Catcrafts' bank handle it, as they would any transfer you make, and Catcrafts has engaged nobody in between. Cryptocurrency payment involves no provider either: the order page shows a receiving address that belongs to Catcrafts, and paying it is a transaction on a public blockchain. Only the order record described above connects a payment to you, and that record stays with Catcrafts.",
|
||
"What Catcrafts records about a bank transfer is deliberately narrow: the payment reference you quoted, the amount, the date and the method. Your name and IBAN are visible to Catcrafts on its own bank statement, as they are to anyone who receives a transfer, but they are not copied into the shop's records and are not needed to confirm an order. The reference is what matches your payment to your order.",
|
||
"The order status page lives at an unguessable link. Anyone holding the link can read that order's status and totals, so treat it like a receipt on your desk and don't post it anywhere public.",
|
||
} },
|
||
{ "How long it is kept",
|
||
{
|
||
"Order records that belong to an invoice are kept for seven years. That is the Dutch fiscal retention obligation, and it is the one case where a deletion request cannot be honoured early. Everything in an order that the tax records do not need is deleted on request.",
|
||
"An order that is never paid lapses; its record is kept briefly for abuse spotting and then has no reason to exist.",
|
||
"The order file is stored on machine hosted by hetzner, a GDPR compliant german cloud hosting service.",
|
||
} },
|
||
{ "What this site does not do",
|
||
{
|
||
"No analytics in your browser. No cookies, none at all, which is why there is no cookie banner. No third-party scripts, no fonts loaded from anyone else's server, no embedded video, no social buttons, no advertising, no profiling, no automated decision-making.",
|
||
"Everything the browser loads comes from catcrafts.net. Paying does not send you anywhere else either: both payment methods are completed from the order page itself, so there is no payment provider's site in the middle. Following a link out, to a fediverse thread or to Forgejo, puts you on that site under its terms, and Catcrafts has no visibility into what happens there.",
|
||
} },
|
||
{ "Server logs",
|
||
{
|
||
"The web server keeps ordinary request logs. Those exist to debug faults and spot abuse, and are not connected to order records or used to build any kind of profile.",
|
||
"Those logs are also this site's only analytics: a page of aggregate statistics, computed on the server, with visitor addresses anonymized before anything is stored. A tally like that is nothing to keep secret, so you are free to take a look yourself at https://catcrafts.net/analytics.",
|
||
} },
|
||
{ "Your rights",
|
||
{
|
||
"Under the GDPR you can ask for a copy of what Catcrafts holds about you, have it corrected or deleted, restrict how it is used, object to its use, or ask for it in a portable form. Please contact privacy@catcrafts.net for this purpose.",
|
||
} },
|
||
{ "Changes",
|
||
{
|
||
"This page has a date at the top. Anything that changes what is collected or why gets a new date, and you do not have to take the date's word for it: every previous version of this page, with the exact diff, is public at https://catcrafts.net/legal/privacy/history.",
|
||
} },
|
||
},
|
||
},
|
||
{
|
||
.slug = "imprint",
|
||
.title = "Imprint & contact",
|
||
.updated = "2026-09-05",
|
||
.lede = "Who is behind this site and how to reach them.",
|
||
.sections = {
|
||
{ "Contact",
|
||
{
|
||
"Email info@catcrafts.net. One inbox answers everything: support, orders, privacy requests and anything else. The topical addresses named elsewhere on this site (privacy@catcrafts.net, security@catcrafts.net) reach the same person.",
|
||
"For anything about the code itself, an issue on Forgejo is usually better than email: it stays public and searchable for the next person with the same question.",
|
||
} },
|
||
{ "Business details",
|
||
{
|
||
"Catcrafts, owner Jorijn van der Graaf, KVK 78437059, VAT NL003329281B38, EORI NL1900095326.",
|
||
} },
|
||
{ "Security reports",
|
||
{
|
||
"If you find a vulnerability, please email at security@catcrafts.net before disclosing it publicly and you will be credited. This site is source-available on Forgejo, so you can read exactly what it does rather than guessing.",
|
||
} },
|
||
},
|
||
},
|
||
{
|
||
.slug = "terms",
|
||
.title = "Terms",
|
||
.updated = "2026-09-05",
|
||
.lede = "The terms for buying from this shop. Written to be read: short sections, no boilerplate imported from anywhere, and every claim checkable against what the site actually does.",
|
||
.sections = {
|
||
{ "Ordering and payment",
|
||
{
|
||
"Submitting the order form creates an order and shows you how to pay it: account details and a payment reference for a bank transfer, or a receiving address for cryptocurrency. The order is an offer to buy; the contract forms when the payment arrives. Until then nothing is owed: an unpaid order simply lapses and can be ignored. An unpaid bank-transfer order is held for about two weeks and a cryptocurrency order's address stays reserved for about a day; after that each lapses like any other unpaid order. In both cases a payment that arrives late is not lost, because the account and the address remain Catcrafts', and it is settled by hand on request.",
|
||
"Prices are in euros, and euros are what is charged; any amount shown in another currency is indicative only, converted at the ECB reference rate of the date shown. Inside the EU the shown price includes 21% Dutch VAT. Outside the EU the sale is a zero-rated export at the derived ex-VAT price, and the price then excludes import duty, import VAT, tariffs and any carrier handling or brokerage fee. Those charges arise on arrival in your country, are levied by the carrier or your customs authority, and are solely a matter between you and them: Catcrafts does not collect them, cannot bindingly estimate them, is not a party to their assessment, and refusal to pay them does not undo the sale. Your bank or card sets the actual euro conversion rate for whatever you pay with.",
|
||
"Neither method involves a payment provider. A bank payment is an ordinary transfer you make yourself, from your own bank to the account shown on the order page, quoting the reference shown with it: that reference is what matches your payment to your order, and a transfer without it cannot be matched. Cryptocurrency payments are made in EURC, a euro-denominated stablecoin, directly to a wallet address held by Catcrafts and shown on the order page. Catcrafts never sees your card details, your bank credentials or your wallet keys, because at no point are you asked for them. Cards are not accepted.",
|
||
"Paying in cryptocurrency changes how the money moves, not what is owed or what you are owed. Payment is accepted in EURC only, which is denominated in euros: the amount to send is exactly the euro price, with no exchange rate involved, and it must arrive in full on one of the networks the order page lists. A payment split across several networks cannot be accepted automatically.",
|
||
"Every refund under the sections below is owed in euros, and is paid back the way you paid. A bank transfer is refunded by transfer to the account it came from. A cryptocurrency payment is refunded in EURC to a wallet address you give at the time, since there is nothing to send it back to otherwise.",
|
||
"For support related to orders please contact orders@catcrafts.net"
|
||
} },
|
||
{ "Donations",
|
||
{
|
||
"The shop also takes donations: you name the amount, and the same two payment methods apply, a bank transfer or EURC. A donation is a gift that funds the open-source work; nothing is supplied in return, so no VAT is charged and no invoice is issued. The order page for a donation is its receipt.",
|
||
"Because nothing ships, no name or address is asked for. An email address is optional and is used only to send the confirmation. Donations appear on the financials page as an aggregate running total, never individually.",
|
||
"A donation is not a purchase, so the returns section below does not apply to it.",
|
||
} },
|
||
{ "Warranty",
|
||
{
|
||
"Everything sold here is warranted by Catcrafts for two years from delivery, worldwide.",
|
||
"Software Catcrafts wrote is fixed by Catcrafts with an update, delivered remotely like any other update. If a fault stops the product from starting, Catcrafts provides the tools and walks you through recovering it in place, so a software fault still does not mean sending anything anywhere.",
|
||
"When a product does have to travel (a hardware fault, or a product so far gone it no longer responds to recovery tools at all), the shipping is paid by Catcrafts, both directions, worldwide. Every unit is tested before dispatch, so a genuine defect should be rare. When one happens anyway, it should not cost you anything. The one exception: if a returned product turns out to have no fault, or the damage is yours (a drop, water damage, a repair attempt gone wrong, or a software fault caused by your own changes), the repair and the shipping are billed at cost, and you are told the price before any work happens.",
|
||
"If you are an EU consumer you additionally hold the statutory conformity guarantee: under Dutch law it lasts as long as a product of this kind may reasonably be expected to last, a defect appearing in the first year is presumed to have existed at delivery, and remedies under it are free. Nothing in this section limits those rights.",
|
||
"For warranty please contact warranty@catcrafts.net"
|
||
} },
|
||
{ "Returns",
|
||
{
|
||
"EU consumers can withdraw from the purchase within 14 days of delivery, no reason needed: send an email, send the product back, and the price plus the standard shipping you paid is refunded when the product has beeb retuned and inspected. Return shipping is yours to arrange and pay. You may inspect the product as you would in a shop. value lost through use beyond that can be deducted from the refund.",
|
||
"Outside the EU, sales are final except for defects: the warranty above applies in full, but there is no change-of-mind window. Import duties and fees paid to your own authorities are between you and them and are never refunded by Catcrafts in any case.",
|
||
"A product that arrives broken is a warranty case, not a return: the warranty section applies, and the shipping is on Catcrafts.",
|
||
} },
|
||
},
|
||
},
|
||
};
|
||
return pages;
|
||
}
|
||
|
||
} // namespace Catcrafts::Content
|