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
Neto
Neto4mo ago
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
shockz
shockzOP4mo ago
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
Neto
Neto4mo ago
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
shockz
shockzOP4mo ago
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?
Neto
Neto4mo ago
yeah unless if you need hyper optimize the code almost any setup is good enough just build stuff
shockz
shockzOP4mo ago
Probably not for this project 😭 What would you do for "hyper-optimzation" though?
Neto
Neto4mo ago
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
shockz
shockzOP4mo ago
oo i see
Neto
Neto4mo ago
if you are building something new and not really sure, js is amazing at that
shockz
shockzOP4mo ago
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
shockz
shockzOP4mo ago
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.
shockz
shockzOP4mo ago
you can ignore most of the comments as idk fully how i want to do it
Neto
Neto4mo ago
you should look at design systems interviews most likely you will learn stuff that you didn't even know you need
shockz
shockzOP4mo ago
where could i find that!
Neto
Neto4mo ago
is a common topic to google/youtube
Neto
Neto4mo ago
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
shockz
shockzOP4mo ago
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.
Eve
Eve4mo ago
open google type 'git tutorials' press search
shockz
shockzOP4mo ago
im asking for recommendations of resources i know theres tutorials
Neto
Neto4mo ago
the best resource is to use and learn
shockz
shockzOP4mo ago
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
Neto
Neto4mo ago
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...
shockz
shockzOP4mo ago
thank you 🙏
Neto
Neto4mo ago
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"
shockz
shockzOP4mo ago
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?
Neto
Neto4mo ago
set the cookie on the response, and fetch the cookie where you need it
shockz
shockzOP4mo ago
even though its responding to next.js backend?
Neto
Neto4mo ago
yep
shockz
shockzOP4mo ago
how does that work
Neto
Neto4mo ago
as long as the cookie is able to be passed around it is automatically added to calls
shockz
shockzOP4mo ago
im a bit confused
Neto
Neto4mo ago
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-...
shockz
shockzOP4mo ago
for that specific client? This is how it works in my head
User Submits Signup Form > Next.js calls /auth/signup on Hono Backend > Hono creates session and user and responds with session cookie

Hono passes session cookie to Next.js > Next.js stores it??
User Submits Signup Form > Next.js calls /auth/signup on Hono Backend > Hono creates session and user and responds with session cookie

Hono passes session cookie to Next.js > Next.js stores it??
Neto
Neto4mo ago
the browser stores it watch it
shockz
shockzOP4mo ago
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
Neto
Neto4mo ago
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
shockz
shockzOP4mo ago
Were you suggesting the route sending the request? Because I wanted a seperate backend
Neto
Neto4mo ago
lil bro you do you
shockz
shockzOP4mo ago
But didnt want to make next.js useless no pls help me 😭
Neto
Neto4mo ago
i'm trying but you aren't listening
shockz
shockzOP4mo ago
ok so send from client you said this so thats why im confused
Neto
Neto4mo ago
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
shockz
shockzOP4mo ago
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?
Neto
Neto4mo ago
depends on what you plan to do you can always start on vite and move to nextjs if you need
shockz
shockzOP4mo ago
Alright thanks man i wasnt meaning to ignore you just misinterpreted you you've been a huge help
shockz
shockzOP4mo ago
drizzle kit couldn't have made a worse name
No description
Eve
Eve4mo ago
oh yes it could have
shockz
shockzOP4mo ago
dont tell me theres worse
Eve
Eve4mo ago
I've got one that's delicious_slimegirl
shockz
shockzOP4mo ago
😭 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?
Eve
Eve4mo ago
Probably not critical, but why reveal info you don't need to?
shockz
shockzOP4mo ago
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 });
Eve
Eve4mo ago
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."
shockz
shockzOP4mo ago
Thanks! Awesome solution.
Eve
Eve4mo ago
But is it overkill? Maybe.
shockz
shockzOP4mo ago
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
Eve
Eve4mo ago
I would say mailgun is fine, until you need their support.
shockz
shockzOP4mo ago
ahh who is your mail provider? (assuming you use one)
Eve
Eve4mo ago
granted that was also almost 6 years ago now
shockz
shockzOP4mo ago
true maybe diff now
Eve
Eve4mo ago
we're with SparkPost
shockz
shockzOP4mo ago
oo cool Do they offer a free option?
Eve
Eve4mo ago
:shrug:
shockz
shockzOP4mo ago
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
Eve
Eve4mo ago
I think mailgun should have that built in.
shockz
shockzOP4mo ago
oh neat easy!
Eve
Eve4mo ago
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.
shockz
shockzOP4mo ago
No description
shockz
shockzOP4mo ago
ty bookmarked that
Eve
Eve4mo ago
I don't build the emails, so I'm not super familiar. I just write the API calls lol
shockz
shockzOP4mo ago
it seems simple "drag & drop" so thats nice i guess haha
Want results from more Discord servers?
Add your server