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
- how think about relationships?
From what I understand, relationships don't work like foreign keys. So, two things: Is the way to simulate foreign keys to manually pass references to IDs? In...
- Does anyone have a docker compose file f...
The compose file example on appwrite docs is 1.8.1 and I would like to try 1.9.0
- Docker compose 1.9.0 support
Hi! Sorry if I've missed something, but I saw that version 1.9.0 was released for self hosting, yet the compose file linked in the official documentation (https...