[Idea] The Toolpad backend agent #1407
Replies: 2 comments 5 replies
-
I like this feature, it would have many advantages compared to function datasources such as being more customizable, not having to store your private keys in Toolpad and being able to run complex queries without adding too much load to our servers. |
Beta Was this translation helpful? Give feedback.
-
Interesting idea, it sounds like a way to solve this problem: generating backend APIs in a format that Toolpad can directly interface with. I would imagine that on this trend, we could look into a Swagger integration. On a different note, I wonder if we couldn't go one step lower in abstraction by making it possible to provide functions like Next.js's API https://beta.nextjs.org/docs/data-fetching/api-routes, not even an express server, Toolpad host it. Or like https://docs.airplane.dev/tasks/js. The value is that it comes with built-in permissions and execution logs. This would make it possible to host this script: https://github.com/mui/mui-store/blob/master/accounting/generatePayout.mjs. |
Beta Was this translation helpful? Give feedback.
-
The Toolpad backend agent
Synopsis:
Our users want to interact with their own backend services. These services already have everything configured to interact with their downstream databases and APIs. Currently we rely on our users creating REST interfaces so that toolpad can interact with their backend. This requires a lot of ceremony. What if we allow our users to embed a small piece of toolpad directly in their service, where they can define queries usable in Toolpad.
Example:
Say the user has their existing node.js backend application
They can embed the toolpad agent as follows:
This allows them to interface with any library they're already using in their backend, together with the secrets that are already available there.
After they deploy their backend service to production an endpoint will be available as
https://user-domain/toolpad
. They will need to expose this endpoint publicly so that Toolpad can connect to it.The user will then go to the Toolpad application at e.g. app.toolpad.com and provide the url
https://user-domain/toolpad
to their project as a datasource. Now when creating queries based on this datasource, the user is presented with a dropdown containing 'getEmployees', ... When they select that item they get presented with bindable parameterage
where they can connect page state.During data fetching the query is proxied to the Toolpad agent in the user's backend and the result is made available on the page.
notes
Beta Was this translation helpful? Give feedback.
All reactions