--- import GraphMotif from '../GraphMotif.astro'; ---

The idea

Declare what your code needs. Not when it should run.

A handler needs user. Authorization needs user. User comes from authentication. 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.

session → auth → user → authorization → permissions → handler

  • Need an ACL check on a user? The ACL is a step that itself needs the user. Ask for the ACL — the user is pulled in for you.
  • Add a friends provider, then ask for friends — and the user arrives with the friend list.

You describe the application; the framework derives the pipeline. DI frameworks resolve a graph of services — Green Tea resolves your request pipeline the same way, from what each route asks for rather than from the order you happened to write things in.