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
- Migrate from cloud to localhost
Hello everyone. I need to migrate my test project from cloud to localhost, however it seems that this is possible only if a self-hosted appwrite instance it's h...
- Current User is Not authorized
recreating same Thread
- Account Status
Hello! I'm a student and am in the GitHub Student Organization, and according to GitHub, I am recieving pro membership via the Student Dev Pack. However, when I...