Search by

phprise / grogu-gateway

esdras-schonevald

A generic gateway for Symfony/ApiPlatform applications based on The OTAKU Manifesto.

Package info

github.com/phprise-foundation/grogu-gateway

Type:project

pkg:composer/phprise/grogu-gateway

Statistics

Installs: 1

Dependents: 0

Suggesters: 0

Stars: 0

Open Issues: 0

v1.0.0 2026-09-11 14:59 UTC

This package is auto-updated.

Last update: 2026-09-11 15:11:24 UTC


README

A generic gateway for Symfony/ApiPlatform applications based on the OTAKU Manifesto.

What it does

Grogu is a single entry point in front of many ApiPlatform services. It discovers each service's OpenAPI document at runtime, aggregates every route into one map, and forwards incoming requests to the service that owns the route.

Given enma=https://enma.io and nami=https://nami.io, a request to POST grogu.io/api/order is forwarded to POST nami.io/api/order.

How it works

  1. Bootstrap: reads the GROGU_SERVICES environment variable and builds a ServiceRegistry.
  2. Discovery: for every service, fetches {host}/api/docs.json and extracts its operations.
  3. Aggregation: builds a RouteMap. If two services expose the same method and path, an AmbiguousRouteException is thrown and the gateway refuses to start.
  4. Routing: resolves the incoming request against the map and forwards it to the owner.

Discovery happens on every request, so any change in a service's documentation is reflected immediately without restarting the gateway.

Configuration

Services are configured through the GROGU_SERVICES environment variable as a comma-separated list of name=host pairs:

export GROGU_SERVICES="enma=https://enma.io,nami=https://nami.io,yagami=https://yagami.io"

Different environments can expose different hosts, or omit services entirely (for example, authentication in a development environment).

Running

composer install
GROGU_SERVICES="nami=https://nami.splitpaybrasil.dev.br" php -S localhost:8000 -t public

Testing

vendor/bin/phpunit
vendor/bin/psalm

Philosophy

We follow The OTAKU Manifesto: Fluid Structure Design. Please read more about it in PHILOSOPHY.md. See our security policy in SECURITY.md.