Back

Does Appwrite support extensions or plugins?

  • 0
  • Self Hosted
  • Functions
  • Databases
Onder
12 Jun, 2024, 09:23

I want to create an ecommerce solution. And I would like to have some flows like when creating order and vice versa.

Well if it doesn't support extensions or plugins, at least it would be great to show some toasts to the admin in the appwrite so they know that they can't do some certaion operations.

I can hear some of you folks saying I should use functions but how can I return an error from it? And even if I can return error, does it show on appwrite dashboard? like when adding or updating a document?

TL;DR
Appwrite console does not support extensions or plugins. To enforce specific logic such as preventing admins from making mistakes, you need to handle it on a separate dashboard or UI frontend for your users. You can use Appwrite Functions to implement the necessary checks and validations on the backend, then react accordingly based on the results. In the case of showing feedback like toasts to admins, you would need to handle this through your custom UI based on responses from the SDK calls.
darShan
12 Jun, 2024, 09:29

You cannot add/implement middlewares, plugins or extensions on the console itself. If I understand you correctly, you need to show certain UI elements on some kind of events, for this you would have to build your own UI that implements your logic based on the returned values from the SDK responses.

Functions are suggested to execute some logic based on events. They can return values as well, based on which you could react on your implementations.

Also what exactly do you mean by this -

TypeScript
it would be great to show some toasts to the admin in the appwrite so they know that they can't do some certain operations.

An example or direction would be good to understand.

Onder
12 Jun, 2024, 09:32

Let me give you a scenario. Let say I want to process an order, To do that I have to check inventory of the product and stock values should be higher than the ordered product quantity. if not, i can't process this order. i have to do this validation in backend.

darShan
12 Jun, 2024, 09:35

Assuming this happens on "your" UI dashboard -

  1. You can either use Queries against DB calls for this to save Functions overhead
  2. Use Functions that use these similar queries

Based on the result from the task, take appropriate actions.

Onder
12 Jun, 2024, 09:36

But I can't do any affection on appwrite UI right?

darShan
12 Jun, 2024, 09:37

Aah no. Console doesn't support extensions, custom UI, plugins, etc. Its uses the SDK for Console backed by rest apis.

So its best to create a separate dashboard for your project, if possible for the best UX.

Onder
12 Jun, 2024, 09:38

to be precise i want to block admins to do mistakes on appwrite dashboard

Onder
12 Jun, 2024, 09:38

yep i'll certainly do. i think i get it. i have to do this logic on the UI i'll implement

darShan
12 Jun, 2024, 09:39

You could separate the admins into Teams, diff teams with diff roles and permissions. Make sure to checkout the Server as well as the Client SDKs. Pretty powerful to manage the underlying DBs.

Onder
12 Jun, 2024, 09:41

thanks a lot. well it would be great to decouple business logic to the appwrite but sometimes nothing to do i guess 😄

Reply

Reply to this thread by joining our Discord

Reply on Discord

Need support?

Join our Discord

Get community support by joining our Discord server.

Join Discord

Get premium support

Join Appwrite Pro and get email support from our team.

Learn more