A robust restaurant ordering system built with Expo React Native that works seamlessly offline and syncs when online.
- ✅ Place and manage restaurant orders
- ✅ Works offline with automatic sync when online
- ✅ Real-time updates between devices using Socket.IO
- ✅ Automatic server discovery on local network
- ✅ Persistent data storage with PouchDB
- 💾 Custom AsyncStorage adapter for PouchDB
- 🔄 Bidirectional sync between devices
- 🌐 Network state management and automatic reconnection
- 📡 Zero-configuration network service discovery using Zeroconf
- 💬 Real-time messaging system for device communication
- Node.js 14+
- npm or yarn
- Expo CLI (
npm install -g expo-cli
)
-
Install dependencies:
npm install
-
Start the Expo development server:
npx expo start
-
Start the backend server (required for multi-device sync):
node server/index.js
- Start the backend server on your computer
- Connect multiple devices to the same WiFi network
- Run the app on each device
- The app will automatically discover the server
- Run the app connected to the server
- Turn off WiFi/data on your device
- Continue using the app - all changes are stored locally
- Reconnect to the network to sync changes
- PouchDBSetup: Custom AsyncStorage adapter for offline data persistence
- NetworkService: Manages connectivity, server discovery, and real-time communication
- DatabaseService: Handles data operations and synchronization
- Express.js backend with PouchDB for data storage
- Socket.IO for real-time communication
- RESTful API endpoints
- Zero-conf network discovery
The app uses a bidirectional sync mechanism:
- Local changes are pushed to the server when online
- Server changes are pulled to the device
- Conflict resolution is handled automatically by PouchDB
The app uses Zeroconf/Bonjour for automatic server discovery on local networks, making setup easier for restaurants with multiple devices.
Real-time communication between devices ensures immediate updates for new orders and status changes.