Hey guys, weird question but am looking for suggestions.
Hey people!
I am starting in web development, and need some suggestions on what technologies I should use for my project.
The project idea is a Restaurant Management Platform
Which you can use a management portal (website) to manage your store, menus, employees and details + multiple branches if you have many locations.
And in-store some desktop-based solution for POS Systems, Kitchen Displays, Customer Displays + more.
I need help figuring out what tech to use for my site and in-store systems.
Currenlty I am using Next.js for my site, and then bun (+hono) for my backend, but I am unsure whether I should probably use Next.js api routes instead.
Also how should I handle in-store communication for real-time order, tracking updates? I may the two options of a dedicated store hub or cloud-based alternative.
Lastly is authentication, I think I like Auth.js, and have had great experience with using that + a database, though am not sure if that'd be suitable for "cooporate" clients.
Thanks guys, I am a complete noob so feel free to give me constructive ideas wherever you see fit :)
71 Replies
Unless it's a scaling issue already, your tech stack is fine
for backend, its fine to use bun+hono
for realtime, you can use direct websockets/sse or use something like socketi/pusher/whatever
authjs sucks for your usecase tho, as you can't really use it outside of nextjs, using something more agnostic and extensive like lucia or paying for a provider can make sure it's better
Thanks for the auth providers that was my main roadblock currently, I did manage to get it working in Hono thanks to some awesome Auth.js library, though will definetly check out Lucia as a better suggestion.
As for the bun+hono part, my main concern was since I'm using Next.js do I make it useless by having it's own backend? Or is next.js still purposeful here?
a.k.a should next.js talk to my backend directly?
or the client talks to backend?
Also how should I pass any authentication along?
Also lucia looks much nicer
nextjs as a api backend is subpar
better to use nextjs to talk to your separate api
any more than that should be specific for your use case
ok that's relieving to hear, i believed I was mis-using /overcomplicating my setup.
I'm also using drizzle and zod for the backend. All that is great and cool?
yeah
unless if you need hyper optimize the code
almost any setup is good enough
just build stuff
Probably not for this project 😭
What would you do for "hyper-optimzation" though?
is js with zod the fastest? no
if you were to use go/rust/whatever, your request could take 10? less ms, but the time to develop would be greater
oo i see
if you are building something new and not really sure, js is amazing at that
also ill just chuck a few more random probs stupid misc questions.
answer what you like
* for my in-store system, how should i handle authentication on the indivudal systems? like just have some qr-code kind of thing, or manual log-in for each system.
* if I chose a "hub" what should that be using? also a bun + hono system?
* i'm not amazing at databases, so if I had my users as two types "organization manager" vs "branch manager" for scope control, where organization managers handle store data, menus all that, where branch managers can only manage their specific branch/branches with set permissions for different branches. How do you structure such a "permissions-scope" setup. Like how do I specify different permissions, per branch. assume a branchId and organizationId, where branches are under the one organizationId.
sorry for the last one, no need to answer lol
here is an excalidraw that kind of explains the onboarding process
Excalidraw
Excalidraw — Collaborative whiteboarding made easy
Excalidraw is a virtual collaborative whiteboard tool that lets you easily sketch diagrams that have a hand-drawn feel to them.
you can ignore most of the comments as idk fully how i want to do it
you should look at design systems interviews
most likely you will learn stuff that you didn't even know you need
where could i find that!
is a common topic to google/youtube
GitHub
GitHub - donnemartin/system-design-primer: Learn how to design larg...
Learn how to design large-scale systems. Prep for the system design interview. Includes Anki flashcards. - donnemartin/system-design-primer
thanks man will defintely learn!
@nyx (Rustular DevRel) I'm back with some more questions, the system design stuff is awesome, I watched a whole on a mock Uber. Now I was going to ask, even though I'm currently working on my own, where are some resources to learn Git/Github as I've always been confused with it and def use it wrong. It's definetly a skill I need to improve on.
open google
type 'git tutorials'
press search
im asking for recommendations of resources
i know theres tutorials
the best resource is to use and learn
ok ty
but is there anything that can get me started
i def use it wrong and end up using it more like some google drive rather than what its actually meant for
Frontend Masters
YouTube
Everything You'll Need to Know About Git with ThePrimeagen | Preview
Full Course:
Everything You'll Need to Know About Git: https://www.frontendmasters.com/courses/everything-git/?utm_source=youtube&utm_medium=course_link&utm_campaign=everything-git
About this Course:
Never run into an unsolvable Git problem again. Create and manage repos, branch for parallel development, and resolve conflicts with merge and reb...
thank you 🙏
git isn't a hydra with 10 heads and complex setups
just use for what you need and move on
no need to "i don't know git enough to use it"
thanks man
I'm finding lucia very nice, so to be clear it's not an auth manager, more so a session one?
@Neto Hey question, with my auth api. Say the user creates an account and all is good and a sesssion is generated. Since the request would likely be through Next.js should I just pass the session id in the body and set the cookie on the next.js side?
set the cookie on the response, and fetch the cookie where you need it
even though its responding to next.js backend?
yep
how does that work
as long as the cookie is able to be passed around
it is automatically added to calls
im a bit confused
FourZeroThree
YouTube
What cookies are and how they work!
Cookies are small pieces of information/data that a website/web-server sends to your browser, so it can be stored in your computer’s hard-disk. The next time you make another request on the same website, your browser sends the cookie along with the request, so the website can identify you.
OTHER LINKS TO FOUR ZERO THREE:
✉️ Sign up to my email-...
for that specific client?
This is how it works
in my head
the browser stores it
watch it
i think im more confused on how next.js handles the request
Does next.js know the difference between people?
I watched the video but Im still not sure
Is the client or next.js sending the request
depends where do you send it
if you send from the page itself, the browser is sending the request
if you send from a nextjs api route, the server (nextjs) is sending the request
Were you suggesting the route sending the request?
Because I wanted a seperate backend
lil bro
you do you
But didnt want to make next.js useless
no
pls help me
😭
i'm trying but you aren't listening
ok
so send from client
you said this
so thats why im confused
if you want to use cookies properly, send from the client (react itself), to your hono backend, so after this you take the response and let the browser handle the cookie
nextjs/react in this case
i said nextjs, not nextjs api server
thats my mistake
alright
so from browser/react/nextjs (but not nextjs api server) to my backend
got it
ty
though my question now is, does that make next.js useless or is there still features that make it worth?
depends on what you plan to do
you can always start on vite and move to nextjs if you need
Alright
thanks man
i wasnt meaning to ignore you just misinterpreted you
you've been a huge help
drizzle kit couldn't have made a worse name
oh yes it could have
dont tell me theres worse
I've got one that's delicious_slimegirl
😭
who puts these words to start with
Is this bad practise
return c.json({ message: "An account with that email already exists." }, { status: 409 });
Is it critical that it potentially reveals a user?Probably not critical, but why reveal info you don't need to?
UX
I don't know if it can confuse a user seeing just
return c.json({ message: "An error occurred. Please try again." }, { status: 500 });
What we do, is return a generic "There was an error creating the account" and then email that account with a "Someone just tried to create an account with your email address [email protected]. If this was you and you would like to login instead, click here."
Thanks! Awesome solution.
But is it overkill? Maybe.
As part of the github student pack I think I get free mailgun, do you think that's a good service?
No it pains me not fully informing the user
but that way nicely confirms
I would say mailgun is fine, until you need their support.
ahh
who is your mail provider?
(assuming you use one)
granted that was also almost 6 years ago now
true maybe diff now
we're with SparkPost
oo cool
Do they offer a free option?
:shrug:
no 😭
ill just start with mailgun haha
random question,
for email bodies
what is the tool/framework /whatever that allows like "templates"
and user-specific content
I think mailgun should have that built in.
oh neat easy!
Mailgun
Email Templates | Responsive HTML Email Designs | Mailgun
Try Mailgun’s email templates feature to quickly create HTML emails directly in Mailgun’s UI and API.
ty bookmarked that
I don't build the emails, so I'm not super familiar. I just write the API calls lol
it seems simple
"drag & drop"
so thats nice i guess haha