content: sell foundation ownership, not the absence of middleware #11

Merged
chrnx merged 2 commits from feat/copy-strategy into main 2026-08-18 14:46:39 +00:00
11 changed files with 345 additions and 42 deletions
Showing only changes of commit 7238819520 - Show all commits

No files matched your search

+27 -8
View File
@@ -1,16 +1,22 @@
--- ---
const cards = [ const cards = [
{ title: 'Secure by default', body: 'Hardened response headers and CORS; native TLS on Node.' }, { title: 'Derive execution', body: 'Green Tea topologically sorts the graph. Stop maintaining execution order by hand.' },
{
title: 'Fail before traffic',
body: 'A missing dependency or an ambiguous route fails loudly at boot, not in production.',
},
{ {
title: 'Real validation', title: 'Real validation',
body: 'Standard Schema; bring zod, valibot, or arktype. No validator dependency in core.', body: 'Standard Schema; bring zod, valibot, or arktype. No validator dependency in core.',
}, },
{ title: 'OpenAPI 3.1', body: 'Projected from the same graph. No extra decorators.' },
{ title: 'See the graph', body: 'Interactive, served by your app. Not behind a paywall.' },
{ title: 'Loud boot', body: 'A missing dependency fails at startup, not in production.' },
{ {
title: 'One dependency', title: 'See what was derived',
body: "reflect-metadata only. No Express or Inversify maintenance chain underneath you.", body: 'Print the ordered pipeline, open the live graph, project the same metadata into OpenAPI 3.1.',
},
{ title: 'Secure by default', body: 'Hardened response headers and CORS; native TLS on Node.' },
{
title: 'A small foundation',
body: 'reflect-metadata is the only runtime dependency; ws and busboy are optional peers for sockets and uploads.',
}, },
]; ];
--- ---
@@ -18,8 +24,14 @@ const cards = [
<section class="batteries"> <section class="batteries">
<div class="wrap"> <div class="wrap">
<div class="batteries__head"> <div class="batteries__head">
<p class="kicker">Batteries, calm by design</p> <p class="kicker">Foundation ownership</p>
<h2>Serious defaults. Zero ceremony.</h2> <h2>We maintain the foundation. You maintain the product.</h2>
<p class="batteries__lede">
Routing, graph execution, validation integration, streaming, security defaults, errors, OpenAPI, lifecycle,
runtime adapters — the framework work your application would otherwise assemble and then keep working. The
goal isn't fewer dependencies for a badge; it's fewer moving parts your team has to understand, upgrade and
debug.
</p>
</div> </div>
<ul class="batteries__grid"> <ul class="batteries__grid">
@@ -46,6 +58,13 @@ const cards = [
margin-bottom: 0; margin-bottom: 0;
} }
.batteries__lede {
margin: 1rem 0 0;
max-width: 46rem;
color: var(--dim);
line-height: 1.75;
}
.batteries__grid { .batteries__grid {
list-style: none; list-style: none;
margin: 0; margin: 0;
+109
View File
@@ -0,0 +1,109 @@
---
const slices = [
{
route: 'GET /prices',
chain: ['market', 'handler'],
note: 'A public endpoint never asks for a user, so authentication is not in its graph slice.',
},
{
route: 'GET /portfolio',
chain: ['session', 'auth', 'user', 'portfolio', 'handler'],
note: 'A protected endpoint needs the user, so Green Tea follows the graph and includes it.',
},
];
---
<section class="demand section--panel">
<div class="wrap demand__inner">
<div class="demand__head">
<p class="kicker">Route slicing</p>
<h2>Run what the route needs. Not everything registered around it.</h2>
</div>
<ul class="demand__slices">
{
slices.map((slice) => (
<li class="demand__slice">
<p class="demand__route"><code>{slice.route}</code></p>
<p class="demand__chain">
{slice.chain.map((node, i) => (
<>
{i > 0 && <span class="demand__arrow" aria-hidden="true">→</span>}
<code>{node}</code>
</>
))}
</p>
<p class="demand__note">{slice.note}</p>
</li>
))
}
</ul>
<p class="demand__punch">
Routes don't inherit infrastructure just because it was registered nearby. Execution follows dependency
demand.
</p>
</div>
</section>
<style>
.demand {
padding-block: clamp(3rem, 8vw, 5.5rem);
}
.demand__head {
margin-bottom: 2.2rem;
max-width: 46rem;
}
.demand__head h2 {
margin-bottom: 0;
}
.demand__slices {
list-style: none;
margin: 0 0 2rem;
padding: 0;
display: grid;
gap: 1.5rem;
grid-template-columns: repeat(auto-fit, minmax(min(100%, 20rem), 1fr));
}
.demand__slice {
padding: 1.3rem 1.4rem;
border: 1px solid color-mix(in srgb, var(--dim) 18%, transparent);
border-radius: 12px;
}
.demand__route {
margin: 0 0 0.8rem;
font-family: var(--font-heading);
font-weight: 600;
}
.demand__chain {
margin: 0 0 0.9rem;
line-height: 2.1;
font-size: 0.95rem;
}
.demand__arrow {
color: var(--matcha);
margin-inline: 0.35rem;
}
.demand__note {
margin: 0;
color: var(--dim);
line-height: 1.7;
font-size: 0.95rem;
}
.demand__punch {
margin: 0;
max-width: 46rem;
font-size: 1.05rem;
line-height: 1.7;
color: var(--ink);
}
</style>
+20 -6
View File
@@ -7,11 +7,17 @@ import GraphMotif from '../GraphMotif.astro';
<div class="wrap graph-idea__inner"> <div class="wrap graph-idea__inner">
<p class="kicker">The idea</p> <p class="kicker">The idea</p>
<h2>A graph, not a chain.</h2> <h2>Declare what your code needs. Not when it should run.</h2>
<p class="graph-idea__body"> <p class="graph-idea__body">
Express-style frameworks make ordering your job — what runs here, what runs there, where you wire it. Green A handler needs <code>user</code>. Authorization needs <code>user</code>. User comes from authentication.
Tea inverts it. You ask for the highest-level thing you need, and its dependencies resolve transitively. Authentication needs a session. That is already enough information to describe execution order — so Green Tea
builds the graph from it, validates the wiring at boot, and runs only the slice the route requires.
</p>
<p class="graph-idea__chain" aria-label="session, then auth, then user, then authorization, then permissions, then handler">
<code>session</code> → <code>auth</code> → <code>user</code> → <code>authorization</code> →
<code>permissions</code> → <code>handler</code>
</p> </p>
<ul class="graph-idea__examples"> <ul class="graph-idea__examples">
@@ -23,9 +29,10 @@ import GraphMotif from '../GraphMotif.astro';
</ul> </ul>
<p class="graph-idea__punch"> <p class="graph-idea__punch">
This is pure composition. DI frameworks resolve a graph of <em>services</em>; Green Tea resolves your <em You describe the application; the framework derives the pipeline. DI frameworks resolve a graph of <em
>request pipeline</em >services</em
> the same way — the steps a route runs are computed from what it asks for, not the order you wrote them in. > — Green Tea resolves your <em>request pipeline</em> the same way, from what each route asks for rather than
from the order you happened to write things in.
</p> </p>
</div> </div>
</section> </section>
@@ -96,6 +103,13 @@ import GraphMotif from '../GraphMotif.astro';
color: var(--ink); color: var(--ink);
} }
.graph-idea__chain {
margin: 0 0 1.6rem;
font-size: 0.95rem;
line-height: 2.1;
color: var(--dim);
}
.graph-idea__punch { .graph-idea__punch {
margin: 0; margin: 0;
padding: 1.25rem 1.5rem; padding: 1.25rem 1.5rem;
+16 -5
View File
@@ -11,13 +11,16 @@ import GraphMotif from '../GraphMotif.astro';
<span class="hero__wordmark">Green Tea<span class="hero__dot">.</span></span> <span class="hero__wordmark">Green Tea<span class="hero__dot">.</span></span>
</div> </div>
<h1>Your API is a graph, not a middleware chain.</h1> <h1>Declare intent. Derive execution. Build your product.</h1>
<p class="hero__subhead"> <p class="hero__subhead">
Green Tea is a zen, opinionated, type-safe framework: you declare what each step needs — it computes the A zen, opinionated, type-safe TypeScript framework that turns what your code needs into a validated
order. One runtime dependency. Runs on Node, Deno, Bun, and Cloudflare Workers. execution graph. Green Tea derives the order, runs only the dependencies each route actually requires,
and shows you exactly what it built.
</p> </p>
<p class="hero__promise">You focus on business logic. Green Tea maintains the foundation.</p>
<div class="btn-row hero__ctas"> <div class="btn-row hero__ctas">
<a class="btn btn--primary" href="https://green-tea.expressive-tea.io/docs" target="_blank" rel="noopener noreferrer"> <a class="btn btn--primary" href="https://green-tea.expressive-tea.io/docs" target="_blank" rel="noopener noreferrer">
Get started Get started
@@ -30,7 +33,7 @@ import GraphMotif from '../GraphMotif.astro';
</a> </a>
</div> </div>
<p class="hero__micro">Beta · calm by design</p> <p class="hero__micro">Beta · Node · Deno · Bun · Edge</p>
</div> </div>
<GraphMotif class="hero__motif" width={460} height={400} opacity={0.55} /> <GraphMotif class="hero__motif" width={460} height={400} opacity={0.55} />
@@ -87,7 +90,15 @@ import GraphMotif from '../GraphMotif.astro';
color: var(--dim); color: var(--dim);
font-size: 1.1rem; font-size: 1.1rem;
line-height: 1.7; line-height: 1.7;
margin-bottom: 2rem; margin-bottom: 1.1rem;
}
.hero__promise {
margin: 0 0 2rem;
font-family: var(--font-heading);
font-size: 1.02rem;
line-height: 1.6;
color: var(--ink);
} }
.hero__ctas { .hero__ctas {
+5 -2
View File
@@ -6,8 +6,11 @@
<h2>Honest: it's beta.</h2> <h2>Honest: it's beta.</h2>
<p class="honest__body"> <p class="honest__body">
Express and Fastify have a decade of ecosystem. Green Tea doesn't — yet. You come for the model and the Express and Fastify have a decade of ecosystem behind them; NestJS has mature enterprise tooling. Green Tea
ergonomics. If you're tired of maintaining someone else's foundation, come try it. doesn't pretend otherwise. Choose it today because the model fits your application — explicit dependencies,
derived execution, inspectable infrastructure, one real-time mental model, and a foundation you don't have to
assemble. If your team needs a large plugin catalogue today, that gap is real, and the API can still change
before stable.
</p> </p>
<form class="subscribe" action="/subscribe.php" method="post"> <form class="subscribe" action="/subscribe.php" method="post">
+17 -5
View File
@@ -4,18 +4,30 @@
<section class="realtime section--panel"> <section class="realtime section--panel">
<div class="wrap realtime__inner"> <div class="wrap realtime__inner">
<p class="kicker">Real-time</p> <p class="kicker">Real-time</p>
<h2>One primitive for real-time.</h2> <h2>One mental model. Different transports.</h2>
<p class="realtime__body"> <p class="realtime__body">
SSE, ndjson, or a duplex WebSocket — one primitive, an <code>AsyncIterable</code>. You declare the transport Your business code has one idea — values arriving over time — and in Green Tea that idea is an <code
with a decorator (<code>@Sse</code>, <code>@Ws</code>, <code>@Stream</code>); only that one line changes. No >AsyncIterable</code
separate gateway, no bolt-on package — and your wire contract is what you declared, never a surprise sprung by >. Declare the transport with a decorator (<code>@Sse</code>, <code>@Ws</code>, <code>@Stream</code>) and
a return value. return the stream; the framework handles framing, backpressure, cleanup and disconnects. Only that one line
changes between them, and your wire contract is what you declared — never a surprise sprung by a return value.
</p>
<p class="realtime__tree">
<code>AsyncIterable</code> → <code>SSE</code> · <code>NDJSON</code> · <code>WebSocket</code>
</p> </p>
</div> </div>
</section> </section>
<style> <style>
.realtime__tree {
margin: 1.2rem 0 0;
font-size: 0.95rem;
line-height: 2.1;
color: var(--dim);
}
.realtime__inner { .realtime__inner {
max-width: 60ch; max-width: 60ch;
margin: 0 auto; margin: 0 auto;
+6 -5
View File
@@ -4,12 +4,13 @@ const chips = ['app.listen(port)', 'serveDeno(app)', 'serveBun(app)', 'edgeHandl
<section class="runs"> <section class="runs">
<div class="wrap runs__inner"> <div class="wrap runs__inner">
<p class="kicker">Runtime-agnostic</p> <p class="kicker">Portability</p>
<h2>Write it once. Run it on four targets.</h2> <h2>Your application model shouldn't belong to a runtime.</h2>
<p class="runs__body"> <p class="runs__body">
Node, Deno, Bun — and Cloudflare Workers at the edge. The same <code>src/</code> runs on all four; the only line The graph, routes, validation and business logic stay the same on Node, Deno, Bun and Cloudflare Workers.
that changes is how you serve it. Runtime-specific serving is isolated at the transport boundary — the only line that changes is how the
application is served.
</p> </p>
<ul class="runs__chips"> <ul class="runs__chips">
@@ -17,7 +18,7 @@ const chips = ['app.listen(port)', 'serveDeno(app)', 'serveBun(app)', 'edgeHandl
</ul> </ul>
<p class="runs__micro"> <p class="runs__micro">
Built on web standards. Not hostage to a runtime's fate. <span class="runs__caveat" Your product code shouldn't have to care which runtime won this year. <span class="runs__caveat"
>(The edge has no filesystem or mesh, so those features stay on the server runtimes.)</span >(The edge has no filesystem or mesh, so those features stay on the server runtimes.)</span
> >
</p> </p>
+21 -5
View File
@@ -26,18 +26,34 @@ class MeController {
<div class="wrap see-it__inner"> <div class="wrap see-it__inner">
<div class="see-it__head"> <div class="see-it__head">
<p class="kicker">See it</p> <p class="kicker">See it</p>
<h2>The whole model, in one screen.</h2> <h2>The signature is the contract.</h2>
<p class="see-it__lede">
If your handler needs it, it says so. Green Tea knows what the handler requires, which steps produce those
values, and what those steps need in turn — and if the graph can't satisfy that contract, it fails before
serving traffic. No hoping auth ran first, no archaeology through <code>app.use()</code>.
</p>
</div> </div>
<div class="see-it__code"> <div class="see-it__code">
<Code code={snippet} lang="ts" theme="github-dark-high-contrast" /> <Code code={snippet} lang="ts" theme="github-dark-high-contrast" />
</div> </div>
<p class="see-it__caption">Declare what you need. The framework figures out the order.</p> <p class="see-it__caption">
Then make the framework show its work: <code>app.explain()</code> prints the ordered pipeline, the live graph
is served by your own app, and the same metadata projects into OpenAPI. Automated does not have to mean
invisible.
</p>
</div> </div>
</section> </section>
<style> <style>
.see-it__lede {
margin: 1rem 0 0;
max-width: 46rem;
color: var(--dim);
line-height: 1.75;
}
.see-it__inner { .see-it__inner {
max-width: 780px; max-width: 780px;
margin: 0 auto; margin: 0 auto;
@@ -68,10 +84,10 @@ class MeController {
} }
.see-it__caption { .see-it__caption {
margin: 1.5rem 0 0; margin: 1.5rem auto 0;
text-align: center; max-width: 46rem;
color: var(--dim); color: var(--dim);
font-style: italic; line-height: 1.75;
font-size: 0.95rem; font-size: 0.95rem;
} }
</style> </style>
@@ -0,0 +1,114 @@
---
const rows = [
{ job: 'Execution order', owner: 'Green Tea' },
{ job: 'Dependency validation', owner: 'Green Tea' },
{ job: 'Route-specific pipeline', owner: 'Green Tea' },
{ job: 'Missing dependency checks', owner: 'Green Tea' },
{ job: 'Streaming mechanics', owner: 'Green Tea' },
{ job: 'OpenAPI projection', owner: 'Green Tea' },
{ job: 'Secure transport defaults', owner: 'Green Tea' },
{ job: 'Runtime serving boundary', owner: 'Green Tea' },
];
---
<section class="who">
<div class="wrap who__inner">
<div class="who__head">
<p class="kicker">Ownership</p>
<h2>Who should do the infrastructure work?</h2>
</div>
<dl class="who__list">
{
rows.map((row) => (
<div class="who__row">
<dt>{row.job}</dt>
<dd>{row.owner}</dd>
</div>
))
}
<div class="who__row who__row--you">
<dt>Business rules</dt>
<dd>You</dd>
</div>
</dl>
<p class="who__punch">
The framework should carry framework complexity. Your application should carry product complexity.
</p>
</div>
</section>
<style>
.who {
padding-block: clamp(3rem, 8vw, 5.5rem);
}
.who__head {
margin-bottom: 2.2rem;
}
.who__head h2 {
margin-bottom: 0;
}
.who__list {
margin: 0 0 2rem;
display: grid;
gap: 0;
max-width: 46rem;
}
.who__row {
display: flex;
align-items: baseline;
justify-content: space-between;
gap: 1rem;
padding-block: 0.75rem;
border-bottom: 1px solid color-mix(in srgb, var(--dim) 18%, transparent);
}
.who__row dt {
margin: 0;
color: var(--dim);
}
.who__row dd {
margin: 0;
font-family: var(--font-heading);
font-weight: 600;
color: var(--matcha);
white-space: nowrap;
}
.who__row--you {
border-bottom: none;
border-top: 1px solid var(--matcha);
margin-top: 0.6rem;
padding-top: 1.1rem;
}
.who__row--you dt {
color: var(--ink);
font-size: 1.05rem;
}
.who__row--you dd {
color: var(--violet);
font-size: 1.35rem;
}
.who__punch {
margin: 0;
max-width: 46rem;
font-size: 1.05rem;
line-height: 1.7;
color: var(--ink);
}
@media (max-width: 480px) {
.who__row {
font-size: 0.95rem;
}
}
</style>
+1 -1
View File
@@ -21,7 +21,7 @@ interface Props {
const { const {
title = 'Green Tea — A zen, type-safe graph-pipeline HTTP framework', title = 'Green Tea — A zen, type-safe graph-pipeline HTTP framework',
description = 'Green Tea is a graph-pipeline HTTP framework: declare what you need, not the order to build it. Runtime-agnostic, type-safe, calm by design.', description = 'Green Tea is a dependency-driven TypeScript backend framework: declare what your code needs and it derives, validates and executes the graph. Runtime-agnostic, type-safe, calm by design.',
image = '/og.png', image = '/og.png',
ogType = 'website', ogType = 'website',
robots = 'index, follow', robots = 'index, follow',
+9 -5
View File
@@ -1,7 +1,9 @@
--- ---
import Base from '../layouts/Base.astro'; import Base from '../layouts/Base.astro';
import Hero from '../components/sections/Hero.astro'; import Hero from '../components/sections/Hero.astro';
import WhoDoesTheWork from '../components/sections/WhoDoesTheWork.astro';
import GraphNotChain from '../components/sections/GraphNotChain.astro'; import GraphNotChain from '../components/sections/GraphNotChain.astro';
import FollowsDemand from '../components/sections/FollowsDemand.astro';
import HowItCompares from '../components/sections/HowItCompares.astro'; import HowItCompares from '../components/sections/HowItCompares.astro';
import RunsEverywhere from '../components/sections/RunsEverywhere.astro'; import RunsEverywhere from '../components/sections/RunsEverywhere.astro';
import RealTime from '../components/sections/RealTime.astro'; import RealTime from '../components/sections/RealTime.astro';
@@ -10,9 +12,9 @@ import SeeIt from '../components/sections/SeeIt.astro';
import Faq from '../components/sections/Faq.astro'; import Faq from '../components/sections/Faq.astro';
import HonestBeta from '../components/sections/HonestBeta.astro'; import HonestBeta from '../components/sections/HonestBeta.astro';
const title = 'Green Tea — Type-safe graph-pipeline framework for Node, Deno & Bun'; const title = 'Green Tea — Dependency-driven TypeScript backend framework';
const description = const description =
'Your API is a graph, not a middleware chain. Declare what each step needs and Green Tea computes the order — one runtime dependency, type-safe, runtime-agnostic, calm by design.'; 'Build TypeScript backends with less infrastructure in your head. Declare what your code needs and Green Tea derives, validates and executes the graph across Node, Deno, Bun and the edge.';
const canonicalURL = new URL('/', Astro.site).toString(); const canonicalURL = new URL('/', Astro.site).toString();
const repositoryURL = 'https://github.com/Expressive-Tea/green-tea'; const repositoryURL = 'https://github.com/Expressive-Tea/green-tea';
const structuredData = { const structuredData = {
@@ -47,12 +49,14 @@ const structuredData = {
<Base title={title} description={description} structuredData={structuredData}> <Base title={title} description={description} structuredData={structuredData}>
<Hero /> <Hero />
<WhoDoesTheWork />
<GraphNotChain /> <GraphNotChain />
<HowItCompares /> <FollowsDemand />
<RunsEverywhere /> <SeeIt />
<RealTime /> <RealTime />
<Batteries /> <Batteries />
<SeeIt /> <RunsEverywhere />
<HowItCompares />
<Faq /> <Faq />
<HonestBeta /> <HonestBeta />
</Base> </Base>