DelivriLi is a comprehensive Digital Menu and Real-Time Delivery Progressive Web App (PWA) built for restaurants. It offers a complete end-to-end ecosystem for customers, restaurant staff, and couriers, featuring live GPS tracking, geofenced deliveries, and resilient state management.
- Interactive Digital Menu: Browse menus, customize items, and place orders seamlessly.
- Live Order Tracking: Real-time map tracking with live updates.
- Dynamic Routing: View the actual driving route (Trajet) the courier is taking, powered by Open Source Routing Machine (OSRM).
- Customer Geolocation: Customers can see their own live GPS position on the tracking map relative to the courier.
- Order Status Timeline: Step-by-step progress from Kitchen to Doorstep.
- Review System: Rate deliveries upon completion.
- Kanban-style Board: Manage orders across different states (
Pending,Preparing,Ready). - Real-Time Sync: Instant updates when customers order or couriers update delivery status.
- Performance Metrics: Track urgent orders, wait times, and daily revenue.
- Smart Dispatch: Real-time job alerts with audio/visual popups.
- Interactive Delivery Flow: Step-by-step actions (
Pick Up➔Arrive➔Mark Delivered). - Delivery Geofencing: Couriers must be within 250 meters of the customer's location to unlock the "Mark Delivered" button.
- Background Location Tracking: Broadcasts live GPS coordinates directly to the customer's tracking page.
- Offline Resilience: Polling and LocalStorage integration ensures the app works seamlessly even if network connectivity drops temporarily.
- Framework: Next.js (React)
- Styling: Tailwind CSS
- Database & Realtime: Supabase
- Maps & Routing: Leaflet.js & OSRM API
- State Management: React Hooks + LocalStorage syncing
- Icons: Lucide React
- Node.js (v18 or higher)
- npm or yarn
- A Supabase account and project
-
Clone the repository:
git clone https://github.com/zeriouil/DelivriLi.git cd DelivriLi -
Install dependencies:
npm install
-
Set up Environment Variables: Create a
.env.localfile in the root directory and add your Supabase credentials:NEXT_PUBLIC_SUPABASE_URL=your_supabase_project_url NEXT_PUBLIC_SUPABASE_ANON_KEY=your_supabase_anon_key
-
Run the Development Server:
npm run dev
Open http://localhost:3000 with your browser to see the result.
/src/app/- Main Next.js App Router pages (Customer view, Admin Dashboard, Courier App)./src/components/- Reusable React components grouped by feature (admin/,courier/,customer/)./src/lib/- Utilities and database connection configurations (Supabase)./src/types/- TypeScript definitions and data models.
- Courier Broadcasts: When a courier accepts a job, the app uses
navigator.geolocation.watchPositionto broadcast their live GPS coordinates. - Customer Polling: The tracking page receives the coordinates in real-time.
- OSRM Routing: The map requests a live route from the Courier's GPS to the Customer's Address (or live GPS).
- Geofence Enforcement: The courier's "Hand Over" button remains locked (🔒) until the Haversine distance formula confirms they are within 250m of the destination.
This project is licensed under the MIT License.