No description
Find a file
Dave de16082ff7 feat: one invoice photo per PO, one-tap PO PDF, save lock, sharper photos
- Confirm Collection locks while saving ("Saving…") and the page drops a
  second collect for an item already in flight. Repeat taps on slow data
  re-ran the save and re-uploaded the photo (7 identical copies on one
  item on 2026-10-16).
- PO headers (and a single-PO supplier's list) get an Invoice button:
  photograph the supplier invoice once per PO, then "add pg 2", "pg 3".
  Pages go onto one customer line of the PO as invoice-<PO>-p<N>.jpg;
  WFDASH Collection Confirm already gathers photos per PO card. The page
  count is also kept on the device so it survives lines dropping off.
- PO button opens the PO PDF in one tap (shared buildPoFileUrl in
  lib/poDocs.ts, also used by the item detail modal).
- Collect modal says whether the PO's invoice is already uploaded, so
  the per-item photo is only for problems with the item.
- Photos now upload at 2000px / q0.8 (was 1200px / q0.7) so small print
  on invoices stays readable for the AI checks.
- Supplier header counts and detailed view now include items in PO
  grouping mode (they showed 0 items before).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-17 17:43:35 +02:00
.claude Add Playwright logs & settings; update app page 2026-06-10 00:05:06 +02:00
.playwright-mcp Add Playwright logs & settings; update app page 2026-06-10 00:05:06 +02:00
.vscode feat: initialize project with Next.js, TypeScript, and Tailwind CSS 2026-05-24 21:51:29 +02:00
app feat: one invoice photo per PO, one-tap PO PDF, save lock, sharper photos 2026-10-17 17:43:35 +02:00
components feat: one invoice photo per PO, one-tap PO PDF, save lock, sharper photos 2026-10-17 17:43:35 +02:00
e2e feat: add order item photo uploads and fix PB bugs 2026-07-08 01:35:26 +02:00
lib feat: one invoice photo per PO, one-tap PO PDF, save lock, sharper photos 2026-10-17 17:43:35 +02:00
public feat: add pickup proof photos, improve performance and UX 2026-07-07 20:43:17 +02:00
scripts feat(assigned): window by yesterday+today (driver-local timezone) 2026-08-18 15:46:37 +02:00
.dockerignore feat: initialize project with Next.js, TypeScript, and Tailwind CSS 2026-05-24 21:51:29 +02:00
.DS_Store chore: update binary .DS_Store and regenerate tsconfig.tsbuildinfo 2026-09-08 22:16:12 +02:00
.env.example feat: initialize project with Next.js, TypeScript, and Tailwind CSS 2026-05-24 21:51:29 +02:00
.gitignore Add PWA support and UI redesign 2026-05-27 00:34:50 +02:00
api-response.json Add Playwright logs & settings; update app page 2026-06-10 00:05:06 +02:00
Dockerfile Add PWA support and UI redesign 2026-05-27 00:34:50 +02:00
import_suppliers.py Refactor collections to order items 2026-05-25 00:47:47 +02:00
next-env.d.ts feat: initialize project with Next.js, TypeScript, and Tailwind CSS 2026-05-24 21:51:29 +02:00
next.config.js Add PWA support and UI redesign 2026-05-27 00:34:50 +02:00
nginx.conf Add PWA support and UI redesign 2026-05-27 00:34:50 +02:00
package-lock.json feat: add PO/Notes popovers, supplier color sidebar, fix popover clipping 2026-08-02 21:38:38 +02:00
package.json feat: add PO/Notes popovers, supplier color sidebar, fix popover clipping 2026-08-02 21:38:38 +02:00
postcss.config.js feat: initialize project with Next.js, TypeScript, and Tailwind CSS 2026-05-24 21:51:29 +02:00
README.md feat: initialize project with Next.js, TypeScript, and Tailwind CSS 2026-05-24 21:51:29 +02:00
screenshot-settings.png Add Playwright logs & settings; update app page 2026-06-10 00:05:06 +02:00
tailwind.config.js feat: shrink PO/Notes buttons, lift popover stacking, responsive header 2026-08-02 22:42:40 +02:00
tsconfig.json feat: initialize project with Next.js, TypeScript, and Tailwind CSS 2026-05-24 21:51:29 +02:00
tsconfig.tsbuildinfo chore: update binary .DS_Store and regenerate tsconfig.tsbuildinfo 2026-09-08 22:16:12 +02:00

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

  1. List View - Shows all assigned collections for today/tomorrow, grouped by supplier
  2. Map View - Shows collection stops on a map with navigation integration
  3. 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

  1. collections - The main collection items (already exists)
  2. 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)
    
  3. 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)
    
  4. order_items - Order items (already exists)
  5. 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

  1. Open the app URL in Safari
  2. Tap the Share button
  3. Tap "Add to Home Screen"
  4. The app will install as a standalone PWA

Android Installation

  1. Open the app URL in Chrome
  2. Tap the menu (3 dots)
  3. 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 users collection for authentication
  • Collections are filtered to show only those assigned to the logged-in driver
  • Status updates (collected/problem) sync immediately when online