Following my previous post about an architecture suggestion, I am happy to see that my first POC (a simple ping) properly works! And, icing on the cake, it gives a great DX as it is full hot-reload: the Admin App, the backend, and FastApi are in dev mode and, thanks to tunneling, the FastApi app can be reachable by the backend without needing any Cloudflare Worker deploy.
The Request Flow
The following sequence shows what happens when a user triggers a simple Ping action from the admin interface:

-
A user clicks a button in the Admin App (the Brush app hosted on Gadget.dev).
-
The Admin App sends an authenticated
POST /pingrequest to the Backend API (the Brush backend REST API hosted on Gadget.dev). -
The Backend API forwards the request to a public endpoint exposed through a Cloudflare Tunnel.
-
Cloudflare proxies the request to a FastAPI application running on
localhost. -
The FastAPI application receives the request at
POST /pingand returns:{ "message": "Ping successful!" } -
The response is sent back through the Cloudflare Tunnel.
-
The Backend API receives the response and returns it to the Admin App.
-
The Admin App displays the success message to the user.