How Can I Set Up a Peer-to-Peer Connection for My Restaurant App?

0
1
Asked By TechGuru87 On

I'm developing an Android app that functions as a simple cash register, a kitchen view, and a waiter interface. The idea is to have three tablets operating each of these sections, all connecting through a local Wi-Fi network (without relying on the internet) using a peer-to-peer setup. The workflow goes like this: The cash register registers transactions, stores them in the database, and sends data to the kitchen database to display on the kitchen tablet. Once cooking is done, that data gets sent to the waiter database and then deleted from the kitchen database to indicate that the order has been completed and delivered. Does this setup sound feasible or overly complicated? I'm planning to use React Native for the app and SQLite for the database. Also, I've been looking into using a Raspberry Pi as a server—would that simplify things? My background is in web development with React, Laravel, and MySQL, so I'm thinking of using React Native for the front end, Laravel for the backend, and MySQL for the database.

2 Answers

Answered By DevExpert99 On

It sounds like you're trying to set up a system where each tablet keeps its own database and shares data, which could get pretty intricate and difficult to handle. Why not consider using a small server on your local network? Something like a Raspberry Pi could serve as a central point where all tablets connect and share a single database instead.

TechGuru87 -

Actually, my plan is to have one database with separate tables for each section. The cashier will insert data into the kitchen's table, and the kitchen tablet will fetch like that. I'm still figuring out how to do this offline without using the internet.

UserFriendly42 -

But wouldn't it be easier for smaller restaurants to have tablets spread out rather than manage a server? Just a thought.

Answered By CodeWizard01 On

You're right in considering a client/server architecture instead. It simplifies things a lot because the server acts as the only source of truth for your data. This means you won't have to deal with all the syncing issues you might encounter with a peer-to-peer setup. Plus, a server running on your LAN will work just fine even without internet access.

TechGuru87 -

I'm trying to wrap my head around client/server setups. Does that mean the cashier's tablet would act as both server and client, with the other two tablets just as clients? Or would it be better to have a dedicated server that all the tablets connect to?

CodeWizard01 -

Yes, having a dedicated server as a physical hub would be much cleaner and reliable for managing the connections and data.

Related Questions

LEAVE A REPLY

Please enter your comment!
Please enter your name here

This site uses Akismet to reduce spam. Learn how your comment data is processed.