Complete module-level documentation across Backend API, Web Frontend, and Mobile App
Node.js / Express 5 · TypeScript · 26 route files · 15 service files · PostgreSQL
/api/auth/*
/api/loads/*
/api/trips/*
/api/trucks/*
/api/drivers/*
/api/loadboard/*
/api/marketplace/*
/api/stripe/*
/api/payments/*
/api/hauler/*
/api/pricing/*
/api/jobs/*
/api/buy-and-sell/*
/api/resources/*
/api/job-messages, /buy-sell-messages, /resources-messages, /load-offer-messages, /truck-booking-messages
/api/admin/* (super-admin only)
/api/support/*
/api/kyc/*, /api/blogs/*
/api/services/*, /api/uploads/*
req.userrequireRoles(["hauler", "super-admin"]) — role gate with normalizationauditRequest(action, resourceFn) — writes to audit_logs table on mutationsReact 18 · Vite · TypeScript · Tailwind CSS · Radix UI · Leaflet.js + OpenStreetMap
| File | Backend Area |
|---|---|
lib/api.ts | Loads, trips, payments, support, uploads, route plans |
api/marketplace.ts | Bookings, contracts, offers, Stripe, subscriptions, profiles |
api/fleet.ts | Trucks CRUD, drivers CRUD |
api/jobs.ts | Job listings CRUD + applications |
api/buyAndSell.ts | Buy/sell listings |
api/resources.ts | Resources listings |
api/services.ts | Service listings + bookings |
api/disputes.ts | Dispute management |
api/kyc.ts | KYC verification |
api/payments.ts | Payment queries |
api/admin.ts | Admin dashboard stats |
5× *Messages.ts | Thread/message APIs for each listing type |
React Native 0.82 · Hermes · Redux Toolkit · React Navigation · Google Maps SDK
| File | Coverage |
|---|---|
client.ts | Axios instance with auth interceptor + base URL |
loads.ts | Load CRUD + assignment |
loadboard.ts | Browse loadboard |
trucks.ts | Fleet CRUD (create, update, delete, list) |
drivers.ts | Driver management |
marketplace.ts | Offers, contracts, truck board, hauler vehicles |
jobs.ts | Job listings + applications |
buySell.ts | Buy/sell listings |
resources.ts | Resources listings |
stripe.ts | Stripe Connect + subscriptions |
payments.ts | Payment queries |
5× *Messages.ts | Thread/message APIs per listing type |
Core tables from DDL files — enums define role and status constraints
| Table | Purpose |
|---|---|
app_users | All users: hauler, shipper, driver, stakeholder, super-admin |
loads | Livestock loads: species, quantity, pickup/dropoff, pricing, status |
trips | Trip lifecycle: planned → en_route → completed, GPS, route plans |
trip_route_plans | OSRM-generated route data, polyline, tolls, compliance |
trip_location_logs | GPS breadcrumbs per trip for live tracking |
trucks | Fleet vehicles: type, dimensions, capacity, hazmat, species |
drivers | Hauler team drivers with license tracking |
load_offers | Bidding: hauler offers on shipper loads |
contracts | Hauler-shipper contracts with terms and status |
truck_board_entries | Truck availability listings for the truck board |
truck_bookings | Shipper booking requests on truck listings |
payments | Escrow/direct payments with Stripe references |
disputes / dispute_messages | Payment dispute management with messaging |
job_listings / job_applications | Job marketplace |
buy_sell_listings / buy_sell_applications | Buy/sell marketplace |
resources_listings / resources_applications | Resources marketplace |
*_message_threads / *_messages | 5 messaging systems (job, buy-sell, resources, load-offer, truck-booking) |
service_listings / service_bookings | Stakeholder services marketplace |
support_tickets / support_ticket_messages | Customer support system |
kyc_requests | Know-Your-Customer verification |
subscriptions | Hauler subscription plans (Stripe) |
audit_logs | Immutable audit trail for all mutations |
pre_trip_checks / epod_records | Pre-trip inspections and electronic proof of delivery |
trip_expenses | Driver/trip expense tracking with receipts |
LivestockWay Technical Architecture Documentation · Generated March 2026