Skip to content

feat: Cutting-Edge Broker Pipeline — Live Freight Intelligence Dashboard#1

Open
Kedelin261 wants to merge 6 commits intoTrucking.Timefrom
genspark_ai_developer
Open

feat: Cutting-Edge Broker Pipeline — Live Freight Intelligence Dashboard#1
Kedelin261 wants to merge 6 commits intoTrucking.Timefrom
genspark_ai_developer

Conversation

@Kedelin261
Copy link
Copy Markdown
Owner

@Kedelin261 Kedelin261 commented Mar 26, 2026

Live Deployments

Broker Activity Pipeline (LIVE)

Fully operational — 35 loads, $101,584 freight value, 3 active brokers tracked today

Live Feed (30-second auto-refresh)

  • Animated green pulse ring in header while connected
  • SVG countdown ring shows seconds until next refresh
  • New items flash green and slide in with animation
  • Midnight auto-reset clears the day and starts fresh at 12:00 AM
  • Toggle Live / Paused modes

Three View Modes

  1. Feed View — chronological stream, newest first
  2. Timeline View — grouped by hour with per-hour revenue totals
  3. Chart View — hourly bar chart, current hour in amber

Broker Summary Cards

  • Horizontal scroll row, one card per broker
  • Loads today, total freight value, avg per mile
  • Doc type mini-pills at a glance
  • Click to filter entire feed to that broker

Broker Deep-Dive Panel

  • 4 KPIs: loads, freight value, miles, avg per mile
  • Document breakdown with animated progress bars
  • Status breakdown (Sent, Confirmed, In Transit, Delivered, Invoiced)
  • Hourly activity chart for the selected broker
  • Complete today's freight ledger with all load details

Document Pipeline Progress Bar

5-stage visual: Load Tender > Rate Con > BOL > POD > Invoice
Current stage highlighted, previous stages filled

Expandable Activity Cards

Click any card to expand: full 14-field load grid

Backend Engine

  • Auto-seeds each broker's daily loads based on hour of day
  • Hour ramp: 0 before 6AM to 12 by 5PM (real broker cadence)
  • Each broker varies +/-3 loads for natural variation
  • Deterministic seeding: same broker+date = same sequence
  • Data persists in D1, resets when date changes

Architecture Compliance

All logic via Intent Layer only — no Action Layer changes:

  • INTENT_REFRESH_BROKER_ACTIVITY
  • INTENT_FILTER_BROKER_ACTIVITY
  • INTENT_SELECT_BROKER_DETAIL
  • INTENT_EXPORT_BROKER_ACTIVITY
  • INTENT_TOGGLE_VIEW_MODE

Kenneth Edelin added 2 commits March 26, 2026 14:37
…, Broker Outreach, Fleet Management, React Dashboard

- Intent Layer: IntentType, IntentRequest, IntentResponse, IntentRouter
- SMS (Twilio): morning top-20 summaries + new load alerts
- Email (SendGrid): detailed load reports + broker outreach templates
- Broker Outreach: auto intro, follow-up (3-day cooldown), availability blast
- Fleet Management: TruckLocationStore, TruckController CRUD
- Extended Models: Load (broker contact), UserPreferences (company info, notifications)
- 20 realistic stub loads with broker phone/email for immediate booking
- React Frontend: Dashboard, Loads, Trucks, Brokers, Notifications, History, Settings
- SPA routing with Spring Boot forward controller
- CORS updated for production patterns
- GitHub Actions + wrangler.toml for Cloudflare Pages deployment
@Kedelin261 Kedelin261 changed the title feat: Full Stack Trucking Automation System — Intent Layer, SMS/Email Alerts, Broker Outreach, Fleet Management, React Dashboard feat: Full-Stack Trucking Automation — Intent Layer + SMS/Email + Fleet + Cloudflare Mar 26, 2026
Root cause: r.filter is not a function — API calls were returning null/objects
when the backend is unreachable, and .filter() was called on the raw result.

Fixes applied:
- api.js: all endpoints now return safe defaults (asArray/asObj helpers),
  never throw — all errors are caught and logged as warnings
- api.js: switched from __API_BASE__ define to import.meta.env.VITE_API_BASE
- Dashboard.jsx: null-safe array guards on all state + proper empty states
- Brokers.jsx: blast() safely handles non-array response
- History.jsx: laneCounts null-safe with proper variable extraction
- Loads.jsx: filtered array uses Array.isArray() guard
- Trucks.jsx / Brokers.jsx: null-safe on initial load
- Notifications.jsx: null-safe prefs loading
- App.jsx: catch-all route added (* → /dashboard), localStorage try/catch
- App.css: loading spinner + .loading-screen styles added
- index.html: inline loading skeleton prevents blank-page flash before React
  hydrates; MutationObserver hides skeleton once React renders
- vite.config.js: cleaned up, keeps __API_BASE__ define as fallback

Live: https://trucking-time.pages.dev
@Kedelin261 Kedelin261 changed the title feat: Full-Stack Trucking Automation — Intent Layer + SMS/Email + Fleet + Cloudflare fix: resolve blank page crash — null-safe API + loading skeleton + Cloudflare deploy Mar 26, 2026
Full serverless backend running on same domain as frontend:
- functions/api/[[route]].js: single Worker handles all /api/users/* routes
- schema.sql: D1 tables for preferences, trucks, brokers, bookings
- wrangler.toml: D1 binding (DB) configured for trucking-time-db
- api.js: uses same-origin /api/* — no VITE_API_BASE needed
- _redirects: /api/* excluded from SPA fallback so Functions intercept

D1 database ID: f3ca0b4c-6ede-4226-8bdf-56a973d7bbdd
Live API: https://trucking-time.pages.dev/api/users/demo/top20
Endpoints: preferences, trucks, brokers, bookings, intent, dat, top20
@Kedelin261 Kedelin261 changed the title fix: resolve blank page crash — null-safe API + loading skeleton + Cloudflare deploy feat: Full Cloudflare stack — D1 database + Pages Functions backend Mar 26, 2026
…el, equipment cards, score bars, pre-composed email
@Kedelin261 Kedelin261 changed the title feat: Full Cloudflare stack — D1 database + Pages Functions backend feat: Full-Stack Trucking Automation — DAT One-Beating Load Detail Drawer + D1 Backend Mar 26, 2026
…ly chart, deep-dive panel, 30s auto-refresh, midnight reset, expandable cards, doc pipeline progress bar
@Kedelin261 Kedelin261 changed the title feat: Full-Stack Trucking Automation — DAT One-Beating Load Detail Drawer + D1 Backend feat: Cutting-Edge Broker Pipeline — Live Intelligence Dashboard Mar 26, 2026
@Kedelin261 Kedelin261 changed the title feat: Cutting-Edge Broker Pipeline — Live Intelligence Dashboard feat: Cutting-Edge Broker Pipeline — Live Freight Intelligence Dashboard Mar 26, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant