Skip to content

Latest commit

 

History

History
95 lines (69 loc) · 4.55 KB

File metadata and controls

95 lines (69 loc) · 4.55 KB

Technical Roadmap — GoNow Logistics Planner

Last Updated: April 2026 Purpose: Tracking of technical debt, architectural improvements, and domain-specific roadmap items.


🏗️ Architecture & Refactoring

1. Clean Architecture (Priority: Medium)

Goal: Decouple data fetching from View components.

  • Problem: App.tsx and RouteEditor.tsx are monolithic (God Objects). App.tsx manages all global listeners (>1000 lines).
  • Action Plan:
    • Service Extraction: Move useEffect listeners for Users, Customers, and Routes into dedicated hooks.
    • Data Context: Expand DataContext to cover all global data (Auth context done; Data context partially done).
    • Refactor RouteEditor: Extract logic into useRouteEditor hook. View should only handle rendering.
    • Refactor Settings: Split SystemSettings.tsx into sub-components (DeliverySettings, RouteCounters, Maintenance).

2. Client Performance (Priority: Medium)

Goal: Reduce initial load time.

  • Lazy Loading: Implement React.lazy() for heavy tabs (WarehouseView, Reporting, SystemSettings, RouteEditor).
  • Suspense UI: Add branded loading skeletons while fetching code chunks.

3. Reporting & Document Engine

  • Standardized PDF/Print Components: DownloadButton.tsx unified across Reporting.tsx and WarehouseView.tsx.
  • High-Fidelity PDF: Replaced native browser print with html2canvas + jsPDF.

🎨 UI/UX Design System

Design Standard: "Clean Professional"

Goal: Consistent "Premium White/Clean" aesthetic across all modules.

  • Standards: rounded-2xl, border-gray-100, soft shadows, uppercase tracking-wide headers, ringed avatars.
  • Status:
    • Fleet Management — fully updated (desktop table + mobile cards)
    • Warehouse View — Picking Manifest, Loading Plan, Inventory Status
    • Reporting — all sub-reports modernized
    • CustomerManagement.tsx and UserManagement.tsx — in progress
    • Logistics Dashboard (Command Center) — cards and map UI

Information Architecture

  • Menu renamed: "Manage Team" → "Team Management", "Manage Delivery" → "Route Management", "Manage Products" → "Product Management"
  • Sidebar reordered for operational flow (Route Management prioritized)

🚚 Logistics Domain

1. Data Integrity (Priority: High)

Issue: batchUpdateInventory uses sequential updateDoc calls. Network failure leads to partial updates. Fix: Rewrite to use Firestore Write Batch or Transactions for atomic operations.

2. Geocoding & Addressing (Priority: High)

Issue: Coordinates rely on regex parsing of pasted Google Maps URLs — brittle. Fix: Integrate a Geocoding API (Google Places, Mapbox, or Nominatim) to validate and standardise coordinate input.

3. Route Optimization

Issue: Current optimisation is a local 2-Opt heuristic (geometric, not drive-time aware).

  • Short Term: Label clearly as "Geometric Sort" in UI.
  • Long Term: Integrate Distance Matrix API (OSRM or GraphHopper) for real drive-time optimisation.

4. Search & Discovery

Current: Prefix search via searchKey field (case-insensitive range query). Improvement options:

  • searchKeywords array (lowercase name + phone tokens) for substring matching
  • Client-side Fuse.js for fuzzy search on datasets under 10k items

⚡ Scalability & Performance

Data Scalability

  • Completed: ProductService, CustomerService, UserService — cursor-based pagination.
  • Risk: App.tsx global listeners fetch all users and active routes. Will degrade beyond ~500 concurrent users.
  • Fix: Convert global listeners to on-demand keyed subscriptions; paginate dashboard feeds.

Offline Strategy

  • useCameraManager: queue photo uploads in IndexedDB when offline; flush on reconnect.
  • Verify Service Worker caching for static assets (fonts, map tiles).

💰 Firebase Cost Optimisation

  • Storage: Photos accumulate indefinitely. autoCleanupDays setting exists in System Settings but relies on client-side admin action — move to a scheduled Cloud Function.
  • Reads: Reduce global onSnapshot listeners to minimise Firestore read billing at scale.

🔧 Developer Experience

  • Validation: Add Firestore schema validation rules for products (enforce price > 0, quantity >= 0). — [ ] pending
  • Naming: Enforce PascalCase for components, camelCase for hooks and services (mostly done).
  • Role usage: Strict Role enum usage throughout — no magic strings.