No description
Assigned tab was previously unfiltered by date — every assigned row in the system was shown, including items scheduled for the future (e.g. operator pre-assigns for tomorrow, driver sees them today). Live PB probe (2026-08-11) shows `assigned_at` is set to the SCHEDULED pickup date, not the moment of assignment: 15 currently assigned rows split evenly across Aug 18/19/20. New filter: `assigned_at` must fall within a rolling 2-day window in driver-local time (yesterday 00:00 → today 23:59:59.999). This covers today's work plus any carryover from yesterday that didn't get completed. Items scheduled for tomorrow or later stay hidden until their day rolls around. Window boundaries are computed in the driver's local timezone (this is a browser app, so `new Date()` is local) then converted to UTC ISO for the PB filter — works as long as driver + operator share a timezone, which is the case for the current single-region deployment. Empty-state copy updated so drivers understand why nothing might show even when they know there are upcoming pickups. check-pb-schema probe updated to match the new clauses so future regressions fail the build instead of silently showing everything. |
||
|---|---|---|
| .claude | ||
| .playwright-mcp | ||
| .vscode | ||
| app | ||
| components | ||
| e2e | ||
| lib | ||
| public | ||
| scripts | ||
| .dockerignore | ||
| .DS_Store | ||
| .env.example | ||
| .gitignore | ||
| api-response.json | ||
| Dockerfile | ||
| import_suppliers.py | ||
| next-env.d.ts | ||
| next.config.js | ||
| nginx.conf | ||
| package-lock.json | ||
| package.json | ||
| postcss.config.js | ||
| README.md | ||
| screenshot-settings.png | ||
| tailwind.config.js | ||
| tsconfig.json | ||
| tsconfig.tsbuildinfo | ||
1Driver - Mobile Collections App
A standalone mobile-first PWA app for drivers to manage collections in the field.
Features
- Mobile-first design - Optimized for phone use with touch-friendly UI
- PWA support - Install as a standalone app on iOS and Android
- Location tracking - Background location pings at configurable intervals
- Collection list - View assigned collections grouped by supplier
- Map view - See all collection stops on an interactive Leaflet map
- Offline support - Queue actions when offline and sync when connected
- Problem reporting - Report issues with photos and problem types
Screens
- List View - Shows all assigned collections for today/tomorrow, grouped by supplier
- Map View - Shows collection stops on a map with navigation integration
- Settings - Configure location tracking interval, accuracy, and display options
Tech Stack
- Next.js 14 (App Router)
- TypeScript
- Tailwind CSS
- PocketBase SDK
- Leaflet / React Leaflet
- Lucide Icons
PocketBase Integration
The app connects to your PocketBase instance at:
https://pocketbase-gnqc88suy8fqk6wyryjjdpvl.169.239.180.130.sslip.io
Required Collections
- collections - The main collection items (already exists)
- collection_problems - Problem reports
Fields: - collection (relation to collections) - problem_type (select: out_of_stock, partial_stock, quality_issue, wrong_item, other) - description (text) - photo (file) - reported_at (date) - driver_locations - Location tracking data
Fields: - driver (relation to users) - latitude (number) - longitude (number) - accuracy (number, optional) - altitude (number, optional) - speed (number, optional) - heading (number, optional) - timestamp (date) - order_items - Order items (already exists)
- suppliers - Supplier data with lat/lng (already exists)
Development
# Install dependencies
npm install
# Run development server
npm run dev
# Build for production
npm run build
Deployment
The app is configured for static export. Build output goes to the dist/ folder.
For PWA deployment, serve the dist/ folder with any static file server.
iOS Installation
- Open the app URL in Safari
- Tap the Share button
- Tap "Add to Home Screen"
- The app will install as a standalone PWA
Android Installation
- Open the app URL in Chrome
- Tap the menu (3 dots)
- Tap "Add to Home Screen" or "Install App"
Location Permissions
The app requires location permissions for:
- Showing your current position on the map
- Tracking driver locations at set intervals
- Calculating distances to collection stops
Notes
- Location tracking runs in the background while the app is open
- The app uses the PocketBase
userscollection for authentication - Collections are filtered to show only those assigned to the logged-in driver
- Status updates (collected/problem) sync immediately when online