Hi everyone, I'm starting a new project and wonder...
# help
s
Hi everyone, I'm starting a new project and wondering If I can use supabase, it's a food delivery app (Web + mobile) and at each step/state, a user (admin/delivery man, restaurant) can act on the order depending on its role. I will also have to track the location of delivery men and compute the price depending on many properties. Would supabase be suitable for this kind of apps ?
n
Hi everyone, I'm starting a new project and wondering If I can use supabase, it's a food delivery app (Web + mobile) and at each step/state, a user (admin/delivery man, restaurant) can act on the order depending on its role. I will also have to track the location of delivery men and compute the price depending on many properties. Would supabase be suitable for this kind of apps ?
Hello @Skander! This thread has been automatically created from your message in #843999948717555735 a ``few seconds ago``. Pinging @User so that they see this as well! Want to unsubscribe from this thread? Right-click the thread in Discord (or use the ... menu) and select Leave Thread to unsubscribe from future updates. Want to change the title? Use the
/title
command! We have solved your problem? Click the button below to archive it.
w
yes you can use supabase
n
Skander (2022-03-24)
s
Thank you ! Where will I put my custom logic for example delivery man can't change the status of an order from X to Y ? Or update the delivery man coordinates in real time ?
w
you can use postgres row level security to make sure that only certain roles can change the database
s
I'm not sure if I can put complex logic there, what about the price ? how would you compute the price depending on the distance for example or other fields ?
w
I don't know what you mean. Supabase can definitely do whatever it is you need in some form
s
Sorry for my bad english. Let's say that you will insert an order in the Order table, but before the insert you need to compute some properties depending on the input, for example you need to compute the price which depends on the distance between the points , and then after the insert you need to send notifications for all delivery men
w
you can write code to do anything
there are supabase libraries for many languages
s
I'm not sure that I understand what you meant , Where can I write code ? (I'm talking about the backend part not the frontend)
w
read the documentation for supabase
you don't have any idea what it really is
s
I've watched some videos, I know Row Level Security from PostgresSQL, I've read that supabase functions are not available yet that's why I'm asking. I'm asking supabase developers/experts if it's possible or not to use supabase to write custom logic. I don't want to lose some time trying with supabase then discovering that it's not possible to write some custom logic
w
you can write code
in a programming languages
using the supabase backend
s
from the supabase official website , have you seen the coming soon ?
w
no man
you can write code in any language
ignore the functions and read what supabase actually does
it can do whatever you need
s
Sorry I don't understand what you're talking about. Where I can write code in any language ?
w
I'm not answering your questions
read the website please
it's all explained really easily
if you can't figure it out you probably shouldn't be embarking on such a big project
s
You don't have the right to make any judgement or tell me what should I do or not. I've read many pages from the docs, watched all the videos from the getting started, It didn't answer my questions, that's why I'm asking here, instead of repeating the same sentence again and again you could have given me just one keyword
w
keyword = documentation
good luck
s
man you can't even differentiate between frontend and backend
but thank you for the advice, I have read the docs, now I need an expert to answer my question before diving into a big project, I'm asking if I can choose supabase or writing all the app from scratch
w
I answered your question you ape
just write code in a language of choice in the BACKEND (go, js, python, whatever) using supabase's postgres docs
you can use a library that supabase has for the language
or just use HTTP requests
my advice now is just to give up though
s
Like I said you can't differentiate between frontend and backend , you're still talking about the frontend libraries, the libraries are simple connectors/wrappers for a better use of the api. From what I read here, I didn't find an answer to my questions, that's why I'm asking. I want a precise answer so I can make big decisions. Thank you anyway but stop polluting the thread if you're repeating the same thing again and again. You didn't help anyone here. I can see that you posted a question without reading the docs so keep your advises for yourself
w
you're on crack
I've made a full-stack application using supabase, you haven't
s
Lol, making a full-stack app doesn't make you superior or an expert (I've made a lot from scratch and in different languages). You're disrespectful and you can't even answer a simple question, The documents doesn't contain all the use cases of the world otherwise I wouldn't ask here. (but they do contain the answer to your question that you asked and kind people sent you a link and didn't tell you "read the docs" or google it) you didn't help anyone and you didn't bring any added value to anyone.
s
I've just caught up on this thread, please read the guidelines and rule #2 of the platform again as from reading the messages here I don't think these are being met.
s
Yes, sorry for that, I just wanted to ask a simple question, but he was being disrespectful and he has made a personal judgement
g
@User Supabase is basically Postgres database with an API with auth capabilities and enhancements like realtime and storage. Plus a bunch of clients to make coding easier. RLS is mainly for securing access to rows in the database with a "reasonable" logic test. Postgres functions can do any amount of logic you want and can be called via the API/clients with an rpc call. So you could probably do most stuff in postgres functions... BUT many people have a backend server, with an API that can do more complex business logic and is easier to maintain, that in turn calls and uses the Supabase database and auth capabilities with more security oriented logic in the database. Postgres also supports constraints on columns and calculated columns. Alot depends on the complexity and security needs of your business logic and how much can run on the client as to if you need additional backend server logic, versus using Postgres functions. It is anticipated Supabase will launch some sort of server oriented functions at some point, but no timeline has been specified. These could act like an API backend one assumes, but there has been no info yet.
s
Thank you so much for this complete answer, I will try to use the maximum capabilities of Supabase in a short period to try build something with it
t
@User I am also exploring the same thing, for my app I don’t want to expose supabase API’s directly. Supabase has good support with node js to do several server side functionality but I prefer using supabase http api’s. Ideal flow could be user hit Api server and Api server hit supabase API’s. That’s the best solution I can think of right now. Do let me know if you have any other solutions
s
Great Idea, so you're using NodeJS as a kind of Gateway ? - What about the logic ? do you do it on the nodejs side or supabase side ? - Do you have any idea about realtime things , like tracking a user coordinates and send push notifications to a mobile app ?
t
@User Earlier I thought of using python by supabase library is still in alpha so I am thinking of using node js (they have a stable library for it) - logic I will put inside the node js side for example request params validation, rate limiting. It's just like a common node js app with DB but instead of directly interacting with DB use their APIs using Axios. So supabase API's is like service layer in node js app. - Some functionlaites available for server client https://supabase.com/docs/reference/javascript/auth-api-createuser - I didn't explore realtime things but as per their doc (https://supabase.com/docs/reference/javascript/supabase-client) they are using https://github.com/supabase/realtime-js which is integrated in supabase Node js client Overall I think it's mix and match of both the things, some of things (like registration, login) we have to put at frontend and some of the logic (dashboard APi's, etc) we can add that at backend
s
Thank you so much, Can I send you a private message ?
t
Yeah sure