
I will have web app by using nextjs. also, creating mobile app by using flutter. i know nextjs provides server action which has similers to the cloud function.

so my question is should I create cloud function for all actions

then calling them from nextjs and flutter

Okay? If so you can use them instead of the function it should work just fine

You don't need to Appwrite functions when you have the next backend

The advantage to use the function is when you're approaching more in a serverless approach.

The best would be to mix them both.

can you elaborate it.

I'll try

i just think. if I can just create one projects, then deploy all functions to appwrite cloud function

then i only concern connecting to appwrite instead of depending on next server

If you're using next, then, it mean you've your application logic enclosed inside the next backend. Then it doesn't make sense to have them both, a deployed next backend and appwrite functions.

Yes, this a good approach

And this is actually how Appwrite is meant to be used.

correct me if i am wrong. one cloud function is just like one project . is there way i create one project having multiple function liek this,

One function is one deployment But you can handle multiple use-case inside one function

For example

Take a look at Kenny's function https://github.com/dishwasher-detergent/screenshot/tree/main/functions/screenshot

This function use an internal Hono router for handling multiple use-case inside one function.

this is nice. yes. something like this. just one deployment for multiple use case or similer to api routes

Exactly

That way your function can be a backend for your entire project.

Last thing
You can make your function handle many use-cases in other ways, also by parsing an action
variable for example

yes. thats nice. I plan that for one function deployment. then handle all usecase. then flutter and nextjs connecting directly to that function

it will be easy to maintain
Recommended threads
- Existing ID bug?!
Idk why this happens can someone explain!! why Im getting this error even if I "manually clear the collection" ?
- Constant 404 Pages
Whenever I am navigating through items and pages to go through my collections and database I end up at a page that sends me a 404 error, if i refresh it remains...
- Getting [object] [object] from appwrite
I'm fetching the data from appwrite having but for some reason I'm getting data in [object] [object] format why?
