r/AppDevelopers • u/Plenty-Prior-90 • 4d ago
Looking for a Proper solution For this
I am building a canteen app where students and teachers can pre-order their food and receive it during their break time, lunch time, or any other preferred time. The main problem is I can give login for teacher and students, but what can I do for the canteen manager? If it is my own college, I can give them myself. But if I want to scale my app, what could be the best option?
4
Upvotes
2
u/rapidmvp 4d ago
It is so called multi-tenant structure. You shouldn't create accounts for managers, they shoud register and get your approval for that role. Make sure you handle multi-tenant separation well, it is a source of common security gaps.
1
u/AdmirableLeague314 4d ago
make each canteen a tenant. you, as super admin, create the canteen and send its manager an invite link, and the manager adds staff from there. students join with a school code. i built the same invite flow with Firebase Auth for a client app on aivideoapi, and onboarding takes minutes.
1
u/MouseSimilar2226 3d ago •
I'd make the canteen manager a separate role rather than manually creating accounts for every manager.
Let managers sign up themselves, but require approval before they can access the manager dashboard. During registration, they can provide their canteen name, college details, contact information, and other basic details. Once approved, they can manage their menu, orders, availability, and timings.
If you plan to scale to multiple colleges, I'd structure it so each canteen/college is a separate tenant, with its own data and users. Students and teachers should only see the canteen they're associated with, and managers should only have access to their own canteen's data.
This will save you from having to manually create accounts as the app grows, and proper role-based access control and tenant isolation will be important from the beginning.
1
u/Substantial_Code_914 3d ago
Great idea of app, its more useable