Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
28b8d27be7 | ||
|
|
d2e2ef9ece |
No files matched your search
+2
-2
@@ -12,7 +12,7 @@ metadata:
|
||||
title: Courier
|
||||
description: Transaktionsmail für deine Apps über Amazon SES.
|
||||
icon: https://git.aimighty.olares.de/aimighty/courier/raw/branch/main/icon.png
|
||||
version: 26.11.10
|
||||
version: 26.11.12
|
||||
categories:
|
||||
- Applications
|
||||
|
||||
@@ -106,7 +106,7 @@ envs:
|
||||
default: "1000"
|
||||
|
||||
spec:
|
||||
versionName: '26.11.10'
|
||||
versionName: '26.11.12'
|
||||
fullDescription: |
|
||||
**Courier** ist ein kleiner Versanddienst für transaktionale E-Mails:
|
||||
eine Resend-kompatible HTTP-API, Warteschlange, Retry, Logs und
|
||||
|
||||
@@ -5,6 +5,7 @@ import { usePathname } from "next/navigation";
|
||||
import {
|
||||
Ban,
|
||||
BarChart3,
|
||||
Calculator,
|
||||
BookOpen,
|
||||
Globe,
|
||||
KeyRound,
|
||||
@@ -35,6 +36,7 @@ const groups: { title: string; items: Item[] }[] = [
|
||||
title: "Betrieb",
|
||||
items: [
|
||||
{ href: "/metrics", label: "Metriken", icon: BarChart3 },
|
||||
{ href: "/pricing", label: "Preise", icon: Calculator },
|
||||
{ href: "/docs", label: "Dokumentation", icon: BookOpen },
|
||||
],
|
||||
},
|
||||
|
||||
@@ -1108,3 +1108,80 @@ body {
|
||||
.app-nav--sidebar .app-nav__link[aria-current="page"]:hover {
|
||||
background: color-mix(in srgb, currentColor 9%, transparent);
|
||||
}
|
||||
|
||||
/* Link-Zustände in der Sidebar: nie von globalem a:hover/a:visited überschreiben lassen */
|
||||
a.app-nav__link,
|
||||
a.app-nav__link:visited {
|
||||
color: inherit;
|
||||
}
|
||||
|
||||
a.app-nav__link:hover {
|
||||
color: inherit;
|
||||
}
|
||||
|
||||
.app-nav--sidebar a.app-nav__link[aria-current="page"],
|
||||
.app-nav--sidebar a.app-nav__link[aria-current="page"]:hover {
|
||||
color: var(--ds-link);
|
||||
}
|
||||
|
||||
.app-nav--mobile a.app-nav__link[aria-current="page"],
|
||||
.app-nav--mobile a.app-nav__link[aria-current="page"]:hover {
|
||||
color: var(--ds-selection-text);
|
||||
}
|
||||
|
||||
/* Preise */
|
||||
.app-toolbar--pricing {
|
||||
grid-template-columns: minmax(12rem, 20rem) auto;
|
||||
}
|
||||
|
||||
@media (max-width: 63.99rem) {
|
||||
.app-toolbar--pricing {
|
||||
grid-template-columns: 1fr;
|
||||
}
|
||||
}
|
||||
|
||||
.app-plan-grid {
|
||||
display: grid;
|
||||
grid-template-columns: repeat(auto-fit, minmax(min(100%, 14rem), 1fr));
|
||||
gap: var(--ds-space-4);
|
||||
}
|
||||
|
||||
.app-plan {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
gap: var(--ds-space-2);
|
||||
}
|
||||
|
||||
.app-plan__head {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: space-between;
|
||||
gap: var(--ds-space-2);
|
||||
}
|
||||
|
||||
.app-plan__head h2 {
|
||||
margin: 0;
|
||||
font-size: var(--ds-text-lg);
|
||||
}
|
||||
|
||||
.app-plan__cost {
|
||||
margin-top: var(--ds-space-2);
|
||||
}
|
||||
|
||||
.app-plan__price {
|
||||
color: var(--ds-text-muted);
|
||||
font-size: var(--ds-text-sm);
|
||||
}
|
||||
|
||||
.app-plan__note {
|
||||
margin: 0;
|
||||
color: var(--ds-text-muted);
|
||||
font-size: var(--ds-text-sm);
|
||||
}
|
||||
|
||||
.app-plan__conditions {
|
||||
margin: 0;
|
||||
padding-inline-start: var(--ds-space-4);
|
||||
color: var(--ds-text-subtle);
|
||||
font-size: var(--ds-text-xs);
|
||||
}
|
||||
@@ -0,0 +1,147 @@
|
||||
import Link from "next/link";
|
||||
import { Calculator } from "lucide-react";
|
||||
|
||||
import { PageHeader } from "@/app/page-header";
|
||||
import { monthlyVolume } from "@/lib/queries";
|
||||
import { SES_PLANS, estimateMonthly, usd } from "@/lib/pricing";
|
||||
import { sesAccountStatus } from "@/lib/ses-admin";
|
||||
|
||||
export const dynamic = "force-dynamic";
|
||||
|
||||
export default async function Pricing({
|
||||
searchParams,
|
||||
}: {
|
||||
searchParams: Promise<{ volume?: string }>;
|
||||
}) {
|
||||
const params = await searchParams;
|
||||
const requested = Number(params.volume);
|
||||
const volume = Number.isFinite(requested) && requested > 0 ? Math.floor(requested) : 15000;
|
||||
|
||||
let usage = { month: 0, last30: 0 };
|
||||
let ses = { production: false, max24h: 0, rate: 0 };
|
||||
try {
|
||||
[usage, ses] = await Promise.all([monthlyVolume(), sesAccountStatus()]);
|
||||
} catch {
|
||||
// Die Preisliste funktioniert auch ohne Datenbank.
|
||||
}
|
||||
|
||||
const plans = SES_PLANS.map((plan) => ({ plan, cost: estimateMonthly(plan, volume) })).sort(
|
||||
(a, b) => a.cost - b.cost,
|
||||
);
|
||||
const cheapest = plans[0];
|
||||
const daysInMonth = new Date(new Date().getFullYear(), new Date().getMonth() + 1, 0).getDate();
|
||||
const projected = usage.month
|
||||
? Math.round((usage.month / new Date().getDate()) * daysInMonth)
|
||||
: 0;
|
||||
|
||||
return (
|
||||
<>
|
||||
<PageHeader
|
||||
title="Preise"
|
||||
lead="Was Amazon SES bei deinem Volumen kostet – AWS-Listenpreise, keine Schätzung aus Marketingmaterial."
|
||||
/>
|
||||
|
||||
<section className="app-stats" aria-label="Preis-Kennzahlen">
|
||||
<article className="ds-card app-stat">
|
||||
<span className="ds-stat__value">{usage.month}</span>
|
||||
<span className="ds-stat__label">Mails diesen Monat</span>
|
||||
<span className="ds-stat__meta">
|
||||
Hochrechnung: {projected} / Monat
|
||||
</span>
|
||||
</article>
|
||||
<article className="ds-card app-stat">
|
||||
<span className="ds-stat__value">{volume.toLocaleString("de-DE")}</span>
|
||||
<span className="ds-stat__label">Beispielvolumen</span>
|
||||
<span className="ds-stat__meta">entspricht 500 Mails/Tag</span>
|
||||
</article>
|
||||
<article className="ds-card app-stat">
|
||||
<span className="ds-stat__value">{usd(cheapest.cost)}</span>
|
||||
<span className="ds-stat__label">Günstigster Plan</span>
|
||||
<span className="ds-stat__meta">{cheapest.plan.name} bei diesem Volumen</span>
|
||||
</article>
|
||||
<article className="ds-card app-stat">
|
||||
<span className="ds-stat__value">{ses.production ? "Production" : "Sandbox"}</span>
|
||||
<span className="ds-stat__label">SES-Status</span>
|
||||
<span className="ds-stat__meta">
|
||||
{Math.round(ses.max24h)} Mails/Tag · {ses.rate}/s
|
||||
</span>
|
||||
</article>
|
||||
</section>
|
||||
|
||||
<section className="ds-card app-panel" aria-labelledby="rechner">
|
||||
<div className="app-panel__head">
|
||||
<div>
|
||||
<h2 id="rechner">Kostenrechner</h2>
|
||||
<p className="app-muted">AWS-Listenpreise für eu-west-1, ohne Steuern.</p>
|
||||
</div>
|
||||
</div>
|
||||
<form className="app-toolbar app-toolbar--pricing" method="get">
|
||||
<div className="ds-field">
|
||||
<label className="ds-field__label" htmlFor="volume">
|
||||
Mails pro Monat
|
||||
</label>
|
||||
<input
|
||||
className="ds-input"
|
||||
id="volume"
|
||||
name="volume"
|
||||
type="number"
|
||||
min={1}
|
||||
step={1000}
|
||||
defaultValue={volume}
|
||||
required
|
||||
/>
|
||||
<span className="ds-field__hint">Standard: 15.000 (500/Tag).</span>
|
||||
</div>
|
||||
<div className="app-toolbar__actions">
|
||||
<button className="ds-button" type="submit">
|
||||
<Calculator className="app-nav__icon" aria-hidden="true" />
|
||||
Berechnen
|
||||
</button>
|
||||
</div>
|
||||
</form>
|
||||
</section>
|
||||
|
||||
<section className="app-plan-grid app-section" aria-label="SES-Preispläne">
|
||||
{plans.map(({ plan, cost }) => (
|
||||
<article className="ds-card app-plan" key={plan.id}>
|
||||
<div className="app-plan__head">
|
||||
<h2>{plan.name}</h2>
|
||||
{plan.id === cheapest.plan.id ? (
|
||||
<span className="ds-badge ds-badge--success">Günstigster</span>
|
||||
) : null}
|
||||
</div>
|
||||
<span className="ds-stat__value app-plan__cost">{usd(cost)}</span>
|
||||
<span className="app-plan__price">
|
||||
{plan.base ? `${usd(plan.base)}/Monat + ` : "keine Grundgebühr + "}
|
||||
{usd(plan.tiers[0].rate)}/1.000
|
||||
</span>
|
||||
<p className="app-plan__note">{plan.note}</p>
|
||||
<ul className="app-plan__conditions">
|
||||
<li>0–10 Mio.: {usd(plan.tiers[0].rate)}/1.000</li>
|
||||
{plan.tiers[1] ? (
|
||||
<li>10–100 Mio.: {usd(plan.tiers[1].rate)}/1.000</li>
|
||||
) : null}
|
||||
{plan.tiers[2] ? <li>> 100 Mio.: {usd(plan.tiers[2].rate)}/1.000</li> : null}
|
||||
</ul>
|
||||
</article>
|
||||
))}
|
||||
</section>
|
||||
|
||||
<div className="ds-alert app-section">
|
||||
<div>
|
||||
<p className="ds-alert__title">Was in der Schätzung fehlt</p>
|
||||
<p className="ds-alert__text">
|
||||
Steuern, Datenübertragung für Anhänge ($0,12/GB), Dedicated IPs und SNS-Kosten sind
|
||||
nicht enthalten. Neue SES-Konten starten häufig auf <strong>Essentials</strong>; der
|
||||
Wechsel zu À la carte ist möglich. Preisstand: 23.11.2026, Quelle AWS SES Pricing.
|
||||
</p>
|
||||
<p className="ds-alert__text">
|
||||
<a href="https://aws.amazon.com/ses/pricing/" target="_blank" rel="noreferrer">
|
||||
AWS SES Preise öffnen
|
||||
</a>
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
</>
|
||||
);
|
||||
}
|
||||
@@ -0,0 +1,74 @@
|
||||
export type SesPlan = {
|
||||
id: string;
|
||||
name: string;
|
||||
base: number;
|
||||
tiers: { upTo: number | null; rate: number }[];
|
||||
note: string;
|
||||
};
|
||||
|
||||
export const SES_PLANS: SesPlan[] = [
|
||||
{
|
||||
id: "a-la-carte",
|
||||
name: "À la carte",
|
||||
base: 0,
|
||||
tiers: [{ upTo: null, rate: 0.1 }],
|
||||
note: "Pay-as-you-go, keine Grundgebühr.",
|
||||
},
|
||||
{
|
||||
id: "essentials",
|
||||
name: "Essentials",
|
||||
base: 0,
|
||||
tiers: [
|
||||
{ upTo: 10_000_000, rate: 0.16 },
|
||||
{ upTo: 100_000_000, rate: 0.14 },
|
||||
{ upTo: null, rate: 0.11 },
|
||||
],
|
||||
note: "Standard für neue SES-Konten, ohne Grundgebühr.",
|
||||
},
|
||||
{
|
||||
id: "pro",
|
||||
name: "Pro",
|
||||
base: 105,
|
||||
tiers: [
|
||||
{ upTo: 10_000_000, rate: 0.22 },
|
||||
{ upTo: 100_000_000, rate: 0.17 },
|
||||
{ upTo: null, rate: 0.12 },
|
||||
],
|
||||
note: "Mit Dedicated IPs und erweiterten Deliverability-Funktionen.",
|
||||
},
|
||||
{
|
||||
id: "enterprise",
|
||||
name: "Enterprise",
|
||||
base: 500,
|
||||
tiers: [
|
||||
{ upTo: 10_000_000, rate: 0.23 },
|
||||
{ upTo: 100_000_000, rate: 0.18 },
|
||||
{ upTo: null, rate: 0.13 },
|
||||
],
|
||||
note: "Mehrere Domains, viele Dedicated IPs und Seedlist-Tests.",
|
||||
},
|
||||
];
|
||||
|
||||
export function estimateMonthly(plan: SesPlan, volume: number): number {
|
||||
let remaining = Math.max(0, Math.floor(volume));
|
||||
let last = 0;
|
||||
let cost = plan.base;
|
||||
for (const tier of plan.tiers) {
|
||||
const limit = tier.upTo === null ? remaining : Math.min(remaining, tier.upTo - last);
|
||||
if (limit <= 0) break;
|
||||
cost += (limit / 1000) * tier.rate;
|
||||
remaining -= limit;
|
||||
last = tier.upTo ?? last;
|
||||
if (remaining <= 0) break;
|
||||
}
|
||||
return cost;
|
||||
}
|
||||
|
||||
export function usd(value: number): string {
|
||||
return new Intl.NumberFormat("de-DE", {
|
||||
style: "currency",
|
||||
currency: "USD",
|
||||
minimumFractionDigits: 2,
|
||||
maximumFractionDigits: 2,
|
||||
}).format(value);
|
||||
}
|
||||
@@ -178,3 +178,13 @@ export async function dailyMetrics(days = 14, keyId = ""): Promise<DailyMetric[]
|
||||
);
|
||||
return rows;
|
||||
}
|
||||
|
||||
export async function monthlyVolume(): Promise<{ month: number; last30: number }> {
|
||||
const { rows } = await query<{ month: number; last30: number }>(
|
||||
`select
|
||||
count(*) filter (where created_at >= date_trunc('month', now()))::int as month,
|
||||
count(*) filter (where created_at >= now() - interval '30 days')::int as last30
|
||||
from messages`,
|
||||
);
|
||||
return rows[0] ?? { month: 0, last30: 0 };
|
||||
}
|
||||
+2
-2
@@ -2,7 +2,7 @@ apiVersion: v2
|
||||
name: courier
|
||||
description: Transaktionsmail-Gateway für hubsport.club über Amazon SES.
|
||||
type: application
|
||||
version: 26.11.10
|
||||
appVersion: "26.11.10"
|
||||
version: 26.11.12
|
||||
appVersion: "26.11.12"
|
||||
icon: https://git.aimighty.olares.de/aimighty/courier/raw/branch/main/icon.png
|
||||
home: https://git.aimighty.olares.de/aimighty/courier
|
||||
@@ -12,7 +12,7 @@ metadata:
|
||||
title: Courier
|
||||
description: Transaktionsmail für deine Apps über Amazon SES.
|
||||
icon: https://git.aimighty.olares.de/aimighty/courier/raw/branch/main/icon.png
|
||||
version: 26.11.10
|
||||
version: 26.11.12
|
||||
categories:
|
||||
- Applications
|
||||
|
||||
@@ -106,7 +106,7 @@ envs:
|
||||
default: "1000"
|
||||
|
||||
spec:
|
||||
versionName: '26.11.10'
|
||||
versionName: '26.11.12'
|
||||
fullDescription: |
|
||||
**Courier** ist ein kleiner Versanddienst für transaktionale E-Mails:
|
||||
eine Resend-kompatible HTTP-API, Warteschlange, Retry, Logs und
|
||||
|
||||
+1
-1
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "courier",
|
||||
"version": "26.11.10",
|
||||
"version": "26.11.12",
|
||||
"private": true,
|
||||
"scripts": {
|
||||
"dev": "next dev -H 0.0.0.0 -p 3400",
|
||||
|
||||
Reference in new issue
Block a user