Commit graph

18 commits

Author SHA1 Message Date
FreightDesk
59d93d5281 [OWL] Driver location tracking + bulk WhatsApp parser + deployment docs
Some checks are pending
FreightDesk CI/CD / Lint & Test (push) Waiting to run
FreightDesk CI/CD / Build Docker Image (push) Blocked by required conditions
FreightDesk CI/CD / Deploy to Coolify (push) Blocked by required conditions
Location Tracking:
- POST /api/location/update — driver GPS update
- GET /api/location/:load_id — get driver location for load
- Migration 007: vehicle_locations table with spatial indexes

Bulk WhatsApp Parser:
- UI for pasting multiple messages at once
- Batch parse via /api/parse-whatsapp
- Review parsed results with confidence scores
- Select and save all valid loads to database
- One-click import from WhatsApp to loads

Deployment:
- DEPLOYMENT.md: full deployment guide
- Environment configuration
- Docker + Docker Compose setup
- Coolify deployment steps
- Post-deployment checklist
- Troubleshooting guide
- Architecture diagram
2026-06-08 01:59:05 +00:00
FreightDesk
6be15fb059 [OWL] Admin moderation panel + deployment docs
Some checks are pending
FreightDesk CI/CD / Lint & Test (push) Waiting to run
FreightDesk CI/CD / Build Docker Image (push) Blocked by required conditions
FreightDesk CI/CD / Deploy to Coolify (push) Blocked by required conditions
Admin Moderation (/admin/moderation):
- Dashboard: pending shipper/driver verifications, payouts, disputes
- Approve/reject shipper registrations
- Approve/reject driver registrations
- Process payouts (approve/reject)
- Resolve disputes (refund shipper or release to driver)
- Stats overview (total shippers, drivers, loads, disputes)

Added Moderation link to admin sidebar
2026-06-08 01:54:35 +00:00
FreightDesk
4923357e29 [OWL] Payment escrow system + marketplace payment integration
Some checks are pending
FreightDesk CI/CD / Lint & Test (push) Waiting to run
FreightDesk CI/CD / Build Docker Image (push) Blocked by required conditions
FreightDesk CI/CD / Deploy to Coolify (push) Blocked by required conditions
Database (migration 006):
- escrow_accounts: per-user balance tracking (available + held)
- escrow_transactions: all financial transactions (deposit/hold/release/refund/payout/fee)
- payout_requests: driver withdrawal requests with bank/UPI details
- platform_config: fee settings (5% commission, min deposit, hold period)
- disputes: payment dispute tracking
- Enhanced loads table: payment_status, escrow_amount, platform_fee, settled_at

Escrow Routes (/escrow):
- GET /escrow — payment dashboard with balance and transactions
- GET/POST /escrow/deposit — deposit funds (simulated, production: Razorpay)
- POST /escrow/hold — move funds to escrow for a specific load
- POST /escrow/release — release funds to driver after delivery
- GET/POST /escrow/payout — driver payout request (UPI or bank)
- POST /escrow/admin/payouts/:id/approve — admin approves payout
- POST /escrow/dispute — raise payment dispute

Views:
- Payment dashboard (balance, transactions, quick actions)
- Deposit page with quick amounts
- Payout request page with bank/UPI forms
- Payment status card on load detail (shipper view)
- Hold/Release/Dispute actions integrated into marketplace flow

Payment Flow:
1. Shipper deposits funds → balance
2. Shipper accepts bid → hold in escrow (driver freight + 5% fee)
3. Delivery confirmed → release to driver
4. Driver requests payout → admin approves → bank transfer
2026-06-08 01:50:02 +00:00
FreightDesk
69d814c439 [OWL] SaaS Marketplace: registration, marketplace, bidding, notifications
Some checks are pending
FreightDesk CI/CD / Lint & Test (push) Waiting to run
FreightDesk CI/CD / Build Docker Image (push) Blocked by required conditions
FreightDesk CI/CD / Deploy to Coolify (push) Blocked by required conditions
Database:
- Migration 005: SaaS marketplace tables (enhanced shippers, vehicles, loads, bids, negotiations, ratings, notifications, load_views)

Public Registration:
- GET/POST /register/shipper — self-registration with validation
- GET/POST /register/driver — self-registration with vehicle details
- Public landing page with tricolor design
- Auto-login after registration

Marketplace:
- GET /marketplace — browse loads with filters (from, to, type, sort)
- GET /marketplace/load/:id — load detail with bid info
- GET/POST /marketplace/post — post a load (shipper)
- GET /marketplace/notifications — notification center with real-time badge
- GET /marketplace/notifications/count — unread count API

Bidding System:
- POST /marketplace/bid — place a bid (driver)
- POST /marketplace/bid/:id/accept — accept bid (shipper, auto-rejects others)
- POST /marketplace/bid/:id/negotiate — counter-offer
- POST /marketplace/rate — submit rating/review
- Automatic notifications on bid/accept/reject

Views:
- Marketplace index with load cards and bid status
- Load detail with bid form (driver) or bid management (shipper)
- Post load form with full details
- Notification center with mark-read
- Portal header/footer partials for portal layout

Architecture:
- Added portalUser to res.locals
- Wired /marketplace route into server.js
- Landing page at / (redirects to dashboard if logged in)
2026-06-08 01:35:24 +00:00
FreightDesk
04657b9f29 [OWL] WhatsApp parser v2 + mobile responsiveness + parser API
Some checks are pending
FreightDesk CI/CD / Lint & Test (push) Waiting to run
FreightDesk CI/CD / Build Docker Image (push) Blocked by required conditions
FreightDesk CI/CD / Deploy to Coolify (push) Blocked by required conditions
WhatsApp Parser v2:
- Pre-processing: normalize whitespace, expand abbreviations (frt→freight, adv→advance, etc.)
- Number format normalization: 1.5L→150000, 50K→50000, 2.5lakhs→250000
- Context-aware amount classification (freight vs advance vs commission vs driver pay)
- Multiple route patterns: 'X to Y', 'X → Y', 'From X to Y', 'X - Y'
- Vehicle number normalization with flexible spacing
- Date extraction (DD/MM/YYYY, DD-MM-YY, 15 Jan 2026)
- Material type and weight extraction
- Auto-calculate commission (5% default or freight - driver rate)
- Auto-calculate pending amounts
- Confidence scoring (high/medium/low)
- POST /api/parse-whatsapp endpoint
- GET /api/parser/test with sample messages

Mobile Responsiveness:
- Hamburger menu button on mobile
- Slide-in sidebar overlay
- Responsive stats grid (4→2→1 columns)
- Stacked filters and form rows on small screens
- Full-width action buttons
- Smaller login container on mobile
- Horizontal scroll for tables
- Pagination stacking on small screens
2026-06-08 01:15:11 +00:00
FreightDesk
ada58bc02f [OWL] Dashboard charts (Recharts CDN) + API layer + portal user management
Some checks are pending
FreightDesk CI/CD / Lint & Test (push) Waiting to run
FreightDesk CI/CD / Build Docker Image (push) Blocked by required conditions
FreightDesk CI/CD / Deploy to Coolify (push) Blocked by required conditions
Dashboard Charts:
- 4 interactive charts via Recharts CDN (no build step):
  * Freight & Commission trend (line chart, 6 months)
  * Load status distribution (pie chart)
  * Top routes by freight (bar chart)
  * Top shippers by freight (horizontal bar chart)
- Govt-app color theme (#000080 navy, #138808 green, #FF9933 saffron)
- INR formatting on tooltips and axes
- Async Recharts loading with retry

API Layer (/api):
- Full REST CRUD: loads, shippers, vehicles, payments
- Dashboard stats endpoint
- Pagination, filtering, sorting
- Role-based access control on writes
- Soft delete support

Portal User Management (/portal-users):
- Admin UI to create shipper/driver portal accounts
- Link to existing shippers/drivers
- Enable/disable, reset password, delete
2026-06-08 00:52:49 +00:00
FreightDesk
8e67cb98ae [OWL] REST API layer + Portal user management
Some checks are pending
FreightDesk CI/CD / Lint & Test (push) Waiting to run
FreightDesk CI/CD / Build Docker Image (push) Blocked by required conditions
FreightDesk CI/CD / Deploy to Coolify (push) Blocked by required conditions
REST API (/api):
- Full CRUD for loads, shippers, vehicles, payments
- Dashboard stats endpoint (/api/stats)
- Pagination, filtering, sorting on all list endpoints
- Role-based access control on write operations
- Soft delete support

Portal User Management (/portal-users):
- Admin UI to create shipper/driver portal accounts
- Link portal users to existing shippers/drivers
- Enable/disable accounts
- Reset passwords
- Lists all portal accounts with status

Architecture decision documented: keeping EJS+React CDN widgets as primary
2026-06-08 00:49:23 +00:00
FreightDesk
e74f321791 [OWL] Driver portal + Invoice PDF generation
Some checks are pending
FreightDesk CI/CD / Lint & Test (push) Waiting to run
FreightDesk CI/CD / Build Docker Image (push) Blocked by required conditions
FreightDesk CI/CD / Deploy to Coolify (push) Blocked by required conditions
Driver Portal:
- Refactored portal routes with shared auth + role-aware dashboard
- Driver dashboard (trips, earnings, advance, active loads)
- Driver load list (filterable, paginated)
- Driver load detail (with settlement summary: freight, commission, advance, balance)
- Shared login page detects role from credentials

Invoice PDF:
- Invoice PDF service (puppeteer-based, falls back to HTML)
- Professional invoice template (tricolor, Hindi+English, GSTIN)
- Commission calculation with TDS deduction (10%)
- GET /invoices (list, filterable by year/month)
- GET /invoices/:id (HTML preview with print button)
- GET /invoices/:id/pdf (PDF download)
- Invoices link in sidebar
2026-06-08 00:40:16 +00:00
FreightDesk
63ed6c445f [OWL] Client portal: shipper login + dashboard + load views
Some checks are pending
FreightDesk CI/CD / Lint & Test (push) Waiting to run
FreightDesk CI/CD / Build Docker Image (push) Blocked by required conditions
FreightDesk CI/CD / Deploy to Coolify (push) Blocked by required conditions
- Shipper portal auth (login/logout with bcrypt sessions)
- Shipper dashboard (stats: total loads, freight, paid, pending)
- Shipper load list (filterable by status, paginated)
- Shipper load detail (with payment history)
- Audit service helper (setAuditUser for session context)
- Wire /portal route into server.js
2026-06-07 20:05:52 +00:00
FreightDesk
795cc86b5a [OWL] Audit logging: cherry-pick Hermes' audit SQL, add routes + views
From Hermes' agent/default/soft-delete-audit branch:
- Add migration 004_audit_logging.sql (audit_logs table, trigger function,
  triggers on loads/shippers/vehicles/payments/portal_users,
  set_audit_user() helper function)
- Improved: uses IF NOT EXISTS, AFTER triggers, user session context var,
  distinguishes SOFT_DELETE vs HARD_DELETE, notes field

New:
- GET /audit-logs (admin-only, filterable by table/action, paginated)
- GET /audit-logs/:id (detail view with before/after JSON)
- Audit Logs link in sidebar

Keeps all existing OWL code: CI/CD, Pino, Prometheus, tests, cache-busting,
debounced search, ESLint, Prettier
2026-06-07 20:03:23 +00:00
FreightDesk
071f759b8a [OWL] Wire setup route file, remove inline setup routes from server.js
Some checks are pending
FreightDesk CI/CD / Lint & Test (push) Waiting to run
FreightDesk CI/CD / Build Docker Image (push) Blocked by required conditions
FreightDesk CI/CD / Deploy to Coolify (push) Blocked by required conditions
2026-06-07 19:52:25 +00:00
FreightDesk
0da63ae676 [OWL] Roadmap batch: CI/CD, observability, testing, UX polish 2026-06-07 19:49:46 +00:00
Hermes Agent
f1c75faba1 feat[agent]: add admin setup wizard (first-time admin creation) with secure password handling 2026-06-07 19:46:54 +00:00
FreightDesk
958fd74af5 [OWL] Restore auth.js — keep requireRole middleware (more complete than agent version) 2026-06-07 19:35:34 +00:00
FreightDesk
63e0be75b7 Merge remote-tracking branch 'origin/agent/default/security-improvements' 2026-06-07 19:35:10 +00:00
FreightDesk
5e10afebf1 [OWL] Security fixes: remove hardcoded password, add setup form, soft-delete migration
- Replace hardcoded admin123 with user-defined password via /setup form
- Add proper GET/POST /setup routes
- Create setup.ejs view with password validation (min 6 chars)
- Add migration 003: soft-delete columns (deleted_at) on loads/payments/shippers/vehicles
- Add load_count column to shippers
- requireRole middleware already present in auth.js
2026-06-07 19:34:22 +00:00
Hermes Agent
870a2501eb feat[agent]: add role-based access control to auth middleware
- Modify requireAuth middleware to enforce role filtering
- Prevent unauthorized access to protected routes
2026-06-07 19:29:57 +00:00
FreightDesk
1a4eaaa040 Initial commit: FreightDesk v1.0
- Express + EJS server-rendered app
- Supabase PostgreSQL database
- Auth: username/password with bcrypt
- Dashboard with business stats
- Load CRUD with filters
- WhatsApp message parser
- Payment tracking
- Shipper & vehicle management
- Reports (monthly, top shippers, routes)
- Government-app aesthetic (tricolor theme)
- Dark mode support
- Docker + Coolify deployment ready
- Seed data from existing business ledger (88 loads, 41 shippers, 70 vehicles)
2026-06-07 18:57:24 +00:00