Skip to content

v1.0.0 — An API gateway that shows where requests went

Latest

Choose a tag to compare

@dripips dripips released this 02 Sep 21:01

A gateway built from six PSR-15 middlewares in a fixed order — the order is the product.

  • Route, key, quota, cache, breaker, proxy — each stage either answers itself or passes the request on, and the dashboard shows how many stopped at each one
  • A token bucket that survives concurrency — refill and spend in a single UPDATE … RETURNING under a row lock, with the clock taken from the database
  • Two limits, the smaller wins — a per-key quota (minute and day) and a per-route rate limit, plus a burst that widens the bucket without raising the rate
  • A response cache with ETag — keyed by method, path and sorted query, never by the API key; a client holding the version gets 304 and no body
  • A circuit breaker with a single probe — 503 answered instantly instead of waiting for a timeout, and exactly one request becomes the half-open probe
  • Percentiles without storing every request — a nine-bucket histogram folded into per-minute rows; the raw log is for eyes and gets pruned
  • 33 tests on PostgreSQL, light and dark themes, README in three languages